changed: added Cur structure

we have there two pointers: 
 Request * request;
 Session * session;
these are the current request and the current session


the session GC was moved to SessionManager (was in SessionContainer)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-23 14:15:30 +00:00
parent 61ac29b2de
commit 915cabdf97
171 changed files with 2822 additions and 2650 deletions

View File

@@ -9,11 +9,10 @@ createthread.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
createthread.o: ../../core/user.h ../../core/group.h
createthread.o: ../../core/dircontainer.h ../../core/ugcontainer.h
createthread.o: ../../core/request.h ../../core/requesttypes.h
createthread.o: ../../core/session.h ../../core/error.h ../../core/user.h
createthread.o: ../../core/plugindata.h ../../core/rebus.h
createthread.o: ../../core/config.h ../../core/confparser.h
createthread.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
createthread.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
createthread.o: ../../core/error.h ../../core/config.h
createthread.o: ../../core/confparser.h ../../core/htmlfilter.h
createthread.o: ../../templates/htmltextstream.h ../../core/config.h
createthread.o: ../../core/system.h ../../core/dirs.h
createthread.o: ../../core/dircontainer.h ../../core/request.h
createthread.o: ../../notify/notify.h ../../notify/notifypool.h
createthread.o: ../../templates/locale.h ../../core/confparser.h
@@ -25,31 +24,34 @@ createthread.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
createthread.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
createthread.o: ../../core/basethread.h ../../core/synchro.h
createthread.o: ../../notify/templatesnotify.h ../../core/users.h
createthread.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
createthread.o: ../../core/mounts.h ../../core/mount.h
createthread.o: ../../core/user.h ../../core/ugcontainer.h
createthread.o: ../../core/lastcontainer.h ../../core/cur.h
createthread.o: ../../core/session.h ../../core/plugindata.h
createthread.o: ../../core/rebus.h ../../core/mounts.h ../../core/mount.h
createthread.o: ../../core/mountparser.h ../../core/users.h
createthread.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
createthread.o: ../../core/thumb.h ../../core/basethread.h
createthread.o: ../../core/synchro.h tdb.h thread.h ../../db/dbbase.h
createthread.o: threadinfo.h ../../functions/functions.h
createthread.o: ../../functions/functionbase.h
createthread.o: ../../functions/functionparser.h ../../functions/adduser.h
createthread.o: ../../functions/cat.h ../../functions/chmod.h
createthread.o: ../../functions/privchanger.h ../../functions/chown.h
createthread.o: ../../functions/ckeditor.h ../../functions/cp.h
createthread.o: ../../functions/default.h ../../functions/download.h
createthread.o: ../../functions/emacs.h ../../functions/last.h
createthread.o: ../../functions/login.h ../../functions/logout.h
createthread.o: ../../functions/ln.h ../../functions/ls.h
createthread.o: ../../functions/mkdir.h ../../functions/mv.h
createthread.o: ../../functions/node.h ../../functions/priv.h
createthread.o: ../../functions/reload.h ../../functions/rm.h
createthread.o: ../../functions/run.h ../../functions/specialdefault.h
createthread.o: ../../functions/stat.h ../../functions/subject.h
createthread.o: ../../functions/template.h ../../functions/tinymce.h
createthread.o: ../../functions/uname.h ../../functions/upload.h
createthread.o: ../../functions/uptime.h ../../functions/who.h
createthread.o: ../../functions/vim.h ../../core/htmlfilter.h
createthread.o: ../../functions/functionparser.h ../../core/cur.h
createthread.o: ../../functions/adduser.h ../../functions/cat.h
createthread.o: ../../functions/chmod.h ../../functions/privchanger.h
createthread.o: ../../functions/chown.h ../../functions/ckeditor.h
createthread.o: ../../functions/cp.h ../../functions/default.h
createthread.o: ../../functions/download.h ../../functions/emacs.h
createthread.o: ../../functions/last.h ../../functions/login.h
createthread.o: ../../functions/logout.h ../../functions/ln.h
createthread.o: ../../functions/ls.h ../../functions/mkdir.h
createthread.o: ../../functions/mv.h ../../functions/node.h
createthread.o: ../../functions/priv.h ../../functions/reload.h
createthread.o: ../../functions/rm.h ../../functions/run.h
createthread.o: ../../functions/specialdefault.h ../../functions/stat.h
createthread.o: ../../functions/subject.h ../../functions/template.h
createthread.o: ../../functions/tinymce.h ../../functions/uname.h
createthread.o: ../../functions/upload.h ../../functions/uptime.h
createthread.o: ../../functions/who.h ../../functions/vim.h
createthread.o: ../../core/htmlfilter.h
funthread.o: ../../core/misc.h ../../core/item.h funthread.h
funthread.o: ../../functions/functionbase.h ../../core/item.h ../../db/db.h
funthread.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
@@ -58,23 +60,23 @@ funthread.o: ../../core/log.h ../../core/textstream.h ../../db/dbitemquery.h
funthread.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
funthread.o: ../../core/dircontainer.h ../../core/ugcontainer.h
funthread.o: ../../core/request.h ../../core/requesttypes.h
funthread.o: ../../core/session.h ../../core/error.h ../../core/user.h
funthread.o: ../../core/plugindata.h ../../core/rebus.h ../../core/config.h
funthread.o: ../../core/confparser.h ../../core/htmlfilter.h
funthread.o: ../../templates/htmltextstream.h ../../core/config.h
funthread.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
funthread.o: ../../core/request.h ../../notify/notify.h
funthread.o: ../../notify/notifypool.h ../../templates/locale.h
funthread.o: ../../core/confparser.h ../../templates/misc.h
funthread.o: ../../templates/localefilter.h ../../templates/locale.h
funthread.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
funthread.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
funthread.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
funthread.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
funthread.o: ../../notify/notifythread.h ../../core/basethread.h
funthread.o: ../../core/synchro.h ../../notify/templatesnotify.h
funthread.o: ../../core/users.h ../../core/ugcontainer.h
funthread.o: ../../core/lastcontainer.h ../../core/mounts.h
funthread.o: ../../core/error.h ../../core/config.h ../../core/confparser.h
funthread.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
funthread.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
funthread.o: ../../core/dircontainer.h ../../core/request.h
funthread.o: ../../notify/notify.h ../../notify/notifypool.h
funthread.o: ../../templates/locale.h ../../core/confparser.h
funthread.o: ../../templates/misc.h ../../templates/localefilter.h
funthread.o: ../../templates/locale.h ../../../ezc/src/ezc.h
funthread.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
funthread.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
funthread.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
funthread.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
funthread.o: ../../core/basethread.h ../../core/synchro.h
funthread.o: ../../notify/templatesnotify.h ../../core/users.h
funthread.o: ../../core/user.h ../../core/ugcontainer.h
funthread.o: ../../core/lastcontainer.h ../../core/cur.h ../../core/session.h
funthread.o: ../../core/plugindata.h ../../core/rebus.h ../../core/mounts.h
funthread.o: ../../core/mount.h ../../core/mountparser.h ../../core/users.h
funthread.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
funthread.o: ../../core/thumb.h ../../core/basethread.h ../../core/synchro.h
@@ -86,9 +88,8 @@ init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
init.o: ../../core/item.h ../../db/dbitemquery.h ../../db/dbitemcolumns.h
init.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
init.o: ../../core/ugcontainer.h ../../core/request.h
init.o: ../../core/requesttypes.h ../../core/session.h ../../core/error.h
init.o: ../../core/user.h ../../core/plugindata.h ../../core/rebus.h
init.o: ../../core/config.h ../../core/confparser.h ../../core/htmlfilter.h
init.o: ../../core/requesttypes.h ../../core/error.h ../../core/config.h
init.o: ../../core/confparser.h ../../core/htmlfilter.h
init.o: ../../templates/htmltextstream.h ../../core/config.h
init.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
init.o: ../../core/request.h ../../notify/notify.h ../../notify/notifypool.h
@@ -100,8 +101,9 @@ init.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
init.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
init.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
init.o: ../../core/basethread.h ../../core/synchro.h
init.o: ../../notify/templatesnotify.h ../../core/users.h
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
init.o: ../../notify/templatesnotify.h ../../core/users.h ../../core/user.h
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h ../../core/cur.h
init.o: ../../core/session.h ../../core/plugindata.h ../../core/rebus.h
init.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
init.o: ../../core/users.h ../../core/groups.h ../../core/group.h
init.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h
@@ -110,7 +112,7 @@ init.o: showthreads.h ../../core/log.h ../../core/plugin.h pluginmsg.h
init.o: ../../core/system.h ../../core/sessionmanager.h
init.o: ../../core/sessioncontainer.h ../../functions/functions.h
init.o: ../../functions/functionbase.h ../../functions/functionparser.h
init.o: ../../functions/adduser.h ../../functions/cat.h
init.o: ../../core/cur.h ../../functions/adduser.h ../../functions/cat.h
init.o: ../../functions/chmod.h ../../functions/privchanger.h
init.o: ../../functions/chown.h ../../functions/ckeditor.h
init.o: ../../functions/cp.h ../../functions/default.h
@@ -136,28 +138,28 @@ reply.o: ../../core/item.h ../../core/error.h ../../core/log.h
reply.o: ../../core/textstream.h ../../db/dbitemquery.h
reply.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
reply.o: ../../core/dircontainer.h ../../core/ugcontainer.h
reply.o: ../../core/request.h ../../core/requesttypes.h ../../core/session.h
reply.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
reply.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
reply.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
reply.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
reply.o: ../../core/dircontainer.h ../../core/request.h ../../notify/notify.h
reply.o: ../../notify/notifypool.h ../../templates/locale.h
reply.o: ../../core/confparser.h ../../templates/misc.h
reply.o: ../../templates/localefilter.h ../../templates/locale.h
reply.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
reply.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
reply.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
reply.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
reply.o: ../../notify/notifythread.h ../../core/basethread.h
reply.o: ../../core/synchro.h ../../notify/templatesnotify.h
reply.o: ../../core/users.h ../../core/ugcontainer.h
reply.o: ../../core/lastcontainer.h ../../core/mounts.h ../../core/mount.h
reply.o: ../../core/mountparser.h ../../core/users.h ../../core/groups.h
reply.o: ../../core/group.h ../../core/loadavg.h ../../core/thumb.h
reply.o: ../../core/basethread.h ../../core/synchro.h tdb.h thread.h
reply.o: ../../db/dbbase.h threadinfo.h ../../functions/functions.h
reply.o: ../../functions/functionbase.h ../../functions/functionparser.h
reply.o: ../../core/request.h ../../core/requesttypes.h ../../core/error.h
reply.o: ../../core/config.h ../../core/confparser.h ../../core/htmlfilter.h
reply.o: ../../templates/htmltextstream.h ../../core/config.h
reply.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
reply.o: ../../core/request.h ../../notify/notify.h ../../notify/notifypool.h
reply.o: ../../templates/locale.h ../../core/confparser.h
reply.o: ../../templates/misc.h ../../templates/localefilter.h
reply.o: ../../templates/locale.h ../../../ezc/src/ezc.h
reply.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
reply.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
reply.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
reply.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
reply.o: ../../core/basethread.h ../../core/synchro.h
reply.o: ../../notify/templatesnotify.h ../../core/users.h ../../core/user.h
reply.o: ../../core/ugcontainer.h ../../core/lastcontainer.h ../../core/cur.h
reply.o: ../../core/session.h ../../core/plugindata.h ../../core/rebus.h
reply.o: ../../core/mounts.h ../../core/mount.h ../../core/mountparser.h
reply.o: ../../core/users.h ../../core/groups.h ../../core/group.h
reply.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h
reply.o: ../../core/synchro.h tdb.h thread.h ../../db/dbbase.h threadinfo.h
reply.o: ../../functions/functions.h ../../functions/functionbase.h
reply.o: ../../functions/functionparser.h ../../core/cur.h
reply.o: ../../functions/adduser.h ../../functions/cat.h
reply.o: ../../functions/chmod.h ../../functions/privchanger.h
reply.o: ../../functions/chown.h ../../functions/ckeditor.h
@@ -186,9 +188,8 @@ showthreads.o: ../../core/log.h ../../core/textstream.h
showthreads.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
showthreads.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
showthreads.o: ../../core/ugcontainer.h ../../core/request.h
showthreads.o: ../../core/requesttypes.h ../../core/session.h
showthreads.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
showthreads.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
showthreads.o: ../../core/requesttypes.h ../../core/error.h
showthreads.o: ../../core/config.h ../../core/confparser.h
showthreads.o: ../../core/htmlfilter.h ../../templates/htmltextstream.h
showthreads.o: ../../core/config.h ../../core/system.h ../../core/dirs.h
showthreads.o: ../../core/dircontainer.h ../../core/request.h
@@ -202,8 +203,10 @@ showthreads.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
showthreads.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
showthreads.o: ../../core/basethread.h ../../core/synchro.h
showthreads.o: ../../notify/templatesnotify.h ../../core/users.h
showthreads.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
showthreads.o: ../../core/mounts.h ../../core/mount.h
showthreads.o: ../../core/user.h ../../core/ugcontainer.h
showthreads.o: ../../core/lastcontainer.h ../../core/cur.h
showthreads.o: ../../core/session.h ../../core/plugindata.h
showthreads.o: ../../core/rebus.h ../../core/mounts.h ../../core/mount.h
showthreads.o: ../../core/mountparser.h ../../core/users.h
showthreads.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
showthreads.o: ../../core/thumb.h ../../core/basethread.h
@@ -231,20 +234,20 @@ templates.o: ../../notify/notifythread.h ../../core/basethread.h
templates.o: ../../core/synchro.h ../../notify/templatesnotify.h
templates.o: ../../core/config.h ../../core/users.h ../../core/user.h
templates.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
templates.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
templates.o: ../../core/mountparser.h ../../core/config.h
templates.o: ../../core/cur.h ../../core/session.h ../../core/error.h
templates.o: ../../core/plugindata.h ../../core/rebus.h ../../core/mounts.h
templates.o: ../../core/mount.h ../../core/mountparser.h ../../core/config.h
templates.o: ../../core/confparser.h ../../core/htmlfilter.h
templates.o: ../../core/users.h ../../core/groups.h ../../core/group.h
templates.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
templates.o: ../../core/basethread.h reply.h ../../functions/functionbase.h
templates.o: ../../core/request.h ../../core/requesttypes.h
templates.o: ../../core/session.h ../../core/plugindata.h
templates.o: ../../templates/htmltextstream.h ../../core/synchro.h tdb.h
templates.o: ../../db/dbbase.h funthread.h createthread.h showthreads.h
templates.o: ../../core/misc.h ../../core/plugin.h pluginmsg.h
templates.o: ../../core/system.h ../../core/sessionmanager.h
templates.o: ../../core/sessioncontainer.h ../../functions/functions.h
templates.o: ../../functions/functionbase.h ../../functions/functionparser.h
templates.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h
templates.o: reply.h ../../functions/functionbase.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../templates/htmltextstream.h
templates.o: ../../core/synchro.h tdb.h ../../db/dbbase.h funthread.h
templates.o: createthread.h showthreads.h ../../core/misc.h
templates.o: ../../core/plugin.h pluginmsg.h ../../core/system.h
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
templates.o: ../../functions/functions.h ../../functions/functionbase.h
templates.o: ../../functions/functionparser.h ../../core/cur.h
templates.o: ../../functions/adduser.h ../../functions/cat.h
templates.o: ../../functions/chmod.h ../../functions/privchanger.h
templates.o: ../../functions/chown.h ../../functions/ckeditor.h
@@ -286,9 +289,9 @@ threadinfo.o: ../../notify/notifythread.h ../../core/basethread.h
threadinfo.o: ../../core/synchro.h ../../notify/templatesnotify.h
threadinfo.o: ../../core/config.h ../../core/users.h ../../core/user.h
threadinfo.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
threadinfo.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
threadinfo.o: ../../core/mountparser.h ../../core/config.h
threadinfo.o: ../../core/cur.h ../../core/session.h ../../core/error.h
threadinfo.o: ../../core/plugindata.h ../../core/rebus.h ../../core/mounts.h
threadinfo.o: ../../core/mount.h ../../core/mountparser.h ../../core/config.h
threadinfo.o: ../../core/confparser.h ../../core/htmlfilter.h
threadinfo.o: ../../core/users.h ../../core/groups.h ../../core/group.h
threadinfo.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
threadinfo.o: ../../core/basethread.h
threadinfo.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h

