removed some thread and ticket information from request
they are in FunThread and FunTicket classes now added funtion FunUptime (I forgot about it) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -18,6 +18,22 @@ namespace Fun
|
||||
FunThread::FunThread()
|
||||
{
|
||||
fun.url = "thread";
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool FunThread::HasAccess()
|
||||
{
|
||||
return !request->is_item;
|
||||
}
|
||||
|
||||
|
||||
void FunThread::Clear()
|
||||
{
|
||||
is_thread = false;
|
||||
thread.Clear();
|
||||
thread_tab.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +41,12 @@ void FunThread::CreateSortIndexByDate()
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for(i = 0; i < request->thread_tab.size() ; ++i)
|
||||
for(i = 0; i < thread_tab.size() ; ++i)
|
||||
{
|
||||
Item * pdir = system->dirs.GetDir(request->thread_tab[i].dir_id);
|
||||
Item * pdir = system->dirs.GetDir(thread_tab[i].dir_id);
|
||||
|
||||
if( pdir )
|
||||
request->thread_tab[i].sort = (long)mktime(&pdir->date_creation);
|
||||
thread_tab[i].sort = (long)mktime(&pdir->date_creation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,29 +60,24 @@ bool FunThread::FunThreadSort(const Thread & t1, const Thread & t2)
|
||||
|
||||
void FunThread::MakeGet()
|
||||
{
|
||||
// !! dac do hasaccess()
|
||||
if( request->is_item )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
is_thread = (db->GetThreadByDirId(request->dir_tab.back()->id, thread) == WINIX_ERR_OK);
|
||||
|
||||
Db::ItemQuery iq;
|
||||
|
||||
if( system->mounts.pmount->IsArg(Mount::par_thread, "sort_desc") )
|
||||
iq.sort_asc = false;
|
||||
|
||||
iq.WhereParentId(request->dir_table.back()->id);
|
||||
iq.WhereParentId(request->dir_tab.back()->id);
|
||||
iq.WhereType(Item::file);
|
||||
iq.WhereAuth(Item::auth_none);
|
||||
|
||||
db->GetItems(request->item_table, iq);
|
||||
db->GetThreads(request->dir_table.back()->id, request->thread_tab);
|
||||
db->GetItems(request->item_tab, iq);
|
||||
db->GetThreads(request->dir_tab.back()->id, thread_tab);
|
||||
|
||||
system->CheckAccessToItems(request->item_table);
|
||||
system->CheckAccessToItems(request->item_tab);
|
||||
|
||||
CreateSortIndexByDate();
|
||||
std::sort(request->thread_tab.begin(), request->thread_tab.end(), FunThreadSort);
|
||||
std::sort(thread_tab.begin(), thread_tab.end(), FunThreadSort);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user