removed some thread and ticket information from request

they are in FunThread and FunTicket classes now
added funtion FunUptime (I forgot about it)



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@631 e52654a7-88a9-db11-a3e9-0013d4bc506e
pull/3/head
Tomasz Sowa 13 years ago
parent 76897b8a83
commit 9901c63ede

@ -22,19 +22,20 @@ app.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
app.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
app.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
app.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
app.o: ../core/thread.h ../functions/funticket.h ../functions/tinymce.h
app.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
app.o: ../templates/templates.h ../templates/patterncacher.h ../core/item.h
app.o: misc.h ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
app.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
app.o: ../functions/uptime.h ../functions/who.h ../templates/templates.h
app.o: ../templates/patterncacher.h ../core/item.h misc.h
app.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
app.o: plugin.h pluginmsg.h
bbcodeparser.o: bbcodeparser.h htmlfilter.h
compress.o: compress.h log.h
config.o: config.h confparser.h log.h plugin.h pluginmsg.h plugindata.h
config.o: request.h requesttypes.h session.h item.h error.h user.h rebus.h
config.o: thread.h compress.h acceptencodingparser.h acceptbaseparser.h
config.o: htmlfilter.h postmultiparser.h ticket.h system.h dirs.h
config.o: dircontainer.h db.h group.h ugcontainer.h mounts.h mount.h users.h
config.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
config.o: postmultiparser.h system.h dirs.h dircontainer.h db.h group.h
config.o: thread.h ugcontainer.h ticket.h mounts.h mount.h users.h
config.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
config.o: sessioncontainer.h ../functions/functions.h
config.o: ../functions/functionbase.h ../core/item.h ../core/db.h
@ -50,13 +51,14 @@ config.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
config.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
config.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
config.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
config.o: ../core/thread.h ../functions/funticket.h ../functions/tinymce.h
config.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
config.o: ../templates/templates.h ../templates/patterncacher.h
config.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
config.o: ../core/httpsimpleparser.h ../core/log.h
config.o: ../templates/indexpatterns.h ../templates/localefilter.h
config.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
config.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
config.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
config.o: ../functions/uptime.h ../functions/who.h ../templates/templates.h
config.o: ../templates/patterncacher.h ../core/item.h misc.h
config.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
config.o: ../core/log.h ../templates/indexpatterns.h
config.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
config.o: ../core/sessionmanager.h
confparser.o: confparser.h misc.h item.h
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
db.o: ugcontainer.h ticket.h misc.h
@ -92,16 +94,15 @@ notify.o: log.h notify.h ../templatesnotify/templatesnotify.h
notify.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h confparser.h
notify.o: ../core/config.h ../templates/misc.h ../templates/localefilter.h
notify.o: ../core/locale.h request.h requesttypes.h session.h item.h error.h
notify.o: user.h plugindata.h rebus.h thread.h compress.h
notify.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
notify.o: postmultiparser.h config.h ticket.h system.h dirs.h dircontainer.h
notify.o: db.h group.h ugcontainer.h mounts.h mount.h users.h lastcontainer.h
notify.o: groups.h loadavg.h misc.h
notify.o: user.h plugindata.h rebus.h compress.h acceptencodingparser.h
notify.o: acceptbaseparser.h htmlfilter.h postmultiparser.h config.h system.h
notify.o: dirs.h dircontainer.h db.h group.h thread.h ugcontainer.h ticket.h
notify.o: mounts.h mount.h users.h lastcontainer.h groups.h loadavg.h misc.h
plugin.o: plugin.h pluginmsg.h log.h plugindata.h config.h confparser.h
plugin.o: request.h requesttypes.h session.h item.h error.h user.h rebus.h
plugin.o: thread.h compress.h acceptencodingparser.h acceptbaseparser.h
plugin.o: htmlfilter.h postmultiparser.h ticket.h system.h dirs.h
plugin.o: dircontainer.h db.h group.h ugcontainer.h mounts.h mount.h users.h
plugin.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
plugin.o: postmultiparser.h system.h dirs.h dircontainer.h db.h group.h
plugin.o: thread.h ugcontainer.h ticket.h mounts.h mount.h users.h
plugin.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
plugin.o: sessioncontainer.h ../functions/functions.h
plugin.o: ../functions/functionbase.h ../core/item.h ../core/db.h
@ -117,20 +118,21 @@ plugin.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
plugin.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
plugin.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
plugin.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
plugin.o: ../core/thread.h ../functions/funticket.h ../functions/tinymce.h
plugin.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
plugin.o: ../templates/templates.h ../templates/patterncacher.h
plugin.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugin.o: ../core/httpsimpleparser.h ../core/log.h
plugin.o: ../templates/indexpatterns.h ../templates/localefilter.h
plugin.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
plugin.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
plugin.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
plugin.o: ../functions/uptime.h ../functions/who.h ../templates/templates.h
plugin.o: ../templates/patterncacher.h ../core/item.h misc.h
plugin.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
plugin.o: ../core/log.h ../templates/indexpatterns.h
plugin.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
plugin.o: ../core/sessionmanager.h
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h config.h confparser.h
plugindata.o: request.h requesttypes.h session.h item.h error.h user.h
plugindata.o: rebus.h thread.h compress.h acceptencodingparser.h
plugindata.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
plugindata.o: system.h dirs.h dircontainer.h db.h group.h ugcontainer.h
plugindata.o: mounts.h mount.h users.h lastcontainer.h groups.h loadavg.h
plugindata.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
plugindata.o: rebus.h compress.h acceptencodingparser.h acceptbaseparser.h
plugindata.o: htmlfilter.h postmultiparser.h system.h dirs.h dircontainer.h
plugindata.o: db.h group.h thread.h ugcontainer.h ticket.h mounts.h mount.h
plugindata.o: users.h lastcontainer.h groups.h loadavg.h sessionmanager.h
plugindata.o: sessioncontainer.h ../functions/functions.h
plugindata.o: ../functions/functionbase.h ../core/item.h ../core/db.h
plugindata.o: ../core/request.h ../core/config.h ../core/system.h
plugindata.o: ../core/notify.h ../../ezc/src/ezc.h
@ -146,8 +148,9 @@ plugindata.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
plugindata.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
plugindata.o: ../functions/rm.h ../functions/run.h ../functions/subject.h
plugindata.o: ../functions/funthread.h ../core/thread.h
plugindata.o: ../functions/funticket.h ../functions/tinymce.h
plugindata.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
plugindata.o: ../functions/funticket.h ../core/ticket.h
plugindata.o: ../functions/tinymce.h ../functions/uname.h
plugindata.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
plugindata.o: ../templates/templates.h ../templates/patterncacher.h
plugindata.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugindata.o: ../core/httpsimpleparser.h ../core/log.h
@ -156,16 +159,16 @@ plugindata.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h config.h
postmultiparser.o: confparser.h
rebus.o: log.h rebus.h misc.h item.h request.h requesttypes.h session.h
rebus.o: error.h user.h plugindata.h thread.h compress.h
rebus.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
rebus.o: postmultiparser.h config.h confparser.h ticket.h
rebus.o: error.h user.h plugindata.h compress.h acceptencodingparser.h
rebus.o: acceptbaseparser.h htmlfilter.h postmultiparser.h config.h
rebus.o: confparser.h
request.o: request.h requesttypes.h session.h item.h error.h log.h user.h
request.o: plugindata.h rebus.h thread.h compress.h acceptencodingparser.h
request.o: plugindata.h rebus.h compress.h acceptencodingparser.h
request.o: acceptbaseparser.h htmlfilter.h postmultiparser.h config.h
request.o: confparser.h ticket.h getparser.h httpsimpleparser.h postparser.h
request.o: confparser.h getparser.h httpsimpleparser.h postparser.h
request.o: cookieparser.h plugin.h pluginmsg.h system.h dirs.h dircontainer.h
request.o: db.h group.h ugcontainer.h mounts.h mount.h users.h
request.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
request.o: db.h group.h thread.h ugcontainer.h ticket.h mounts.h mount.h
request.o: users.h lastcontainer.h groups.h loadavg.h sessionmanager.h
request.o: sessioncontainer.h ../functions/functions.h
request.o: ../functions/functionbase.h ../core/item.h ../core/db.h
request.o: ../core/request.h ../core/config.h ../core/system.h
@ -180,23 +183,23 @@ request.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
request.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
request.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
request.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
request.o: ../core/thread.h ../functions/funticket.h ../functions/tinymce.h
request.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
request.o: ../templates/templates.h ../templates/patterncacher.h
request.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
request.o: ../core/httpsimpleparser.h ../core/log.h
request.o: ../templates/indexpatterns.h ../templates/localefilter.h
request.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
request.o: ../functions/functionbase.h
request.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
request.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
request.o: ../functions/uptime.h ../functions/who.h ../templates/templates.h
request.o: ../templates/patterncacher.h ../core/item.h misc.h
request.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
request.o: ../core/log.h ../templates/indexpatterns.h
request.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
request.o: ../core/sessionmanager.h ../functions/functionbase.h
session.o: session.h item.h error.h log.h user.h plugindata.h rebus.h
sessioncontainer.o: sessioncontainer.h session.h item.h error.h log.h user.h
sessioncontainer.o: plugindata.h rebus.h lastcontainer.h
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
sessionmanager.o: error.h log.h user.h plugindata.h rebus.h lastcontainer.h
sessionmanager.o: config.h confparser.h request.h requesttypes.h thread.h
sessionmanager.o: compress.h acceptencodingparser.h acceptbaseparser.h
sessionmanager.o: htmlfilter.h postmultiparser.h ticket.h system.h dirs.h
sessionmanager.o: dircontainer.h db.h group.h ugcontainer.h mounts.h mount.h
sessionmanager.o: config.h confparser.h request.h requesttypes.h compress.h
sessionmanager.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
sessionmanager.o: postmultiparser.h system.h dirs.h dircontainer.h db.h
sessionmanager.o: group.h thread.h ugcontainer.h ticket.h mounts.h mount.h
sessionmanager.o: users.h groups.h loadavg.h sessionparser.h plugin.h
sessionmanager.o: pluginmsg.h ../functions/functions.h
sessionmanager.o: ../functions/functionbase.h ../core/item.h ../core/db.h
@ -215,8 +218,9 @@ sessionmanager.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
sessionmanager.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
sessionmanager.o: ../functions/run.h ../functions/subject.h
sessionmanager.o: ../functions/funthread.h ../core/thread.h
sessionmanager.o: ../functions/funticket.h ../functions/tinymce.h
sessionmanager.o: ../functions/uname.h ../functions/upload.h
sessionmanager.o: ../functions/funticket.h ../core/ticket.h
sessionmanager.o: ../functions/tinymce.h ../functions/uname.h
sessionmanager.o: ../functions/upload.h ../functions/uptime.h
sessionmanager.o: ../functions/who.h ../templates/templates.h
sessionmanager.o: ../templates/patterncacher.h ../core/item.h misc.h
sessionmanager.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
@ -225,10 +229,10 @@ sessionmanager.o: ../templates/localefilter.h ../core/locale.h
sessionmanager.o: ../core/locale.h ../core/sessionmanager.h
sessionparser.o: sessionparser.h session.h item.h error.h log.h user.h
sessionparser.o: plugindata.h rebus.h sessioncontainer.h lastcontainer.h
sessionparser.o: users.h ugcontainer.h request.h requesttypes.h thread.h
sessionparser.o: compress.h acceptencodingparser.h acceptbaseparser.h
sessionparser.o: htmlfilter.h postmultiparser.h config.h confparser.h
sessionparser.o: ticket.h db.h group.h dircontainer.h
sessionparser.o: users.h ugcontainer.h request.h requesttypes.h compress.h
sessionparser.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
sessionparser.o: postmultiparser.h config.h confparser.h db.h group.h
sessionparser.o: thread.h dircontainer.h ticket.h
system.o: system.h dirs.h item.h dircontainer.h db.h user.h group.h thread.h
system.o: error.h log.h ugcontainer.h ticket.h request.h requesttypes.h
system.o: session.h plugindata.h rebus.h compress.h acceptencodingparser.h
@ -250,14 +254,14 @@ system.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
system.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
system.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
system.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
system.o: ../core/thread.h ../functions/funticket.h ../functions/tinymce.h
system.o: ../functions/uname.h ../functions/upload.h ../functions/who.h
system.o: ../templates/templates.h ../templates/patterncacher.h
system.o: ../core/item.h ../templates/ckeditorgetparser.h
system.o: ../core/httpsimpleparser.h ../core/log.h
system.o: ../templates/indexpatterns.h ../core/sessionmanager.h
system.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
system.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
system.o: ../functions/uptime.h ../functions/who.h ../templates/templates.h
system.o: ../templates/patterncacher.h ../core/item.h
system.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
system.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
users.o: users.h user.h ugcontainer.h log.h lastcontainer.h request.h
users.o: requesttypes.h session.h item.h error.h plugindata.h rebus.h
users.o: thread.h compress.h acceptencodingparser.h acceptbaseparser.h
users.o: htmlfilter.h postmultiparser.h config.h confparser.h ticket.h db.h
users.o: group.h dircontainer.h
users.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
users.o: postmultiparser.h config.h confparser.h db.h group.h thread.h
users.o: dircontainer.h ticket.h

