fixed: the core didn't test for special folder when system was running

(now mkdir addes correctly special folders)
added: function 'reload'
       param: 'templates' - reloading templates


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@519 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-11-16 17:43:23 +00:00
parent 9129f1b82a
commit c62d48160a
13 changed files with 123 additions and 29 deletions

View File

@@ -107,6 +107,13 @@ priv.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
priv.o: ../core/mounts.h ../core/mount.h
reload.o: content.h ../core/item.h ../templates/templates.h
reload.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
reload.o: ../core/requesttypes.h ../core/session.h ../core/done.h
reload.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
reload.o: ../core/function.h ../core/thread.h ../core/compress.h
reload.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
reload.o: ../core/error.h
rm.o: content.h ../core/item.h ../templates/templates.h
rm.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
rm.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h

View File

@@ -1 +1 @@
o = cat.o content.o createthread.o default.o emacs.o last.o login.o logout.o ls.o mkdir.o node.o priv.o rm.o run.o thread.o who.o
o = cat.o content.o createthread.o default.o emacs.o last.o login.o logout.o ls.o mkdir.o node.o priv.o reload.o rm.o run.o thread.o who.o

View File

@@ -19,8 +19,8 @@
bool Content::Init()
{
templates.Read();
templates.ReadTemplates();
templates.CreateFunctions();
return true;
}
@@ -160,6 +160,9 @@ void Content::MakeStandardFunction()
if( request.pfunction->code == FUN_THREAD )
FunThread();
else
if( request.pfunction->code == FUN_RELOAD )
FunReload();
else
if( request.pfunction->code == FUN_CREATETHREAD )
FunCreateThread();
else

View File

@@ -56,7 +56,10 @@ class Content
void FunRun();
void FunWho();
void FunLast();
void FunReloadTemplates();
void FunReload();
static bool FunThreadSort(const Thread & t1, const Thread & t2);
void FunThread();
void FunCreateThread();

45
content/reload.cpp Executable file
View File

@@ -0,0 +1,45 @@
/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#include "content.h"
#include "../core/request.h"
#include "../core/error.h"
void Content::FunReloadTemplates()
{
log << log1 << "Content: reloading html templates" << logend;
templates.ReadTemplates();
request.session->done = Done::reloaded_templates;
request.session->done_status = Error::ok;
request.session->done_timer = 1;
}
void Content::FunReload()
{
// !! temporarily only an admin has access
if( !request.session->puser || !request.session->puser->super_user )
{
log << log1 << "Content: Only an admin has access to reload function" << logend;
request.status = Error::permision_denied;
return;
}
if( request.IsParam("templates") )
FunReloadTemplates();
}