added: mount points
(reading /etc/fstab from db not working yet) core/mount.h core/mountparser.h core/mountparser.cpp core/mounts.h core/mounts.cpp content/thread.cpp content/createthread.cpp templates/thread.cpp git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@495 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
bool Content::Init()
|
||||
{
|
||||
templates.Read();
|
||||
@@ -39,18 +38,31 @@ return true;
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::SetDefaultFunction()
|
||||
void Content::SetDefaultFunctionForFile()
|
||||
{
|
||||
if( request.is_item )
|
||||
if( request.HasReadExecAccess(request.item) )
|
||||
request.pfunction = data.functions.GetFunction(FUN_RUN);
|
||||
else
|
||||
request.pfunction = data.functions.GetFunction(FUN_CAT);
|
||||
|
||||
if( request.pfunction )
|
||||
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::SetDefaultFunctionForDir()
|
||||
{
|
||||
Mount mount = data.mounts.GetCurrentMountPoint();
|
||||
|
||||
if( mount.type == Mount::thread )
|
||||
{
|
||||
if( request.HasReadExecAccess(request.item) )
|
||||
request.pfunction = data.functions.GetFunction(FUN_RUN);
|
||||
else
|
||||
request.pfunction = data.functions.GetFunction(FUN_CAT);
|
||||
|
||||
request.pfunction = data.functions.GetFunction(FUN_THREAD);
|
||||
|
||||
if( request.pfunction )
|
||||
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -69,7 +81,20 @@ void Content::SetDefaultFunction()
|
||||
|
||||
log << log3 << "Content: Default item: id: " << default_item << logend;
|
||||
RedirectTo(default_item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Content::SetDefaultFunction()
|
||||
{
|
||||
if( request.is_item )
|
||||
{
|
||||
SetDefaultFunctionForFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDefaultFunctionForDir();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +152,15 @@ void Content::MakeStandardFunction()
|
||||
else
|
||||
if( request.pfunction->code == FUN_LAST )
|
||||
FunLast();
|
||||
else
|
||||
if( request.pfunction->code == FUN_THREAD )
|
||||
FunThread();
|
||||
else
|
||||
if( request.pfunction->code == FUN_CREATETHREAD )
|
||||
FunCreateThread();
|
||||
else
|
||||
request.status = Error::permision_denied;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -165,8 +199,13 @@ void Content::MakePost()
|
||||
PostFunLogin();
|
||||
break;
|
||||
|
||||
case FUN_CREATETHREAD:
|
||||
PostFunCreateThread();
|
||||
break;
|
||||
|
||||
default:
|
||||
log << log1 << "Content: unknown post function" << logend;
|
||||
// !! moze daj tutaj tez access denied?
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user