@ -196,7 +196,7 @@ return true;
void App::ProcessRequest()
{
request.Clear();
request.Clear(); // !! dac na koniec
request.Read();
// when BaseUrlRedirect() return true we didn't have to set everything in request.Read()
@ -212,13 +212,15 @@ void App::ProcessRequest()
functions.Parse();
system.mounts.CalcCurMount();
ReadAdditionalInfo();
Make();
}
request.SendAll(); // !! czemu request sam sie chce wyslac? wrzucic to tutaj do app
notify.ItemChanged(request.notify_code);
if( request.function )
request.function->Clear();
}
@ -295,15 +297,15 @@ bool sent = false;
if( request.is_item && request.item.auth == Item::auth_none &&
request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK && request.pfunction )
request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK && request.function )
{
if( request.pfunction->fun.url == "cat" )
if( request.function->fun.url == "cat" )
{
request.page << request.item.content;
sent = true;
}
else
if( request.pfunction->fun.url == "run" )
if( request.function->fun.url == "run" )
{
templates.GenerateRunRaw();
sent = true;
@ -320,9 +322,9 @@ bool sent = false;
void App::Make()
{
if( request.dir_table.empty() )
if( request.dir_tab.empty() )
{
log << log1 << "Content: there is no a root dir (dir_table is empty)" << logend;
log << log1 << "Content: there is no a root dir (dir_tab is empty)" << logend;
return;
}
@ -350,9 +352,9 @@ void App::Make()
if( !request.redirect_to.empty() )
return;
if( request.dir_table.empty() )
if( request.dir_tab.empty() )
{
log << log1 << "App: there is no a root dir (dir_table is empty -- after calling a function)" << logend;
log << log1 << "App: there is no a root dir (dir_tab is empty -- after calling a function)" << logend;
return;
}
@ -360,7 +362,7 @@ void App::Make()
MakePage();
// !! dodac parametr do konfiga wlaczajacy te informacje
//request->PrintGetTable();
//request->PrintGetTab();
//request->PrintEnv();
//request->PrintIn();
}
@ -368,31 +370,4 @@ void App::Make()
// !! dac lepsza nazwe i czy napewno w app to ma byc?
void App::ReadAdditionalInfo()
{
if( request.dir_table.empty() )
return;
if( system.mounts.pmount->type == Mount::thread )
{
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == WINIX_ERR_OK )
request.is_thread = true;
}
else
if( system.mounts.pmount->type == Mount::ticket )
{
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == WINIX_ERR_OK )
{
request.is_ticket = true;
if( !request.is_item && (!request.pfunction || request.pfunction->fun.url == "ticket") )
{
db.GetItemById(request.ticket.item_id, request.item);
// don't set request->is_item here
}
}
}
}

