the first part of reimplementing has been done
now we have app object and singletons are only: log logn plugin and app git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
70
functions/funticket.cpp
Executable file
70
functions/funticket.cpp
Executable file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "funticket.h"
|
||||
|
||||
|
||||
namespace Fun
|
||||
{
|
||||
|
||||
FunTicket::FunTicket()
|
||||
{
|
||||
fun.url = "ticket";
|
||||
}
|
||||
|
||||
|
||||
void FunTicket::TicketDeleteFirst()
|
||||
{
|
||||
if( !request->is_ticket )
|
||||
return;
|
||||
|
||||
for(size_t i=0 ; i<request->item_table.size() ; ++i)
|
||||
{
|
||||
if( request->item_table[i].id == request->ticket.item_id )
|
||||
{
|
||||
// this is the first item with the content for the ticket
|
||||
|
||||
if( !system->HasReadAccess(request->item_table[i]) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
request->item_table.erase(request->item_table.begin() + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunTicket::MakeGet()
|
||||
{
|
||||
if( request->is_item || system->mounts.pmount->type != Mount::ticket )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
Db::ItemQuery iq;
|
||||
|
||||
iq.WhereParentId(request->dir_table.back()->id);
|
||||
iq.WhereType(Item::file);
|
||||
iq.WhereAuth(Item::auth_none);
|
||||
|
||||
db->GetItems(request->item_table, iq);
|
||||
db->GetTickets(request->dir_table.back()->id, request->ticket_tab);
|
||||
|
||||
TicketDeleteFirst();
|
||||
system->CheckAccessToItems(request->item_table);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
Reference in New Issue
Block a user