View File

@@ -40,7 +40,7 @@ void CreateThread::SetThreadInfo(ThreadInfo * pthread_info)
// returning true if we can create a thread in the current directory
bool CreateThread::HasAccess()
{
if( request->is_item || !system->HasWriteAccess(*request->dir_tab.back()) )
if( cur->request->is_item || !system->HasWriteAccess(*cur->request->dir_tab.back()) )
return false;
if( system->mounts.pmount->type != thread_info->mount_type_thread )
@@ -54,34 +54,34 @@ return true;
void CreateThread::MakePost()
{
request->item.Clear();
functions->ReadItem(request->item, Item::file);
functions->SetUser(request->item);
functions->PrepareUrl(request->item);
request->item.parent_id = request->dir_tab.back()->id;
request->item.privileges = 0644; // !! tymczasowo
cur->request->item.Clear();
functions->ReadItem(cur->request->item, Item::file);
functions->SetUser(cur->request->item);
functions->PrepareUrl(cur->request->item);
cur->request->item.parent_id = cur->request->dir_tab.back()->id;
cur->request->item.privileges = 0644; // !! tymczasowo
if( functions->CheckAbuse() )
return;
request->status = system->AddFile(request->item);
cur->request->status = system->AddFile(cur->request->item);
if( request->status == WINIX_ERR_OK )
if( cur->request->status == WINIX_ERR_OK )
{
thread.Clear();
thread.file_id = request->item.id;
request->status = tdb->AddThread(thread);
thread.file_id = cur->request->item.id;
cur->request->status = tdb->AddThread(thread);
}
if( request->status == WINIX_ERR_OK )
if( cur->request->status == WINIX_ERR_OK )
{
log << log2 << "CreateThread: added a new thread" << logend;
system->RedirectTo(request->item);
system->RedirectTo(cur->request->item);
}
else
{
log << log1 << "CreateThread: problem with adding a new thread, error code: "
<< request->status << logend;
<< cur->request->status << logend;
}
}

View File

@@ -36,7 +36,7 @@ void FunThread::SetThreadInfo(ThreadInfo * pthread_info)
bool FunThread::HasAccess()
{
if( !request->is_item )
if( !cur->request->is_item )
return false;
if( system->mounts.pmount->type != thread_info->mount_type_thread )
@@ -52,9 +52,9 @@ void FunThread::PrepareThread(long file_id)
{
thread_info->Clear();
//request->status = tdb->GetThreadByFileId(file_id, thread);
//cur->request->status = tdb->GetThreadByFileId(file_id, thread);
request->status = tdb->GetAnswers(file_id, id_tab);
cur->request->status = tdb->GetAnswers(file_id, id_tab);
if( !id_tab.empty() )
{
@@ -82,7 +82,7 @@ void FunThread::PrepareThread(long file_id)
void FunThread::MakeGet()
{
PrepareThread(request->item.id);
PrepareThread(cur->request->item.id);
}

View File

@@ -51,10 +51,10 @@ void SelectDefaultFunction(PluginInfo & info)
{
if( info.system->mounts.pmount->type == thread_info.mount_type_thread )
{
if( info.request->is_item )
info.request->function = &fun_thread;
if( info.cur->request->is_item )
info.cur->request->function = &fun_thread;
else
info.request->function = &fun_show_threads;
info.cur->request->function = &fun_show_threads;
}
}

View File

@@ -39,7 +39,7 @@ void Reply::SetThreadInfo(ThreadInfo * pthread_info)
bool Reply::HasAccess()
{
if( !request->is_item )
if( !cur->request->is_item )
return false;
Item * dir = thread_info->FindThreadDir();
@@ -66,19 +66,19 @@ void Reply::MakePost()
if( !dir )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( tdb->GetThreadByFileId(request->item.id, thread) != WINIX_ERR_OK )
if( tdb->GetThreadByFileId(cur->request->item.id, thread) != WINIX_ERR_OK )
{
thread.Clear();
thread.file_id = request->item.id;
thread.file_id = cur->request->item.id;
tdb->AddThread(thread);
}
answer.Clear();
answer.url = request->item.url;
answer.url = cur->request->item.url;
answer.url += L"_msg_";
answer.url += Toa(thread.replies + 1);
answer.subject = answer.url;
@@ -91,21 +91,21 @@ void Reply::MakePost()
if( functions->CheckAbuse() )
return;
request->status = system->AddFile(answer);
cur->request->status = system->AddFile(answer);
if( request->status == WINIX_ERR_OK )
request->status = tdb->EditThreadAddItem(request->item.id, answer.id);
if( cur->request->status == WINIX_ERR_OK )
cur->request->status = tdb->EditThreadAddItem(cur->request->item.id, answer.id);
if( request->status == WINIX_ERR_OK )
if( cur->request->status == WINIX_ERR_OK )
{
log << log2 << "Reply: added an answer in a thread" << logend;
system->RedirectTo(request->item);
system->RedirectTo(cur->request->item);
}
else
{
log << log1 << "Reply: problem with adding an answer, error code: "
<< request->status << logend;
<< cur->request->status << logend;
}
}

View File

@@ -39,7 +39,7 @@ void ShowThreads::SetThreadInfo(ThreadInfo * pthread_info)
bool ShowThreads::HasAccess()
{
if( request->is_item )
if( cur->request->is_item )
return false;
if( system->mounts.pmount->type != thread_info->mount_type_thread )
@@ -87,7 +87,7 @@ void ShowThreads::ReadFiles()
iq.sel_guest_name = true;
iq.sel_privileges = true;
iq.sel_date = true;
iq.WhereParentId(request->dir_tab.back()->id);
iq.WhereParentId(cur->request->dir_tab.back()->id);
iq.WhereType(Item::file);
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
@@ -123,7 +123,7 @@ void ShowThreads::SortPointers()
{
int sort_type = 1;
if( request->ParamValue(L"sort") == L"url" )
if( cur->request->ParamValue(L"sort") == L"url" )
sort_type = 0;
std::vector<Item*> & table = thread_info->item_sort_tab;

View File

@@ -16,16 +16,16 @@
namespace Thread
{
bool thread_sort_tab(size_t sort_index);
bool thread_sort_tab(size_t sort_index);
void AddEzcFunctions(PluginInfo & info);
} // namespace
#endif
} // namespace
#endif