@ -99,7 +99,6 @@ private:
void DeleteAllPluginsData();
void MakePage();
void Make();
void ReadAdditionalInfo();
void SaveSessionsIfNeeded(); // !! wywalic do managara sesji??
// !! dodac do session managera?

@ -21,7 +21,7 @@ class CookieParser : public HttpSimpleParser
{
const char * cookie_string;
CookieTable & cookie_table;
CookieTab & cookie_tab;
protected:
@ -41,7 +41,7 @@ protected:
// Cookie names are case insensitive according to section 3.1 of RFC 2965
ToLower(name);
std::pair<CookieTable::iterator, bool> res = cookie_table.insert( std::make_pair(name, value) );
std::pair<CookieTab::iterator, bool> res = cookie_tab.insert( std::make_pair(name, value) );
log << log2 << "Cookie, name: \"" << name << "\", value: \"" << value << "\"";
@ -58,7 +58,7 @@ protected:
public:
CookieParser(const char * cookie_string_, CookieTable & cookie_table_) : cookie_string(cookie_string_), cookie_table(cookie_table_)
CookieParser(const char * cookie_string_, CookieTab & cookie_tab_) : cookie_string(cookie_string_), cookie_tab(cookie_tab_)
{
HttpSimpleParser::separator = ';';
HttpSimpleParser::value_can_be_quoted = true;

@ -855,9 +855,9 @@ return AssertQuery(query.str());
void Db::GetItems(std::vector<Item> & item_table, const ItemQuery & item_query)
void Db::GetItems(std::vector<Item> & item_tab, const ItemQuery & item_query)
{
item_table.clear();
item_tab.clear();
PGresult * r = 0;
try
@ -876,7 +876,7 @@ void Db::GetItems(std::vector<Item> & item_table, const ItemQuery & item_query)
for(int i = 0 ; i<rows ; ++i)
{
col.SetItem(r, i, item);
item_table.push_back(item);
item_tab.push_back(item);
}
}
catch(const Error &)
@ -888,9 +888,9 @@ void Db::GetItems(std::vector<Item> & item_table, const ItemQuery & item_query)
void Db::GetItems(std::vector<long> & item_table, const ItemQuery & item_query)
void Db::GetItems(std::vector<long> & item_tab, const ItemQuery & item_query)
{
item_table.clear();
item_tab.clear();
PGresult * r = 0;
try
@ -905,7 +905,7 @@ void Db::GetItems(std::vector<long> & item_table, const ItemQuery & item_query)
for(int i = 0 ; i<rows ; ++i)
{
long id = atol( AssertValue(r, i, 0) );
item_table.push_back(id);
item_tab.push_back(id);
}
}
catch(const Error &)
@ -953,7 +953,7 @@ return res;
// !! cos tu pomyslec innego, ta metoda nie musi pobierac tablicy za argument
// i tak istnieje tylko jedna pozycja o okreslonym id
// mozna zwracac bool i pobierac referencje na item
void Db::GetItem(std::vector<Item> & item_table, long id)
void Db::GetItem(std::vector<Item> & item_tab, long id)
{
PGresult * r = 0;
@ -979,7 +979,7 @@ void Db::GetItem(std::vector<Item> & item_table, long id)
for(int i = 0 ; i<rows ; ++i)
{
col.SetItem(r, i, item);
item_table.push_back(item);
item_tab.push_back(item);
}
}
catch(const Error &)
@ -1442,7 +1442,7 @@ return DelItemDelItem(item);
void Db::GetDirs(DirContainer & dir_table)
void Db::GetDirs(DirContainer & dir_tab)
{
PGresult * r = 0;
@ -1465,7 +1465,7 @@ void Db::GetDirs(DirContainer & dir_table)
for(int i = 0 ; i<rows ; ++i)
{
col.SetItem(r, i, item);
dir_table.PushBack( item );
dir_tab.PushBack( item );
}
}
catch(const Error &)
@ -1477,7 +1477,7 @@ void Db::GetDirs(DirContainer & dir_table)
void Db::GetUsers(UGContainer<User> & user_table)
void Db::GetUsers(UGContainer<User> & user_tab)
{
PGresult * r = 0;
@ -1503,7 +1503,7 @@ void Db::GetUsers(UGContainer<User> & user_table)
User u;
long last_id = -1;
UGContainer<User>::Iterator iter = user_table.End();
UGContainer<User>::Iterator iter = user_tab.End();
for(int i = 0 ; i<rows ; ++i)
{
@ -1519,9 +1519,9 @@ void Db::GetUsers(UGContainer<User> & user_table)
log << log1 << "Db: get user: id:" << u.id << ", name:" << u.name << ", super_user:" << u.super_user << logend;
iter = user_table.PushBack( u );
iter = user_tab.PushBack( u );
if( iter == user_table.End() )
if( iter == user_tab.End() )
log << log1 << "Db: can't add a user: " << u.name << logend;
last_id = u.id;
@ -1529,7 +1529,7 @@ void Db::GetUsers(UGContainer<User> & user_table)
long group_id = atol( AssertValue(r, i, cgroup_id) );
if( !PQgetisnull(r, i, cgroup_id) && group_id!=-1 && iter!=user_table.End() )
if( !PQgetisnull(r, i, cgroup_id) && group_id!=-1 && iter!=user_tab.End() )
{
iter->groups.push_back(group_id);
log << log3 << "Db: user:" << iter->name << " is a member of group_id:" << group_id << logend;
@ -1545,7 +1545,7 @@ void Db::GetUsers(UGContainer<User> & user_table)
void Db::GetGroups(UGContainer<Group> & group_table)
void Db::GetGroups(UGContainer<Group> & group_tab)
{
PGresult * r = 0;
@ -1578,13 +1578,13 @@ void Db::GetGroups(UGContainer<Group> & group_table)
g.name = AssertValue(r, i, cname);
log << log3 << "Db: get group, id:" << g.id << ", group:" << g.name << logend;
iter = group_table.PushBack( g );
iter = group_tab.PushBack( g );
last_id = g.id;
}
long user_id = atol( AssertValue(r, i, cuser_id) );
if( !PQgetisnull(r, i, cuser_id) && user_id!=-1 && !group_table.Empty() )
if( !PQgetisnull(r, i, cuser_id) && user_id!=-1 && !group_tab.Empty() )
{
iter->members.push_back(user_id);
log << log3 << "Db: get group member: user_id:" << user_id << logend;

@ -133,12 +133,12 @@ public:
};
void GetItems(std::vector<Item> & item_table, const ItemQuery & item_query);
void GetItems(std::vector<long> & item_table, const ItemQuery & item_query);
void GetItems(std::vector<Item> & item_tab, const ItemQuery & item_query);
void GetItems(std::vector<long> & item_tab, const ItemQuery & item_query);
// !! pobiera tylko jeden item (cos wymyslec innego z nazwa albo argumentem)
void GetItem(std::vector<Item> & item_table, long id);
void GetItem(std::vector<Item> & item_tab, long id);
bool GetPriv(Item & item, long id);
@ -151,9 +151,9 @@ public:
bool DelItem(const Item & item);
void GetDirs(DirContainer & dir_table);
void GetUsers(UGContainer<User> & user_table);
void GetGroups(UGContainer<Group> & group_table);
void GetDirs(DirContainer & dir_tab);
void GetUsers(UGContainer<User> & user_tab);
void GetGroups(UGContainer<Group> & group_tab);
// !! nowy interfejs
long Size(long parent_id, Item::Type type = Item::none);

@ -27,7 +27,7 @@ void Dirs::SetRequest(Request * prequest)
void Dirs::Clear()
{
dir_table.Clear();
dir_tab.Clear();
}
@ -40,9 +40,9 @@ bool Dirs::HasReadExecAccessForRoot(const Item & item)
void Dirs::CheckRootDir()
{
DirContainer::Iterator i = dir_table.GetRoot();
DirContainer::Iterator i = dir_tab.GetRoot();
if( i != dir_table.End() )
if( i != dir_tab.End() )
{
if( !HasReadExecAccessForRoot(*i) )
{
@ -70,7 +70,7 @@ void Dirs::CheckRootDir()
// !! zrobic jakis wyjatek do wprowadzania roota?
if( db->AddItem(root) == WINIX_ERR_OK )
{
dir_table.PushBack(root);
dir_tab.PushBack(root);
}
}
@ -81,9 +81,9 @@ void Dirs::ReadDirs()
{
Clear();
db->GetDirs(dir_table);
db->GetDirs(dir_tab);
CheckRootDir();
dir_table.FindSpecialFolders();
dir_tab.FindSpecialFolders();
}
@ -106,9 +106,9 @@ return !name.empty();
bool Dirs::IsDir(long id)
{
DirContainer::Iterator i = dir_table.FindId(id);
DirContainer::Iterator i = dir_tab.FindId(id);
if( i == dir_table.End() )
if( i == dir_tab.End() )
return false;
return true;
@ -117,15 +117,15 @@ return true;
bool Dirs::GetDirChilds(long parent, std::vector<Item*> & childs_table)
bool Dirs::GetDirChilds(long parent, std::vector<Item*> & childs_tab)
{
if( parent != -1 && !IsDir(parent) )
return false;
DirContainer::ParentIterator i = dir_table.FindFirstParent(parent);
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent);
for( ; i != dir_table.ParentEnd() ; i = dir_table.NextParent(i) )
childs_table.push_back( &(*i->second) );
for( ; i != dir_tab.ParentEnd() ; i = dir_tab.NextParent(i) )
childs_tab.push_back( &(*i->second) );
return true;
}
@ -133,7 +133,7 @@ return true;
DirContainer::ParentIterator Dirs::FindFirstParent(long parent_id)
{
DirContainer::ParentIterator i = dir_table.FindFirstParent(parent_id);
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent_id);
return i;
}
@ -141,13 +141,13 @@ return i;
DirContainer::ParentIterator Dirs::NextParent(DirContainer::ParentIterator i)
{
return dir_table.NextParent(i);
return dir_tab.NextParent(i);
}
DirContainer::ParentIterator Dirs::ParentEnd()
{
return dir_table.ParentEnd();
return dir_tab.ParentEnd();
}
@ -163,9 +163,9 @@ DirContainer::Iterator i;
while( true )
{
i = dir_table.FindId(id);
i = dir_tab.FindId(id);
if( i == dir_table.End() ||
if( i == dir_tab.End() ||
i->parent_id == id ) // means a loop (something wrong in the db)
return false;
@ -184,7 +184,7 @@ DirContainer::Iterator i;
bool Dirs::ChangeParent(long dir_id, long new_parent_id)
{
return dir_table.ChangeParent(dir_id, new_parent_id);
return dir_tab.ChangeParent(dir_id, new_parent_id);
}
@ -198,9 +198,9 @@ DirContainer::Iterator i;
while( true )
{
i = dir_table.FindId(dir_id);
i = dir_tab.FindId(dir_id);
if( i==dir_table.End() || i->parent_id==-1 )
if( i==dir_tab.End() || i->parent_id==-1 )
return false;
if( i->parent_id == parent_id )
@ -215,9 +215,9 @@ DirContainer::Iterator i;
Item * Dirs::GetRootDir()
{
DirContainer::Iterator root = dir_table.GetRoot();
DirContainer::Iterator root = dir_tab.GetRoot();
if( root == dir_table.End() )
if( root == dir_tab.End() )
return 0;
return &(*root);
@ -226,9 +226,9 @@ return &(*root);
Item * Dirs::GetEtcDir()
{
DirContainer::Iterator etc = dir_table.GetEtc();
DirContainer::Iterator etc = dir_tab.GetEtc();
if( etc == dir_table.End() )
if( etc == dir_tab.End() )
return 0;
return &(*etc);
@ -237,9 +237,9 @@ return &(*etc);
Item * Dirs::GetDir(const std::string & name, long parent)
{
DirContainer::ParentIterator i = dir_table.FindFirstParent(parent);
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent);
for( ; i!=dir_table.ParentEnd() ; i = dir_table.NextParent(i) )
for( ; i!=dir_tab.ParentEnd() ; i = dir_tab.NextParent(i) )
if( i->second->url == name )
return &(*i->second);
@ -250,9 +250,9 @@ return 0;
Item * Dirs::GetDir(const std::string & path)
{
DirContainer::Iterator root = dir_table.GetRoot();
DirContainer::Iterator root = dir_tab.GetRoot();
if( root == dir_table.End() )
if( root == dir_tab.End() )
// ops, we do not have a root dir
return 0;
@ -276,9 +276,9 @@ return pitem;
Item * Dirs::GetDir(long id)
{
DirContainer::Iterator i = dir_table.FindId(id);
DirContainer::Iterator i = dir_tab.FindId(id);
if( i == dir_table.End() )
if( i == dir_tab.End() )
return 0;
return &(*i);
@ -289,7 +289,7 @@ return &(*i);
Item * Dirs::AddDir(const Item & item)
{
return &(*dir_table.PushBack(item));
return &(*dir_tab.PushBack(item));
}
@ -405,11 +405,11 @@ void Dirs::SplitPath(const std::string & path, std::string & dir, std::string &
// !! dodac kasowanie z bazy
bool Dirs::DelDir(long dir_id)
{
return dir_table.DelById(dir_id);
return dir_tab.DelById(dir_id);
}
Error Dirs::AddDirectory(Item & item, bool add_to_dir_table)
Error Dirs::AddDirectory(Item & item, bool add_to_dir_tab)
{
if( item.type != Item::dir )
return WINIX_ERR_DIR_EXPECTED;
@ -420,8 +420,8 @@ Error Dirs::AddDirectory(Item & item, bool add_to_dir_table)
{
Item * pdir = AddDir(item);
if( add_to_dir_table && request->dir_table.back()->id == item.parent_id )
request->dir_table.push_back(pdir);
if( add_to_dir_tab && request->dir_tab.back()->id == item.parent_id )
request->dir_tab.push_back(pdir);
}
return status;

@ -36,7 +36,7 @@ public:
// these methods return false if there is no such a dir
bool IsDir(long dir_id);
bool GetDirChilds(long parent_id, std::vector<Item*> & childs_table);
bool GetDirChilds(long parent_id, std::vector<Item*> & childs_tab);
bool MakePath(long dir_id, std::string & path);
bool ChangeParent(long dir_id, long new_parent_id);
bool HasParent(long dir_id, long parent_id);
@ -63,14 +63,14 @@ public:
// !! jak juz wczesniejsze nazwy beda zmienione to tutaj damy AddDir()
Error AddDirectory(Item & item, bool add_to_dir_table = false);
Error AddDirectory(Item & item, bool add_to_dir_tab = false);
private:
Request * request;
Db * db;
DirContainer dir_table;
DirContainer dir_tab;
size_t AnalyzeDir(Item * pdir, const std::string & path, long & dir_id, std::string & dir);
std::string analyze_temp;

@ -18,7 +18,7 @@ class GetParser : public HttpSimpleParser
{
const char * get_string;
GetTable & get_table;
GetTab & get_tab;
protected:
@ -33,7 +33,7 @@ protected:
virtual void Parameter(std::string &, std::string & value)
{
get_table.push_back(value);
get_tab.push_back(value);
log << log2 << "Get, value: \"" << value << "\"" << logend;
}
@ -42,7 +42,7 @@ protected:
public:
GetParser(const char * get_string_, GetTable & get_table_) : get_string(get_string_), get_table(get_table_)
GetParser(const char * get_string_, GetTab & get_tab_) : get_string(get_string_), get_tab(get_tab_)
{
HttpSimpleParser::separator = '/';
HttpSimpleParser::read_name = false;

@ -119,12 +119,12 @@ void Mounts::CalcCurMount()
{
std::vector<Item*>::reverse_iterator i;
// when the program starts (when the dir_table is empty()
// when the program starts (when the dir_tab is empty()
// we don't want to call MountCmsForRoot()
if( request->dir_table.empty() )
if( request->dir_tab.empty() )
return;
for(i = request->dir_table.rbegin() ; i!=request->dir_table.rend() ; ++i)
for(i = request->dir_tab.rbegin() ; i!=request->dir_tab.rend() ; ++i)
{
std::map<long, Mount>::iterator m = mount_tab.find( (*i)->id );

@ -211,9 +211,9 @@ void Notify::CreateItemDir(std::string & dir, bool clear)
if( clear )
dir.clear();
for(size_t a=0 ; a<request->dir_table.size() ; ++a)
for(size_t a=0 ; a<request->dir_tab.size() ; ++a)
{
dir += request->dir_table[a]->url;
dir += request->dir_tab[a]->url;
dir += '/';
}
}

@ -349,14 +349,14 @@ void PostMultiParser::ReadContent()
void PostMultiParser::AddNormalPostVar()
{
if( post_table->size() >= WINIX_POSTTABLE_MAXSIZE )
if( post_tab->size() >= WINIX_POSTTABLE_MAXSIZE )
{
err = WINIX_ERR_INPUT_TOO_LARGE;
log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post variables (skipping)" << logend;
return;
}
std::pair<PostTable::iterator, bool> res = post_table->insert( std::make_pair(name, content) );
std::pair<PostTab::iterator, bool> res = post_tab->insert( std::make_pair(name, content) );
bool added = res.second;
log << log2 << "PMP: POST var, name: \"" << name << "\"";
@ -370,7 +370,7 @@ void PostMultiParser::AddNormalPostVar()
void PostMultiParser::AddFilePostVar()
{
if( post_file_table->size() >= WINIX_POSTTABLE_MAXSIZE )
if( post_file_tab->size() >= WINIX_POSTTABLE_MAXSIZE )
{
err = WINIX_ERR_INPUT_TOO_LARGE;
log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post file variables (skipping)" << logend;
@ -379,7 +379,7 @@ void PostMultiParser::AddFilePostVar()
post_file_temp.filename = filename;
post_file_temp.tmp_filename = tmp_filename;
std::pair<PostFileTable::iterator, bool> res = post_file_table->insert( std::make_pair(name, post_file_temp) );
std::pair<PostFileTab::iterator, bool> res = post_file_tab->insert( std::make_pair(name, post_file_temp) );
bool added = res.second;
log << log2 << "PMP: POST FILE var, name: \"" << name << "\"";
@ -531,7 +531,7 @@ void PostMultiParser::ReadChar()
Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFileTable & post_file_table_)
Error PostMultiParser::Parse(FCGX_Stream * in_, PostTab & post_tab_, PostFileTab & post_file_tab_)
{
in = in_;
last = 0;
@ -539,8 +539,8 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFil
line_end_dos = false;
in_buffer_ind = WINIX_POSTMULTI_INPUT_BUFFER;
in_buffer_len = WINIX_POSTMULTI_INPUT_BUFFER;
post_table = &post_table_;
post_file_table = &post_file_table_;
post_tab = &post_tab_;
post_file_tab = &post_file_tab_;
tmp_filename_postfix = 1;
ReadChar();
@ -554,8 +554,8 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFil
if( err != WINIX_ERR_OK )
{
post_table->clear();
post_file_table->clear();
post_tab->clear();
post_file_tab->clear();
if( err != WINIX_ERR_INPUT_TOO_LARGE && err != WINIX_ERR_CANT_CREATE_FILE )
log << log1 << "PMP: syntax error" << logend;

@ -34,7 +34,7 @@ public:
~PostMultiParser();
void SetConfig(Config * pconfig);
Error Parse(FCGX_Stream * in_, PostTable & post_table_, PostFileTable & post_file_table_);
Error Parse(FCGX_Stream * in_, PostTab & post_tab_, PostFileTab & post_file_tab_);
private:
@ -48,8 +48,8 @@ private:
size_t in_buffer_ind;
size_t in_buffer_len;
PostTable * post_table;
PostFileTable * post_file_table;
PostTab * post_tab;
PostFileTab * post_file_tab;
int last; // last read character

@ -22,7 +22,7 @@ class PostParser : public HttpSimpleParser
{
FCGX_Stream * in;
PostTable & post_table;
PostTab & post_tab;
protected:
@ -35,7 +35,7 @@ protected:
virtual void Parameter(std::string & name, std::string & value)
{
std::pair<PostTable::iterator, bool> res = post_table.insert( std::make_pair(name, value) );
std::pair<PostTab::iterator, bool> res = post_tab.insert( std::make_pair(name, value) );
log << log2 << "Method POST, name: \"" << name << "\", value: \"" << value << "\"";
@ -48,7 +48,7 @@ protected:
public:
PostParser(FCGX_Stream * in_, PostTable & post_table_) : in(in_), post_table(post_table_)
PostParser(FCGX_Stream * in_, PostTab & post_tab_) : in(in_), post_tab(post_tab_)
{
}

@ -47,14 +47,14 @@ void Request::ClearPostFileTmp()
{
// deleting temporary files (if exists)
while( !post_file_table.empty() )
while( !post_file_tab.empty() )
{
const std::string & tmp_filename = post_file_table.begin()->second.tmp_filename;
const std::string & tmp_filename = post_file_tab.begin()->second.tmp_filename;
if( unlink(tmp_filename.c_str()) == 0 )
log << log3 << "Request: deleted tmp file: " << tmp_filename << logend;
post_file_table.erase(post_file_table.begin());
post_file_tab.erase(post_file_tab.begin());
}
}
@ -67,10 +67,10 @@ void Request::Clear()
if( ++id == 0 )
++id;
get_table.clear();
post_table.clear();
post_file_table.clear();
cookie_table.clear();
get_tab.clear();
post_tab.clear();
post_file_tab.clear();
cookie_tab.clear();
method = none;
role = responder;
@ -78,7 +78,7 @@ void Request::Clear()
headers.str("");
page.str("");
debug.str("");
notify.str("");
//notify.str("");
env_request_method = &char_empty;
env_request_uri = &char_empty;
@ -93,22 +93,14 @@ void Request::Clear()
session = 0;
item_table.clear();
item_tab.clear();
item.Clear();
dir_table.clear();
dir_tab.clear();
is_item = false;
pfunction = 0;
param_table.clear();
function = 0;
param_tab.clear();
status = WINIX_ERR_OK;
is_thread = false;
thread.Clear();
thread_tab.clear();
is_ticket = false;
ticket.Clear();
ticket_tab.clear();
notify_code = 0;
browser_msie = false;
@ -154,11 +146,11 @@ void Request::SetCookie(const char * name, long value, tm * expires)
bool Request::IsPostVar(const char * var)
{
PostTable::iterator p;
PostTab::iterator p;
p = post_table.find(var);
p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
return false;
return true;
@ -168,9 +160,9 @@ return true;
std::string * Request::PostVar(const char * var)
{
PostTable::iterator p = post_table.find(var);
PostTab::iterator p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
return 0;
return &(p->second);
@ -180,9 +172,9 @@ return &(p->second);
bool Request::PostVar(const char * var, std::string & result)
{
PostTable::iterator p = post_table.find(var);
PostTab::iterator p = post_tab.find(var);
if( p == post_table.end() )
if( p == post_tab.end() )
{
result.clear();
return false;
@ -200,11 +192,11 @@ return true;
//
void Request::PrintGetTable()
void Request::PrintGetTab()
{
debug << "get_table: " << get_table.size() << "\n";
debug << "get_tab: " << get_tab.size() << "\n";
for(GetTable::iterator i = get_table.begin() ; i != get_table.end() ; ++i)
for(GetTab::iterator i = get_tab.begin() ; i != get_tab.end() ; ++i)
debug << " \"" << *i << "\"\n";
debug << std::endl;
@ -327,9 +319,9 @@ void Request::CheckMethod()
bool Request::AllPostVarEmpty()
{
PostTable::iterator i;
PostTab::iterator i;
for(i=post_table.begin() ; i!=post_table.end() ; ++i)
for(i=post_tab.begin() ; i!=post_tab.end() ; ++i)
if( !i->second.empty() )
return false;
@ -342,7 +334,7 @@ return true;
void Request::ReadParameters()
{
// !! wrzucic jako skladowa klasy
GetParser get_parser(env_request_uri, get_table);
GetParser get_parser(env_request_uri, get_tab);
get_parser.Parse();
if( method == post )
@ -352,17 +344,17 @@ void Request::ReadParameters()
log << log3 << "Request: post content type: multipart/form-data" << logend;
post_multi_parser.SetConfig(config);
post_multi_parser.Parse(in, post_table, post_file_table);
post_multi_parser.Parse(in, post_tab, post_file_tab);
}
else
{
// !! wrzucic jako skladowa klasy
PostParser post_parser(in, post_table);
PostParser post_parser(in, post_tab);
post_parser.Parse();
}
}
CookieParser cookie_parser(env_http_cookie, cookie_table);
CookieParser cookie_parser(env_http_cookie, cookie_tab);
cookie_parser.Parse();
accept_encoding_parser.Parse(env_http_accept_encoding);
@ -491,7 +483,7 @@ void Request::SendPage(bool compressing, const std::string & source_ref)
const std::string * source = &source_ref;
bool raw = is_item && item.content_type == Item::ct_raw && status == WINIX_ERR_OK &&
pfunction && (pfunction->fun.url == "cat" || pfunction->fun.url == "run");
function && (function->fun.url == "cat" || function->fun.url == "run");
if( config->html_filter && !raw )
{
@ -550,9 +542,9 @@ bool compressing = config->compression && role == responder && redirect_to.empty
bool Request::IsParam(const char * param_name)
{
ParamTable::iterator i;
ParamTab::iterator i;
for(i=param_table.begin() ; i!=param_table.end() ; ++i)
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
{
// !! make sure that exists std::string::operator==(const char*)
// (optimization)
@ -566,9 +558,9 @@ return false;
const std::string & Request::ParamValue(const char * param_name)
{
ParamTable::iterator i;
ParamTab::iterator i;
for(i=param_table.begin() ; i!=param_table.end() ; ++i)
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
{
if( i->name == param_name )
{

@ -19,12 +19,10 @@
#include "session.h"