fixed: find_ticket_value (in plugins/ticket/templates.cpp)

should find the first item (can be more than one item with the same 'param')

fixed: added sorting tickets params in ReadTicketParams() (in plugins/ticket/ticketinfo.cpp)

fixed: plugin should have its own 'PluginInfo info' struct
a plugin's function can call another plugin's functions

added: removing tickets files/images

added: removing threads

changed: rm function will call WINIX_FILE_REMOVED now when deleting directories





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@710 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-23 23:23:24 +00:00
parent 915cabdf97
commit 3071df227a
47 changed files with 418 additions and 222 deletions

View File

@@ -21,6 +21,7 @@ namespace Thread
Reply::Reply()
{
fun.url = L"reply";
files_dir = 0;
}
@@ -37,22 +38,18 @@ void Reply::SetThreadInfo(ThreadInfo * pthread_info)
}
/*
we can use 'reply' function everywhere where 'thread_dir' mount option is defined
if there is no such a thread in 'thread' table it will be added automatically
*/
bool Reply::HasAccess()
{
if( !cur->request->is_item )
return false;
Item * dir = thread_info->FindThreadDir();
files_dir = thread_info->FindThreadDir();
if( !dir || !system->HasWriteAccess(*dir) )
return false;
plugin.Call(WINIX_PL_THREAD_CAN_USE_REPLY);
if( plugin.True() > 0 )
return true;
if( system->mounts.pmount->type != thread_info->mount_type_thread )
if( !files_dir || !system->HasWriteAccess(*files_dir) )
return false;
return true;
@@ -62,13 +59,8 @@ return true;
void Reply::MakePost()
{
Item * dir = thread_info->FindThreadDir();
if( !dir )
{
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
// !! jak bedzie dostepne assert
// ASSERT(files_dir)
if( tdb->GetThreadByFileId(cur->request->item.id, thread) != WINIX_ERR_OK )
{
@@ -85,7 +77,7 @@ void Reply::MakePost()
functions->ReadItem(answer, Item::file);
functions->SetUser(answer);
functions->PrepareUrl(answer);
answer.parent_id = dir->id;
answer.parent_id = files_dir->id;
answer.privileges = 0644; // !! tymczasowo
if( functions->CheckAbuse() )