added: created directory 'content' which has Content:: files

added:   created directory 'templates' which has Templates:: and TemplatesFunctions:: files
changed: content.cpp split into many files (directory 'content')
changed: templates.cpp split into many files (directory 'templates')
added:   full permissions
changed: building of the program (GNU make is used now)
         Makefile and Makefile.dep added into directories
added:   a parser 'FunctionParser'
         is used to parse the GET string
         it recognizes directories, items, functions, functions parameters
added:   other classes: Function, Functions 
added:   function: ls, privileges
changed: function 'id' to 'node'
changed: version: to 0.2.0
added/changed: a lot of work have been done


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@469 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2008-12-30 01:05:03 +00:00
parent fac60a197b
commit 3e328932fc
62 changed files with 3457 additions and 1617 deletions

View File

@@ -13,6 +13,8 @@
#include <fcgiapp.h>
#include <sstream>
#include <vector>
#include <ctime>
#include <iomanip>
#include "requesttypes.h"
#include "log.h"
#include "session.h"
@@ -22,10 +24,18 @@
#include "cookieparser.h"
#include "item.h"
#include "error.h"
#include "function.h"
struct Request
{
// request id
// is incremented for each request and is never 0
// (from -1 will be incremented twice)
// it's used for some optimalization e.g. in templates
size_t id;
FCGX_Stream * in, * out, * err;
FCGX_ParamArray env; // defined as 'char **'
@@ -48,6 +58,7 @@ struct Request
const char * env_http_cookie;
const char * env_remote_addr;
const char * env_http_host;
const char * env_http_user_agent;
// current session
// is set after calling session_manager.SetSession()
@@ -55,29 +66,51 @@ struct Request
// 'done_status' is set if 'done' is different than 'nothing'
Error done_status;
Error done_status; // !! wywalic - jest przeciez w session
// what to do
enum Result { err_internal, err404, err_per_denied, show_dir, show_item, show_item_by_id, add_item, edit_item, del_item, del_item_confirm, confirm, redirect, logout } result; // zamienic na to_do
// current directory e.g. /foo/bar
std::vector<Item> cur_dir_table;
// !! nowe skladowe
// current directory
// !! zapewnic aby byl minimum jeden katalog (root)
// !! moze nazwac to poprostu dir?
std::vector<Item*> dir_table;
bool is_item;
// this item is used for many purposes such as editing, adding an item etc.
Item item;
// null if there is no a function
Function * pfunction;
// !! moze nazwac to poprostu param?
std::vector<std::string*> param_table;
Error status;
// ------------------
// !! stare skladowe
// current directory e.g. /foo/bar
//std::vector<Item> cur_dir_table;
// id of the last directory (bar) or -1
long dir;
//long dir;
// ------------------
// items in the current directory
// maybe without contents?
std::vector<Item> item_table;
// directories in the current directory
std::vector<Item> dir_table;
//std::vector<Item> dir_table2;
// this item is used for many purposes such as editing, adding an item etc.
Item item;
// this string is used for many purposes such as redirecting
std::string str;
@@ -91,14 +124,17 @@ struct Request
void Clear();
bool IsParam(const char * s);
void SetCookie(const char * name, const char * value);
void SetCookie(const char * name, long value);
bool IsPostVar(const char * var);
std::string & PostVar(const char * var); // with a throw
//bool PostVar(const char * var, std::string & result);
// item_table[0] -> item
// !! to tez nie bedzie potrzebne
void CopyFirstItem();
@@ -126,6 +162,9 @@ private:
const char char_empty;
const char * SetEnvVar(const char * var);
void StandardLog();
};