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

@@ -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;
}
}