From 3d001e7458c30bb497620a3b4c39c71bf4e098a0 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 21 May 2009 19:27:16 +0000 Subject: [PATCH] added: macro APPPREPARE void AppFunction(int code); git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@503 e52654a7-88a9-db11-a3e9-0013d4bc506e --- app/content.h | 4 +++- content/Makefile.dep | 2 +- content/content.cpp | 9 ++++++++- core/request.h | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/content.h b/app/content.h index fd04051..65f72af 100755 --- a/app/content.h +++ b/app/content.h @@ -16,9 +16,11 @@ namespace AppContent { + #ifdef APPPREPARE - void AppFunction(int code); + void PrepareApp(); + #endif diff --git a/content/Makefile.dep b/content/Makefile.dep index 7cc6c5a..71883f6 100755 --- a/content/Makefile.dep +++ b/content/Makefile.dep @@ -14,7 +14,7 @@ content.o: ../core/error.h ../core/db.h ../core/group.h content.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h content.o: ../core/dirs.h ../core/users.h ../core/groups.h content.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h -content.o: ../core/mount.h +content.o: ../core/mount.h ../app/content.h createthread.o: content.h ../core/item.h ../templates/templates.h createthread.o: ../../ezc/src/ezc.h ../templates/patterncacher.h createthread.o: ../app/templates.h ../core/request.h ../core/requesttypes.h diff --git a/content/content.cpp b/content/content.cpp index 3300cd1..71af038 100755 --- a/content/content.cpp +++ b/content/content.cpp @@ -12,7 +12,7 @@ #include "../core/error.h" #include "../core/db.h" #include "../core/data.h" - +#include "../app/content.h" @@ -174,6 +174,9 @@ void Content::MakeStandardFunction() void Content::MakePost() { + if( !request.pfunction ) + SetDefaultFunction(); + if( !request.pfunction ) { log << log1 << "Content: MakePost: no function" << logend; @@ -230,6 +233,10 @@ void Content::Make() { if( DirsHaveReadExecPerm() ) { + #ifdef APPPREPARE + AppContent::PrepareApp(); + #endif + if( request.method == Request::post ) MakePost(); diff --git a/core/request.h b/core/request.h index 94bd92a..10eba0b 100755 --- a/core/request.h +++ b/core/request.h @@ -131,7 +131,7 @@ struct Request void SetCookie(const char * name, long value); bool IsPostVar(const char * var); - std::string & PostVar(const char * var); // with a throw + std::string & PostVar(const char * var); // with a throw !!! wywalic te wyjatki ztad, niech zwraca pusty string jak nie znajdzie nic, albo referencje na jakis statyczny pusty string //bool PostVar(const char * var, std::string & result); // item_table[0] -> item