added: date_creation and date_modification to items

changed: function 'run' is using a template: fun_run.html
         there is: [item_run] called from this template


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@489 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-03-22 23:54:15 +00:00
parent 951d0e8653
commit bbaefd0f77
20 changed files with 274 additions and 107 deletions

View File

@@ -1,4 +1,4 @@
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
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 last.o
all: content.a

View File

@@ -10,9 +10,8 @@ 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
cat.o: ../templates/patterncacher.h ../core/misc.h ../core/function.h
cat.o: ../core/functionparser.h ../core/request.h ../core/data.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
@@ -24,9 +23,8 @@ 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
content.o: ../templates/patterncacher.h ../core/misc.h ../core/function.h
content.o: ../core/functionparser.h ../core/request.h ../core/data.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
@@ -38,9 +36,8 @@ 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
default.o: ../templates/patterncacher.h ../core/misc.h ../core/function.h
default.o: ../core/functionparser.h ../core/request.h ../core/data.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
@@ -51,9 +48,22 @@ 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
emacs.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
emacs.o: ../core/function.h ../core/functionparser.h ../core/request.h
emacs.o: ../core/data.h
last.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
last.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
last.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
last.o: ../core/group.h ../core/ugcontainer.h ../core/users.h
last.o: ../core/groups.h ../core/functions.h ../core/function.h
last.o: ../core/functioncodeparser.h ../core/request.h ../core/requesttypes.h
last.o: ../core/session.h ../core/done.h ../core/getparser.h
last.o: ../core/httpsimpleparser.h ../core/postparser.h
last.o: ../core/cookieparser.h ../core/item.h ../core/db.h ../core/error.h
last.o: ../core/user.h ../core/group.h ../core/users.h ../core/groups.h
last.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
last.o: ../core/function.h ../core/functionparser.h ../core/request.h
last.o: ../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
@@ -64,9 +74,9 @@ 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
login.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
login.o: ../core/function.h ../core/functionparser.h ../core/request.h
login.o: ../core/data.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
@@ -77,9 +87,9 @@ 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 ../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
logout.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
logout.o: ../core/function.h ../core/functionparser.h ../core/request.h
logout.o: ../core/data.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
@@ -90,9 +100,8 @@ 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
ls.o: ../core/misc.h ../core/function.h ../core/functionparser.h
ls.o: ../core/request.h ../core/data.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
@@ -103,9 +112,9 @@ 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
mkdir.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
mkdir.o: ../core/function.h ../core/functionparser.h ../core/request.h
mkdir.o: ../core/data.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
@@ -116,9 +125,9 @@ 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
node.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
node.o: ../core/function.h ../core/functionparser.h ../core/request.h
node.o: ../core/data.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
@@ -129,9 +138,9 @@ 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
priv.o: ../core/log.h ../templates/patterncacher.h ../core/misc.h
priv.o: ../core/function.h ../core/functionparser.h ../core/request.h
priv.o: ../core/data.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
@@ -142,9 +151,8 @@ 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
rm.o: ../core/misc.h ../core/function.h ../core/functionparser.h
rm.o: ../core/request.h ../core/data.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
@@ -155,9 +163,9 @@ 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
run.o: ../templates/patterncacher.h ../core/misc.h ../core/function.h
run.o: ../core/functionparser.h ../core/request.h ../core/data.h
run.o: ../app/content.h
who.o: content.h ../templates/templates.h ../../ezc/src/ezc.h ../core/data.h
who.o: ../core/misc.h ../core/log.h ../core/item.h ../core/error.h
who.o: ../core/dirs.h ../core/db.h ../core/dircontainer.h ../core/user.h
@@ -168,6 +176,6 @@ who.o: ../core/done.h ../core/getparser.h ../core/httpsimpleparser.h
who.o: ../core/postparser.h ../core/cookieparser.h ../core/item.h
who.o: ../core/db.h ../core/error.h ../core/user.h ../core/group.h
who.o: ../core/users.h ../core/groups.h ../core/log.h
who.o: ../templates/patterncacher.h ../app/templates.h ../core/misc.h
who.o: ../core/function.h ../core/functionparser.h ../core/request.h
who.o: ../core/data.h ../app/content.h
who.o: ../templates/patterncacher.h ../core/misc.h ../core/function.h
who.o: ../core/functionparser.h ../core/request.h ../core/data.h
who.o: ../app/content.h

View File

@@ -12,6 +12,7 @@
#include <cstdlib>
#include <fcgiapp.h>
#include <ctime>
#include "../templates/templates.h"
#include "../core/request.h"
@@ -58,6 +59,7 @@ class Content
void FunDefault();
void FunRun();
void FunWho();
void FunLast();
void PostFunLogin();

View File

@@ -42,6 +42,8 @@ void Content::PostFunEmacsAdd()
request.item.parent_id = request.dir_table.back()->id;
request.item.type = Item::file;
// dates (creation and modification) is set by request.item.Clear() at the beginning
if( !request.HasWriteAccess(*request.dir_table.back() ) )
throw Error(Error::permision_denied);
@@ -56,7 +58,10 @@ void Content::PostFunEmacsEdit(bool with_url)
if( !request.HasWriteAccess(request.item) )
throw Error(Error::permision_denied);
time_t t = std::time(0);
request.item.date_modification = *std::localtime( &t );
request.session->done_status = db.EditItemById(request.item, with_url);
if( request.session->done_status == Error::ok )

30
content/last.cpp Executable file
View File

@@ -0,0 +1,30 @@
/*
* 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"
void Content::FunLast()
{
}

View File

@@ -32,6 +32,8 @@ void Content::PostFunMkdir()
item.privileges = 0755; // !! tymczasowo, bedzie uzyte umask
item.default_item = -1; // !! tymczasowo, bedzie formularz z wprowadzeniem
// dates (creation and modification) is set by the Item() constructor
PrepareUrl(item);
request.session->done_status = db.AddItem(item);