some improvement in templates
(now we have O(1) time for selecting the right html template) added: winix function: template for selecting a template for an item (file or dir) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@636 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -37,16 +37,37 @@ void Functions::SetSystem(System * psystem)
|
||||
system = psystem;
|
||||
}
|
||||
|
||||
|
||||
void Functions::SetTemplates(Templates * ptemplates)
|
||||
{
|
||||
templates = ptemplates;
|
||||
}
|
||||
|
||||
|
||||
void Functions::SetNotify(Notify * pnotify)
|
||||
{
|
||||
notify = pnotify;
|
||||
}
|
||||
|
||||
|
||||
size_t Functions::FunctionsSize()
|
||||
{
|
||||
return table.size();
|
||||
}
|
||||
|
||||
|
||||
Functions::Iterator Functions::Begin()
|
||||
{
|
||||
return table.begin();
|
||||
}
|
||||
|
||||
|
||||
Functions::Iterator Functions::End()
|
||||
{
|
||||
return table.end();
|
||||
}
|
||||
|
||||
|
||||
FunctionBase * Functions::Find(const std::string & function_name)
|
||||
{
|
||||
Table::iterator i = table.find(function_name);
|
||||
@@ -129,8 +150,9 @@ void Functions::Add(FunctionBase * fun)
|
||||
return;
|
||||
}
|
||||
|
||||
table[fun->fun.url] = fun;
|
||||
fun->id = table.size();
|
||||
SetObjects(fun);
|
||||
table[fun->fun.url] = fun;
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +167,8 @@ void Functions::Add(FunctionBase & fun)
|
||||
|
||||
void Functions::Create()
|
||||
{
|
||||
Add(fun_template);
|
||||
|
||||
Add(fun_adduser);
|
||||
Add(fun_cat);
|
||||
Add(fun_chmod);
|
||||
@@ -281,7 +305,7 @@ void Functions::MakeGet()
|
||||
return;
|
||||
}
|
||||
|
||||
if( !request->function->HasAccess() )
|
||||
if( !system->HasReadExecAccess(request->function->fun) || !request->function->HasAccess() )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
@@ -310,7 +334,7 @@ void Functions::MakePost()
|
||||
return;
|
||||
}
|
||||
|
||||
if( !request->function->HasAccess() )
|
||||
if( !system->HasReadExecAccess(request->function->fun) || !request->function->HasAccess() )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
|
Reference in New Issue
Block a user