changed: the way of building the cmslu
main Makefile is in an application directory
in cmslu/ there are only libraries:
core.a content.a confparser.a templates.a
added: macros APPTEMPLATES APPFUNCTIONS
defined in the application's Makefile
added: PatternCacher
added: cmslu function 'run'
files which have exec permissions
can be run (run is a default function)
after read from the database the content is parsed
into Ezc::Pattern object, this object is then cached
in PatternCacher
added: FunctionCodeParser - will be used to parse the code
from standard functions (ls/cat/...)
git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@475 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
o = content.o privileges.o emacs.o login.o rm.o cat.o logout.o ls.o node.o mkdir.o defaultitem.o
|
||||
o = content.o priv.o emacs.o login.o rm.o cat.o logout.o ls.o node.o mkdir.o default.o run.o
|
||||
|
||||
|
||||
all: content.a
|
||||
|
||||
+112
-85
@@ -4,130 +4,157 @@ cat.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
cat.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
cat.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
cat.o: ../core/group.h ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
cat.o: ../core/functions.h ../core/function.h ../core/request.h
|
||||
cat.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
cat.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
cat.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
cat.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
cat.o: ../core/log.h ../core/misc.h ../core/function.h
|
||||
cat.o: ../core/functionparser.h ../core/request.h ../core/data.h
|
||||
cat.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
cat.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
cat.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
cat.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
cat.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
cat.o: ../core/users.h ../core/groups.h ../core/log.h
|
||||
cat.o: ../templates/patterncacher.h ../app/templates.h ../core/misc.h
|
||||
cat.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
cat.o: ../core/data.h ../app/content.h
|
||||
content.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
content.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
content.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
content.o: ../core/user.h ../core/group.h ../core/ugcontainer.h
|
||||
content.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||
content.o: ../core/function.h ../core/request.h ../core/requesttypes.h
|
||||
content.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
content.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
content.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
content.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
content.o: ../core/log.h ../core/misc.h ../core/function.h
|
||||
content.o: ../core/functionparser.h ../core/request.h ../core/data.h
|
||||
defaultitem.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
defaultitem.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
defaultitem.o: ../core/error.h ../core/dirs.h ../core/db.h
|
||||
defaultitem.o: ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
defaultitem.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
defaultitem.o: ../core/functions.h ../core/function.h ../core/request.h
|
||||
defaultitem.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
defaultitem.o: ../core/getparser.h ../core/httpsimpleparser.h
|
||||
defaultitem.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
defaultitem.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
defaultitem.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
defaultitem.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
defaultitem.o: ../core/data.h
|
||||
content.o: ../core/function.h ../core/functioncodeparser.h ../core/request.h
|
||||
content.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
content.o: ../core/getparser.h ../core/httpsimpleparser.h
|
||||
content.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
content.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
content.o: ../core/users.h ../core/groups.h ../core/log.h
|
||||
content.o: ../templates/patterncacher.h ../app/templates.h ../core/misc.h
|
||||
content.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
content.o: ../core/data.h ../app/content.h
|
||||
default.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
default.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
default.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
default.o: ../core/user.h ../core/group.h ../core/ugcontainer.h
|
||||
default.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||
default.o: ../core/function.h ../core/functioncodeparser.h ../core/request.h
|
||||
default.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
default.o: ../core/getparser.h ../core/httpsimpleparser.h
|
||||
default.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
default.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
default.o: ../core/users.h ../core/groups.h ../core/log.h
|
||||
default.o: ../templates/patterncacher.h ../app/templates.h ../core/misc.h
|
||||
default.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
default.o: ../core/data.h ../app/content.h
|
||||
emacs.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
emacs.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
emacs.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
emacs.o: ../core/user.h ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
emacs.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
emacs.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
emacs.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
emacs.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
emacs.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
emacs.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
emacs.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
emacs.o: ../core/data.h
|
||||
emacs.o: ../core/functioncodeparser.h ../core/request.h
|
||||
emacs.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
emacs.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
emacs.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
emacs.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
emacs.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
emacs.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
emacs.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
login.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
login.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
login.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
login.o: ../core/user.h ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
login.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
login.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
login.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
login.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
login.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
login.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
login.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
login.o: ../core/data.h
|
||||
login.o: ../core/functioncodeparser.h ../core/request.h
|
||||
login.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
login.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
login.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
login.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
login.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
login.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
login.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
logout.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
logout.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
logout.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
logout.o: ../core/user.h ../core/group.h ../core/ugcontainer.h
|
||||
logout.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||
logout.o: ../core/function.h ../core/request.h ../core/requesttypes.h
|
||||
logout.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
logout.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
logout.o: ../core/function.h ../core/functioncodeparser.h ../core/request.h
|
||||
logout.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
logout.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
logout.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
logout.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
logout.o: ../core/log.h ../core/misc.h ../core/function.h
|
||||
logout.o: ../core/functionparser.h ../core/request.h ../core/data.h
|
||||
logout.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
logout.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
logout.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
ls.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
ls.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
ls.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
ls.o: ../core/group.h ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
ls.o: ../core/functions.h ../core/function.h ../core/request.h
|
||||
ls.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
ls.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
ls.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
ls.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
ls.o: ../core/log.h ../core/misc.h ../core/function.h
|
||||
ls.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
ls.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
ls.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
ls.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h ../core/db.h
|
||||
ls.o: ../core/error.h ../core/user.h ../core/group.h ../core/users.h
|
||||
ls.o: ../core/groups.h ../core/log.h ../templates/patterncacher.h
|
||||
ls.o: ../app/templates.h ../core/misc.h ../core/function.h
|
||||
ls.o: ../core/functionparser.h ../core/request.h ../core/data.h
|
||||
ls.o: ../app/content.h
|
||||
mkdir.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
mkdir.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
mkdir.o: ../core/error.h ../core/dirs.h ../core/db.h ../core/dircontainer.h
|
||||
mkdir.o: ../core/user.h ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
mkdir.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
mkdir.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
mkdir.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
mkdir.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
mkdir.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
mkdir.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
mkdir.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
mkdir.o: ../core/data.h
|
||||
mkdir.o: ../core/functioncodeparser.h ../core/request.h
|
||||
mkdir.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
mkdir.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
mkdir.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
mkdir.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
mkdir.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
mkdir.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
mkdir.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
node.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
node.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
node.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
node.o: ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
node.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
node.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
node.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
node.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
node.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
node.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
node.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
node.o: ../core/data.h
|
||||
privileges.o: content.h ../templates/templates.h ../../ezc/src/ezc.h
|
||||
privileges.o: ../core/data.h ../core/misc.h ../core/log.h ../core/item.h
|
||||
privileges.o: ../core/error.h ../core/dirs.h ../core/db.h
|
||||
privileges.o: ../core/dircontainer.h ../core/user.h ../core/group.h
|
||||
privileges.o: ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
privileges.o: ../core/functions.h ../core/function.h ../core/request.h
|
||||
privileges.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
privileges.o: ../core/getparser.h ../core/httpsimpleparser.h
|
||||
privileges.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
privileges.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
privileges.o: ../core/users.h ../core/groups.h ../core/log.h ../core/misc.h
|
||||
privileges.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
privileges.o: ../core/data.h
|
||||
node.o: ../core/functioncodeparser.h ../core/request.h ../core/requesttypes.h
|
||||
node.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
node.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
node.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
node.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
node.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
node.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
node.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
priv.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
priv.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
priv.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
priv.o: ../core/group.h ../core/ugcontainer.h ../core/users.h
|
||||
priv.o: ../core/groups.h ../core/functions.h ../core/function.h
|
||||
priv.o: ../core/functioncodeparser.h ../core/request.h ../core/requesttypes.h
|
||||
priv.o: ../core/session.h ../core/done.h ../core/getparser.h
|
||||
priv.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
priv.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
priv.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
priv.o: ../core/log.h ../templates/patterncacher.h ../app/templates.h
|
||||
priv.o: ../core/misc.h ../core/function.h ../core/functionparser.h
|
||||
priv.o: ../core/request.h ../core/data.h ../app/content.h
|
||||
rm.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
rm.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
rm.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
rm.o: ../core/group.h ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
rm.o: ../core/functions.h ../core/function.h ../core/request.h
|
||||
rm.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
rm.o: ../core/getparser.h ../core/httpsimpleparser.h ../core/postparser.h
|
||||
rm.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
|
||||
rm.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
|
||||
rm.o: ../core/log.h ../core/misc.h ../core/function.h
|
||||
rm.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
rm.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
rm.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
rm.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h ../core/db.h
|
||||
rm.o: ../core/error.h ../core/user.h ../core/group.h ../core/users.h
|
||||
rm.o: ../core/groups.h ../core/log.h ../templates/patterncacher.h
|
||||
rm.o: ../app/templates.h ../core/misc.h ../core/function.h
|
||||
rm.o: ../core/functionparser.h ../core/request.h ../core/data.h
|
||||
rm.o: ../app/content.h
|
||||
run.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
|
||||
run.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
|
||||
run.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
|
||||
run.o: ../core/group.h ../core/ugcontainer.h ../core/users.h ../core/groups.h
|
||||
run.o: ../core/functions.h ../core/function.h ../core/functioncodeparser.h
|
||||
run.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
run.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
run.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
|
||||
run.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
|
||||
run.o: ../core/users.h ../core/groups.h ../core/log.h
|
||||
run.o: ../templates/patterncacher.h ../app/templates.h ../core/misc.h
|
||||
run.o: ../core/function.h ../core/functionparser.h ../core/request.h
|
||||
run.o: ../core/data.h ../app/content.h ../core/functioncodeparser.h
|
||||
|
||||
+27
-21
@@ -44,8 +44,11 @@ void Content::SetDefaultFunction()
|
||||
{
|
||||
if( request.is_item )
|
||||
{
|
||||
request.pfunction = data.functions.GetFunction(Function::cat);
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -55,7 +58,7 @@ void Content::SetDefaultFunction()
|
||||
|
||||
if( default_item == -1 )
|
||||
{
|
||||
request.pfunction = data.functions.GetFunction(Function::ls);
|
||||
request.pfunction = data.functions.GetFunction(FUN_LS);
|
||||
|
||||
if( request.pfunction )
|
||||
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||
@@ -87,31 +90,34 @@ void Content::MakeStandardFunction()
|
||||
}
|
||||
|
||||
|
||||
if( request.pfunction->code == Function::logout )
|
||||
if( request.pfunction->code == FUN_LOGOUT )
|
||||
FunLogout();
|
||||
else
|
||||
if( request.pfunction->code == Function::cat )
|
||||
if( request.pfunction->code == FUN_CAT )
|
||||
FunCat();
|
||||
else
|
||||
if( request.pfunction->code == Function::ls )
|
||||
if( request.pfunction->code == FUN_LS )
|
||||
FunLs();
|
||||
else
|
||||
if( request.pfunction->code == Function::emacs )
|
||||
if( request.pfunction->code == FUN_EMACS )
|
||||
FunEmacs();
|
||||
else
|
||||
if( request.pfunction->code == Function::mkdir )
|
||||
if( request.pfunction->code == FUN_MKDIR )
|
||||
FunMkdir();
|
||||
else
|
||||
if( request.pfunction->code == Function::default_item )
|
||||
FunDefaultItem();
|
||||
if( request.pfunction->code == FUN_DEFAULT )
|
||||
FunDefault();
|
||||
else
|
||||
if( request.pfunction->code == Function::privileges )
|
||||
FunPrivileges();
|
||||
if( request.pfunction->code == FUN_PRIV )
|
||||
FunPriv();
|
||||
else
|
||||
if( request.pfunction->code == Function::rm )
|
||||
if( request.pfunction->code == FUN_RM )
|
||||
FunRm();
|
||||
else
|
||||
if( request.pfunction->code == Function::node )
|
||||
if( request.pfunction->code == FUN_RUN )
|
||||
FunRun();
|
||||
else
|
||||
if( request.pfunction->code == FUN_NODE )
|
||||
FunNode();
|
||||
|
||||
}
|
||||
@@ -131,23 +137,23 @@ void Content::MakePost()
|
||||
|
||||
switch( request.pfunction->code )
|
||||
{
|
||||
case Function::emacs:
|
||||
case FUN_EMACS:
|
||||
PostFunEmacs();
|
||||
break;
|
||||
|
||||
case Function::mkdir:
|
||||
case FUN_MKDIR:
|
||||
PostFunMkdir();
|
||||
break;
|
||||
|
||||
case Function::default_item:
|
||||
PostFunDefaultItem();
|
||||
case FUN_DEFAULT:
|
||||
PostFunDefault();
|
||||
break;
|
||||
|
||||
case Function::privileges:
|
||||
PostFunPrivileges();
|
||||
case FUN_PRIV:
|
||||
PostFunPriv();
|
||||
break;
|
||||
|
||||
case Function::login:
|
||||
case FUN_LOGIN:
|
||||
PostFunLogin();
|
||||
break;
|
||||
|
||||
|
||||
+5
-4
@@ -47,11 +47,12 @@ class Content
|
||||
void FunLogout();
|
||||
void FunLs();
|
||||
void FunEmacs();
|
||||
void FunPrivileges();
|
||||
void FunPriv();
|
||||
void FunRm();
|
||||
void FunNode();
|
||||
void FunMkdir();
|
||||
void FunDefaultItem();
|
||||
void FunDefault();
|
||||
void FunRun();
|
||||
|
||||
|
||||
void PostFunLogin();
|
||||
@@ -59,8 +60,8 @@ class Content
|
||||
void PostFunEmacsEdit(bool with_url);
|
||||
void PostFunEmacs();
|
||||
void PostFunMkdir();
|
||||
void PostFunDefaultItem();
|
||||
void PostFunPrivileges();
|
||||
void PostFunDefault();
|
||||
void PostFunPriv();
|
||||
|
||||
void RedirectTo(const Item & item);
|
||||
void RedirectTo(long item_id);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
|
||||
void Content::PostFunDefaultItem()
|
||||
void Content::PostFunDefault()
|
||||
{
|
||||
Item * pdir;
|
||||
long fileid = -1;
|
||||
@@ -68,7 +68,7 @@ long fileid = -1;
|
||||
|
||||
|
||||
|
||||
void Content::FunDefaultItem()
|
||||
void Content::FunDefault()
|
||||
{
|
||||
if( !request.HasWriteAccess(*request.dir_table.back()) )
|
||||
{
|
||||
@@ -58,6 +58,9 @@ void Content::PostFunEmacsEdit(bool with_url)
|
||||
throw Error(Error::permision_denied);
|
||||
|
||||
request.session->done_status = db.EditItemById(request.item, with_url);
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
TemplatesFunctions::pattern_cacher.UpdatePattern(request.item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+8
-9
@@ -31,20 +31,19 @@ void Content::PostFunLogin()
|
||||
}
|
||||
|
||||
log << log2 << "User " << login << " (id: " << user_id << ") logged" << logend;
|
||||
|
||||
if( request.is_item )
|
||||
{
|
||||
RedirectTo(request.item);
|
||||
}
|
||||
else
|
||||
{
|
||||
RedirectTo(*request.dir_table.back());
|
||||
}
|
||||
}
|
||||
|
||||
// !! zglosic komunikat o nie poprawnym logowaniu
|
||||
}
|
||||
catch(const Error &)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
if( request.is_item )
|
||||
RedirectTo(request.item);
|
||||
else
|
||||
RedirectTo(*request.dir_table.back());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
|
||||
void Content::PostFunPrivileges()
|
||||
void Content::PostFunPriv()
|
||||
{
|
||||
// !! narazie tylko dla plikow
|
||||
if( !request.is_item )
|
||||
@@ -63,7 +63,7 @@ void Content::PostFunPrivileges()
|
||||
|
||||
|
||||
|
||||
void Content::FunPrivileges()
|
||||
void Content::FunPriv()
|
||||
{
|
||||
if( !request.is_item )
|
||||
{
|
||||
@@ -41,6 +41,7 @@ void Content::FunRm()
|
||||
{
|
||||
request.session->done_status = Error::ok;
|
||||
log << log2 << "Content: deleted item: subject: " << request.item.subject << ", id: " << request.item.id << logend;
|
||||
TemplatesFunctions::pattern_cacher.DeletePattern(request.item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Executable
+44
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is a part of CMSLU -- Content Management System like Unix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "content.h"
|
||||
#include "../app/content.h"
|
||||
#include "../core/functioncodeparser.h"
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::FunRun()
|
||||
{
|
||||
if( !request.is_item )
|
||||
{
|
||||
log << log1 << "Content: Run function requires an item" << logend;
|
||||
request.status = Error::item_required;
|
||||
return;
|
||||
}
|
||||
|
||||
if( !request.HasReadExecAccess(request.item) )
|
||||
{
|
||||
request.status = Error::permision_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
FunctionCodeParser fc;
|
||||
|
||||
int c = fc.Parse(request.item);
|
||||
|
||||
#ifdef APPFUNCTIONS
|
||||
if( c != FUN_NONE )
|
||||
AppContent::AppFunction(c);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user