some workarounds in Thread plugin (don't show stale info in html forms)
This commit is contained in:
parent
fb64f5e456
commit
aa71abd725
|
@ -102,6 +102,13 @@ void CreateThread::MakePost()
|
||||||
cur->request->item.parent_id = cur->request->dir_tab.back()->id;
|
cur->request->item.parent_id = cur->request->dir_tab.back()->id;
|
||||||
cur->request->item.item_content.privileges = system->NewFilePrivileges();
|
cur->request->item.item_content.privileges = system->NewFilePrivileges();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* temporary
|
||||||
|
* html templates are using last_item, and if CheckAbuse() returned true
|
||||||
|
* then the form would be empty
|
||||||
|
*/
|
||||||
|
cur->request->last_item = &cur->request->item;
|
||||||
|
|
||||||
if( functions->CheckAbuse() )
|
if( functions->CheckAbuse() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -134,6 +141,17 @@ void CreateThread::MakePost()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CreateThread::MakeGet()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* workaround:
|
||||||
|
* html form showed the title from the last directory
|
||||||
|
* this will be removed when new ezc object templates will be implemented
|
||||||
|
*/
|
||||||
|
empty_item.Clear();
|
||||||
|
cur->request->last_item = &empty_item;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010-2014, Tomasz Sowa
|
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -54,6 +54,7 @@ public:
|
||||||
CreateThread();
|
CreateThread();
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakePost();
|
||||||
|
void MakeGet();
|
||||||
|
|
||||||
void SetTDb(TDb * ptdb);
|
void SetTDb(TDb * ptdb);
|
||||||
void SetThreadInfo(ThreadInfo * pthread_info);
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
|
@ -64,6 +65,7 @@ private:
|
||||||
ThreadInfo * thread_info;
|
ThreadInfo * thread_info;
|
||||||
Thread thread;
|
Thread thread;
|
||||||
NotifyMsg notify_msg;
|
NotifyMsg notify_msg;
|
||||||
|
Item empty_item;
|
||||||
|
|
||||||
void SendNotify(const Item & item);
|
void SendNotify(const Item & item);
|
||||||
};
|
};
|
||||||
|
|
|
@ -132,6 +132,17 @@ void Reply::MakePost()
|
||||||
answer.parent_id = files_dir->id;
|
answer.parent_id = files_dir->id;
|
||||||
answer.item_content.privileges = system->NewFilePrivileges();
|
answer.item_content.privileges = system->NewFilePrivileges();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* temporary
|
||||||
|
* html templates are using last_item, and if CheckAbuse() returned true
|
||||||
|
* then the form would be empty
|
||||||
|
*
|
||||||
|
* here would be better to have something like last_item pointing to answer
|
||||||
|
* so when CheckAbuse() returned true thew we would show provieded values in the html form
|
||||||
|
*/
|
||||||
|
cur->request->last_item = &cur->request->item;
|
||||||
|
cur->request->item.item_content.guest_name.clear();
|
||||||
|
|
||||||
if( functions->CheckAbuse() )
|
if( functions->CheckAbuse() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -157,6 +168,18 @@ void Reply::MakePost()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Reply::MakeGet()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* workaround:
|
||||||
|
* html form showed the nick name from item
|
||||||
|
* this will be removed when new ezc object templates will be implemented
|
||||||
|
* we can provide two item templates: one for [item_url] and the rest for the html form
|
||||||
|
* [item_url] is used in <form...>
|
||||||
|
*/
|
||||||
|
cur->request->item.item_content.guest_name.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010-2014, Tomasz Sowa
|
* Copyright (c) 2010-2021, Tomasz Sowa
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -55,6 +55,7 @@ public:
|
||||||
Reply();
|
Reply();
|
||||||
bool HasAccess();
|
bool HasAccess();
|
||||||
void MakePost();
|
void MakePost();
|
||||||
|
void MakeGet();
|
||||||
|
|
||||||
void SetTDb(TDb * ptdb);
|
void SetTDb(TDb * ptdb);
|
||||||
void SetThreadInfo(ThreadInfo * pthread_info);
|
void SetThreadInfo(ThreadInfo * pthread_info);
|
||||||
|
@ -68,6 +69,7 @@ private:
|
||||||
Thread thread;
|
Thread thread;
|
||||||
Item * files_dir;
|
Item * files_dir;
|
||||||
NotifyMsg notify_msg;
|
NotifyMsg notify_msg;
|
||||||
|
Item empty_item;
|
||||||
|
|
||||||
void SendNotify(const Item & item);
|
void SendNotify(const Item & item);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue