we can create links (hard links, symbolic links) now

added winix functions: ln

winix function 'default' can be used without redirecting now

added new tickets types: TypeProgress, TypeString, TypeMultistring, TypeImages, TypeFiles
now tickets are combined with files
added winix functions: showtickets

fixed mountpoints:
when the default root mount was created its parameter table was empty
and it caused accessing to a non-existing objects

fixed logger:
modifiers (log1, log2, log3) were incorrectly treated
added modifier: log4 (debug info)

now we are moving threads to a new plugin 'thread'
created directory: plugins/thread
(not finished yet)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@704 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2011-01-05 21:24:11 +00:00
parent bb83aed20d
commit 8154c403d8
113 changed files with 5840 additions and 2972 deletions

View File

@ -23,12 +23,13 @@ app.o: ../functions/functionbase.h ../core/request.h ../core/system.h
app.o: ../core/synchro.h ../functions/functionparser.h ../functions/adduser.h
app.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
app.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
app.o: ../functions/createthread.h ../functions/default.h
app.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
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/specialdefault.h ../functions/stat.h
app.o: ../functions/createthread.h ../functions/functionbase.h
app.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
app.o: ../functions/last.h ../functions/login.h ../functions/logout.h
app.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
app.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
app.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
app.o: ../functions/specialdefault.h ../functions/stat.h
app.o: ../functions/subject.h ../functions/funthread.h
app.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
app.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
@ -65,13 +66,14 @@ config.o: ../core/request.h ../core/system.h ../core/synchro.h
config.o: ../functions/functionparser.h ../functions/adduser.h
config.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
config.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
config.o: ../functions/createthread.h ../functions/default.h
config.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
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/specialdefault.h
config.o: ../functions/stat.h ../functions/subject.h ../functions/funthread.h
config.o: ../functions/createthread.h ../functions/functionbase.h
config.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
config.o: ../functions/last.h ../functions/login.h ../functions/logout.h
config.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
config.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
config.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
config.o: ../functions/specialdefault.h ../functions/stat.h
config.o: ../functions/subject.h ../functions/funthread.h
config.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
config.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
config.o: ../functions/vim.h ../core/htmlfilter.h ../templates/templates.h
@ -164,13 +166,14 @@ mounts.o: ../core/synchro.h ../functions/functionparser.h
mounts.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
mounts.o: ../functions/privchanger.h ../functions/chown.h
mounts.o: ../functions/ckeditor.h ../functions/cp.h
mounts.o: ../functions/createthread.h ../functions/default.h
mounts.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
mounts.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
mounts.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
mounts.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
mounts.o: ../functions/run.h ../functions/specialdefault.h
mounts.o: ../functions/stat.h ../functions/subject.h ../functions/funthread.h
mounts.o: ../functions/createthread.h ../functions/functionbase.h
mounts.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
mounts.o: ../functions/last.h ../functions/login.h ../functions/logout.h
mounts.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
mounts.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
mounts.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
mounts.o: ../functions/specialdefault.h ../functions/stat.h
mounts.o: ../functions/subject.h ../functions/funthread.h
mounts.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
mounts.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
mounts.o: ../functions/vim.h ../core/htmlfilter.h ../templates/templates.h
@ -201,13 +204,14 @@ plugin.o: ../core/request.h ../core/system.h ../core/synchro.h
plugin.o: ../functions/functionparser.h ../functions/adduser.h
plugin.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
plugin.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
plugin.o: ../functions/createthread.h ../functions/default.h
plugin.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
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/specialdefault.h
plugin.o: ../functions/stat.h ../functions/subject.h ../functions/funthread.h
plugin.o: ../functions/createthread.h ../functions/functionbase.h
plugin.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
plugin.o: ../functions/last.h ../functions/login.h ../functions/logout.h
plugin.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
plugin.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
plugin.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
plugin.o: ../functions/specialdefault.h ../functions/stat.h
plugin.o: ../functions/subject.h ../functions/funthread.h
plugin.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
plugin.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
plugin.o: ../functions/vim.h ../core/htmlfilter.h ../templates/templates.h
@ -239,21 +243,22 @@ plugindata.o: ../core/synchro.h ../functions/functionparser.h
plugindata.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
plugindata.o: ../functions/privchanger.h ../functions/chown.h
plugindata.o: ../functions/ckeditor.h ../functions/cp.h
plugindata.o: ../functions/createthread.h ../functions/default.h
plugindata.o: ../functions/download.h ../functions/emacs.h
plugindata.o: ../functions/last.h ../functions/login.h ../functions/logout.h
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
plugindata.o: ../functions/specialdefault.h ../functions/stat.h
plugindata.o: ../functions/subject.h ../functions/funthread.h
plugindata.o: ../functions/template.h ../functions/tinymce.h
plugindata.o: ../functions/uname.h ../functions/upload.h
plugindata.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
plugindata.o: ../core/htmlfilter.h ../templates/templates.h
plugindata.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
plugindata.o: ../core/httpsimpleparser.h ../core/log.h
plugindata.o: ../templates/indexpatterns.h ../core/sessionmanager.h
plugindata.o: ../functions/createthread.h ../functions/functionbase.h
plugindata.o: ../functions/default.h ../functions/download.h
plugindata.o: ../functions/emacs.h ../functions/last.h ../functions/login.h
plugindata.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
plugindata.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
plugindata.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
plugindata.o: ../functions/run.h ../functions/specialdefault.h
plugindata.o: ../functions/stat.h ../functions/subject.h
plugindata.o: ../functions/funthread.h ../functions/template.h
plugindata.o: ../functions/tinymce.h ../functions/uname.h
plugindata.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
plugindata.o: ../functions/vim.h ../core/htmlfilter.h
plugindata.o: ../templates/templates.h ../templates/patterncacher.h
plugindata.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
plugindata.o: ../core/log.h ../templates/indexpatterns.h
plugindata.o: ../core/sessionmanager.h
postmultiparser.o: postmultiparser.h error.h requesttypes.h config.h
postmultiparser.o: confparser.h htmlfilter.h log.h textstream.h
postmultiparser.o: ../../ezc/src/utf8.h misc.h item.h
@ -284,9 +289,10 @@ request.o: ../core/request.h ../core/system.h ../core/synchro.h
request.o: ../functions/functionparser.h ../functions/adduser.h
request.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
request.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
request.o: ../functions/createthread.h ../functions/default.h
request.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
request.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
request.o: ../functions/createthread.h ../functions/functionbase.h
request.o: ../functions/default.h ../functions/download.h
request.o: ../functions/emacs.h ../functions/last.h ../functions/login.h
request.o: ../functions/logout.h ../functions/ln.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/specialdefault.h
@ -332,19 +338,20 @@ sessionmanager.o: ../functions/functionparser.h ../functions/adduser.h
sessionmanager.o: ../functions/cat.h ../functions/chmod.h
sessionmanager.o: ../functions/privchanger.h ../functions/chown.h
sessionmanager.o: ../functions/ckeditor.h ../functions/cp.h
sessionmanager.o: ../functions/createthread.h ../functions/default.h
sessionmanager.o: ../functions/download.h ../functions/emacs.h
sessionmanager.o: ../functions/last.h ../functions/login.h
sessionmanager.o: ../functions/logout.h ../functions/ls.h
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/specialdefault.h
sessionmanager.o: ../functions/stat.h ../functions/subject.h
sessionmanager.o: ../functions/funthread.h ../functions/template.h
sessionmanager.o: ../functions/tinymce.h ../functions/uname.h
sessionmanager.o: ../functions/upload.h ../functions/uptime.h
sessionmanager.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
sessionmanager.o: ../templates/templates.h ../templates/patterncacher.h
sessionmanager.o: ../functions/createthread.h ../functions/functionbase.h
sessionmanager.o: ../functions/default.h ../functions/download.h
sessionmanager.o: ../functions/emacs.h ../functions/last.h
sessionmanager.o: ../functions/login.h ../functions/logout.h
sessionmanager.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
sessionmanager.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
sessionmanager.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
sessionmanager.o: ../functions/specialdefault.h ../functions/stat.h
sessionmanager.o: ../functions/subject.h ../functions/funthread.h
sessionmanager.o: ../functions/template.h ../functions/tinymce.h
sessionmanager.o: ../functions/uname.h ../functions/upload.h
sessionmanager.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
sessionmanager.o: ../core/htmlfilter.h ../templates/templates.h
sessionmanager.o: ../templates/patterncacher.h
sessionmanager.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
sessionmanager.o: ../core/log.h ../templates/indexpatterns.h
sessionmanager.o: ../core/sessionmanager.h
@ -376,11 +383,24 @@ system.o: ../templates/templates.h ../templates/patterncacher.h
system.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
system.o: ../core/log.h ../templates/indexpatterns.h ../core/request.h
system.o: ../core/system.h ../core/sessionmanager.h
system.o: ../functions/functionbase.h
textstream.o: textstream.h misc.h item.h
thumb.o: thumb.h basethread.h textstream.h ../db/db.h ../db/dbbase.h
thumb.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
thumb.o: item.h ../core/error.h log.h ../db/dbitemquery.h ../core/item.h
thumb.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
thumb.o: ../core/thread.h ../core/dircontainer.h ../core/ugcontainer.h
thumb.o: ../../ezc/src/utf8.h
thumb.o: ../core/config.h ../../ezc/src/utf8.h system.h dirs.h dircontainer.h
thumb.o: request.h requesttypes.h session.h error.h user.h plugindata.h
thumb.o: rebus.h config.h confparser.h htmlfilter.h
thumb.o: ../templates/htmltextstream.h ../notify/notify.h
thumb.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
thumb.o: ../templates/misc.h ../templates/localefilter.h
thumb.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/generator.h
thumb.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
thumb.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
thumb.o: ../templates/htmltextstream.h ../notify/notifythread.h
thumb.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
thumb.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h mount.h
thumb.o: mountparser.h users.h groups.h group.h loadavg.h
users.o: users.h

View File

@ -182,7 +182,7 @@ return true;
void App::ProcessRequestThrow()
{
ReadRequest();
ReadRequest();
// when BaseUrlRedirect() return true we didn't have to set everything in request.Read()
// in the future request.Read() can be split and at the beginning only environment variables will be read
@ -214,15 +214,11 @@ void App::ProcessRequest()
log << log2 << config.log_delimiter << logend;
ProcessRequestThrow();
SaveSessionsIfNeeded();
if( request.function )
request.function->Clear();
SaveSessionsIfNeeded(); // !! przerzucic to na watek sesji
request.Clear();
system.load_avg.StopRequest();
log << logsave;
log << logendrequest;
}
catch(const std::exception & e)
{
@ -313,20 +309,13 @@ void App::Make()
// request.status can be changed by function_parser
if( request.status == WINIX_ERR_OK )
{
plugin.Call(WINIX_PREPARE_REQUEST);
if( system.DirsHaveReadExecPerm() )
{
if( request.method == Request::post )
functions.MakePost();
if( request.redirect_to.empty() && request.status == WINIX_ERR_OK )
functions.MakeGet();
}
else
request.status = WINIX_ERR_PERMISSION_DENIED;
}
if( request.status == WINIX_ERR_OK )
functions.CheckFunctionAndSymlink();
if( request.status == WINIX_ERR_OK )
functions.MakeFunction();
if( request.session->spam_score > 0 )
log << log1 << "App: spam score: " << request.session->spam_score << logend;
@ -538,17 +527,17 @@ void App::SendHeaders(bool compressing, Header header)
if( !request.redirect_to.empty() )
{
FCGX_PutS("Status: 301 Moved Permanently\r\n", fcgi_request.out);
AssignString(request.redirect_to, request.aredirect_to);
UrlEncode(request.redirect_to, request.aredirect_to);
FCGX_FPrintF(fcgi_request.out, "Location: %s\r\n", request.aredirect_to.c_str());
log << log2 << "Redirect to: " << request.redirect_to << logend;
log << log2 << "Redirect to: " << request.aredirect_to << logend;
}
else
if( !request.x_sendfile.empty() )
{
static std::string temp, temp2; // !! wrzucic gdzies to
AssignString(config.http_header_send_file, temp);
AssignString(request.x_sendfile, temp2);
Ezc::WideToUTF8(config.http_header_send_file, temp);
Ezc::WideToUTF8(request.x_sendfile, temp2);
FCGX_FPrintF(fcgi_request.out, "%s: %s\r\n", temp.c_str(), temp2.c_str());
FCGX_PutS("Status: 200 OK\r\n", fcgi_request.out);
@ -833,7 +822,7 @@ bool App::DropPrivileges(const std::string & user, uid_t uid, gid_t gid, bool ad
{
if( initgroups(user.c_str(), gid) < 0 )
{
log << log1 << "App: I can't init groups for user: " << user << logend << logsave;
log << log1 << "App: I can't init groups for user: " << user << logend;
return false;
}
}
@ -841,7 +830,7 @@ bool App::DropPrivileges(const std::string & user, uid_t uid, gid_t gid, bool ad
{
if( setgroups(1, &gid) < 0 )
{
log << log1 << "App: I can't init groups for user: " << user << logend << logsave;
log << log1 << "App: I can't init groups for user: " << user << logend;
return false;
}
}
@ -849,20 +838,20 @@ bool App::DropPrivileges(const std::string & user, uid_t uid, gid_t gid, bool ad
// for setting real and saved gid too
if( setgid(gid) )
{
log << log1 << "App: I can't change real and saved gid" << logend << logsave;
log << log1 << "App: I can't change real and saved gid" << logend;
return false;
}
if( setuid(uid) < 0 )
{
log << log1 << "App: I can't drop privileges to user: " << user
<< " (uid:" << (int)uid << ")" << logend << logsave;
<< " (uid:" << (int)uid << ")" << logend;
return false;
}
if( getuid()==0 || geteuid()==0 )
{
log << log1 << "App: sorry, for security reasons you should not run me as the root" << logend << logsave;
log << log1 << "App: sorry, for security reasons you should not run me as the root" << logend;
return false;
}
@ -880,14 +869,14 @@ bool App::DropPrivileges()
if( config.user.empty() )
{
log << log1 << "App: you should specify user name in the config file "
<< "to which I have to drop privileges" << logend << logsave;
<< "to which I have to drop privileges" << logend;
return false;
}
if( config.group.empty() )
{
log << log1 << "App: you should specify group name in the config file "
<< "to which I have to drop privileges" << logend << logsave;
<< "to which I have to drop privileges" << logend;
return false;
}
@ -896,13 +885,13 @@ bool App::DropPrivileges()
if( !p )
{
log << log1 << "App: there is no such a user as: \"" << config.user << "\"" << logend << logsave;
log << log1 << "App: there is no such a user as: \"" << config.user << "\"" << logend;
return false;
}
if( !g )
{
log << log1 << "App: there is no such a group as: \"" << config.group << "\"" << logend << logsave;
log << log1 << "App: there is no such a group as: \"" << config.group << "\"" << logend;
return false;
}
@ -922,7 +911,7 @@ bool App::Demonize()
if( pid == -1 )
{
log << log1 << "App: I can't demonize myself (fork problem)" << logend << logsave;
log << log1 << "App: I can't demonize myself (fork problem)" << logend;
return false;
}
@ -935,7 +924,7 @@ bool App::Demonize()
// child
if( setsid() == -1 )
{
log << log1 << "App: I can't demonize myself (setsid problem)" << logend << logsave;
log << log1 << "App: I can't demonize myself (setsid problem)" << logend;
return false;
}

View File

@ -105,6 +105,7 @@ void Config::AssignValues(bool stdout_is_closed)
fcgi_socket_group = AText(L"fcgi_socket_group");
log_level = Int(L"log_level", 1);
log_request = Int(L"log_request", 1);
log_save_each_line = Bool(L"log_save_each_line", false);
log_stdout = Bool(L"log_stdout", false);
log_db_query = Bool(L"log_db_query", false);
log_plugin_call = Bool(L"log_plugin_call", false);
@ -184,6 +185,9 @@ void Config::AssignValues(bool stdout_is_closed)
time_zone_offset_guest = Int(L"time_zone_offset_guest", 0);
utf8 = Bool(L"utf8", true);
symlinks_follow_max = Size(L"symlinks_follow_max", 20);
ticket_form_prefix = Text(L"ticket_form_prefix", L"ticketparam");
}

View File

@ -56,10 +56,14 @@ public:
// default: false
bool log_stdout;
// how many requests should be logged in the same time
// how many requests should be saved in the same time
// default: 1
int log_request;
// whether to save each line of the config (use it for debug purposes)
// default: false
bool log_save_each_line;
// logging db queries
// default: false
bool log_db_query;
@ -285,6 +289,14 @@ public:
// if false it means 8-bit ASCII
bool utf8;
// how many maximum symlinks can be followed
// (symlinks on directories as well)
// default: 20
size_t symlinks_follow_max;
// the prefix of a name of html form controls used in the ticket plugin
// default: ticketparam
std::wstring ticket_form_prefix;
/*
*/

View File

@ -91,9 +91,9 @@ void DirContainer::FindSpecialFolders()
if( !is_root )
return;
DirContainer::ParentIterator i = FindFirstParent(root_iter->id);
DirContainer::ParentIterator i = FindFirstChild(root_iter->id);
for( ; i!=ParentEnd() ; i = NextParent(i) )
for( ; i!=ParentEnd() ; i = NextChild(i) )
{
if( i->second->url == dir_etc )
{
@ -126,14 +126,14 @@ void DirContainer::CheckSpecialFolder(const Item & item, Iterator iter)
{
is_etc = true;
etc_iter = iter;
log << log1 << "DirCont: added special folder: /etc" << logend;
log << log2 << "DirCont: added special folder: /etc" << logend;
}
if( item.parent_id==root_iter->id && item.url==dir_var )
{
is_var = true;
var_iter = iter;
log << log1 << "DirCont: added special folder: /var" << logend;
log << log2 << "DirCont: added special folder: /var" << logend;
}
}
@ -172,10 +172,10 @@ bool DirContainer::ChangeParent(long dir_id, long new_parent_id)
if( i->parent_id == new_parent_id )
return true; // nothing to do
ParentIterator p = FindFirstParent(i->parent_id);
ParentIterator p = FindFirstChild(i->parent_id);
bool found = false;
for( ; p != table_parent.end() ; p = NextParent(p) )
for( ; p != table_parent.end() ; p = NextChild(p) )
{
if( p->second->id == dir_id )
{
@ -251,7 +251,7 @@ bool DirContainer::ParentEmpty()
}
DirContainer::ParentIterator DirContainer::FindFirstParent(long parent)
DirContainer::ParentIterator DirContainer::FindFirstChild(long parent)
{
ParentIterator i = table_parent.lower_bound(parent);
@ -262,7 +262,7 @@ return i;
}
DirContainer::ParentIterator DirContainer::NextParent(ParentIterator i)
DirContainer::ParentIterator DirContainer::NextChild(ParentIterator i)
{
if( i == table_parent.end() )
return table_parent.end();

View File

@ -52,8 +52,8 @@ public:
ParentIterator ParentEnd();
ParentSizeType ParentSize();
bool ParentEmpty();
ParentIterator FindFirstParent(long parent);
ParentIterator NextParent(ParentIterator pi);
ParentIterator FindFirstChild(long parent);
ParentIterator NextChild(ParentIterator pi);
bool IsNameOfSpecialFolder(const std::wstring & name);
void FindSpecialFolders();

View File

@ -70,7 +70,6 @@ void Dirs::CheckRootDir()
root.user_id = -1;
root.group_id = -1;
root.privileges = 0755;
root.default_item = -1;
// !! upewnic sie ze baza nie zmieni url (gdyby wczesniej juz byl w bazie pusty url)
// !! zrobic jakis wyjatek do wprowadzania roota?
@ -129,26 +128,26 @@ bool Dirs::GetDirChilds(long parent, std::vector<Item*> & childs_tab)
if( parent != -1 && !IsDir(parent) )
return false;
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent);
DirContainer::ParentIterator i = dir_tab.FindFirstChild(parent);
for( ; i != dir_tab.ParentEnd() ; i = dir_tab.NextParent(i) )
for( ; i != dir_tab.ParentEnd() ; i = dir_tab.NextChild(i) )
childs_tab.push_back( &(*i->second) );
return true;
}
DirContainer::ParentIterator Dirs::FindFirstParent(long parent_id)
DirContainer::ParentIterator Dirs::FindFirstChild(long parent_id)
{
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent_id);
DirContainer::ParentIterator i = dir_tab.FindFirstChild(parent_id);
return i;
}
DirContainer::ParentIterator Dirs::NextParent(DirContainer::ParentIterator i)
DirContainer::ParentIterator Dirs::NextChild(DirContainer::ParentIterator i)
{
return dir_tab.NextParent(i);
return dir_tab.NextChild(i);
}
@ -162,11 +161,14 @@ DirContainer::ParentIterator Dirs::ParentEnd()
// albo tutaj stringa nie czyscic?
// O(m * log n) (m- how many parts are in 'id')
// path with a slash at the end
bool Dirs::MakePath(long id, std::wstring & path)
bool Dirs::MakePath(long id, std::wstring & path, bool clear_path)
{
DirContainer::Iterator i;
path = '/';
if( clear_path )
path.clear();
temp_path = '/';
while( true )
{
@ -174,16 +176,21 @@ DirContainer::Iterator i;
if( i == dir_tab.End() ||
i->parent_id == id ) // means a loop (something wrong in the db)
{
// we don't change path if there is no such a directory
return false;
}
if( i->parent_id == -1 )
{
path += temp_path;
return true;
}
id = i->parent_id;
path.insert(0, i->url);
path.insert(path.begin(), '/');
temp_path.insert(0, i->url);
temp_path.insert(temp_path.begin(), '/');
}
}
@ -220,6 +227,33 @@ DirContainer::Iterator i;
bool Dirs::CreateDirTab(long dir_id, std::vector<Item*> & out_dir_tab)
{
DirContainer::Iterator i;
out_dir_tab.clear();
do
{
i = dir_tab.FindId(dir_id);
if( i == dir_tab.End() )
return false;
if( out_dir_tab.empty() )
out_dir_tab.insert(out_dir_tab.end(), &(*i)); // !! I am not sure whether begin() can be used on an empty container
else
out_dir_tab.insert(out_dir_tab.begin(), &(*i));
dir_id = i->parent_id;
}
while( dir_id != -1 );
return true;
}
Item * Dirs::GetRootDir()
{
DirContainer::Iterator root = dir_tab.GetRoot();
@ -255,9 +289,9 @@ return &(*etc);
Item * Dirs::GetDir(const std::wstring & name, long parent)
{
DirContainer::ParentIterator i = dir_tab.FindFirstParent(parent);
DirContainer::ParentIterator i = dir_tab.FindFirstChild(parent);
for( ; i!=dir_tab.ParentEnd() ; i = dir_tab.NextParent(i) )
for( ; i!=dir_tab.ParentEnd() ; i = dir_tab.NextChild(i) )
if( i->second->url == name )
return &(*i->second);
@ -276,7 +310,7 @@ Item * Dirs::GetDir(const std::wstring & path)
Item * pitem = &(*root);
std::wstring name;
std::wstring name; // !! dodac jako skladowa klasy
const wchar_t * s = path.c_str();
while( ExtractName(s, name) )
@ -287,7 +321,6 @@ Item * Dirs::GetDir(const std::wstring & path)
return 0;
}
return pitem;
}
@ -392,6 +425,135 @@ return 0;
// current_dir_tab can be the same container as out_dir_tab
void Dirs::CopyDirTab(const std::vector<Item*> & in, std::vector<Item*> & out)
{
if( &in != &out )
{
out.resize(in.size());
for(size_t i=0 ; i<in.size() ; ++i)
out[i] = in[i];
}
}
size_t Dirs::AnalyzeDir(std::vector<Item*> & dir_tab, const std::wstring & link_to)
{
if( dir_tab.empty() )
return 0;
size_t i = 0;
size_t old_i;
while( true )
{
// skipping slashes
for( ; i<link_to.size() && link_to[i] == '/' ; ++i);
if( i == link_to.size() )
return i; // end of the path
// creating a name
old_i = i;
analyze_temp.clear();
for( ; i<link_to.size() && link_to[i] != '/' ; ++i)
analyze_temp += link_to[i];
Item * pdir = GetDir(analyze_temp, dir_tab.back()->id);
if( !pdir )
return old_i; // analyze_temp is not a directory
dir_tab.push_back(pdir);
}
}
int Dirs::FollowLink(std::vector<Item*> & dir_tab, const std::wstring & link_to, std::wstring & out_item)
{
size_t i = AnalyzeDir(dir_tab, link_to);
if( i < link_to.size() )
{
// checking if at least one slash has left
for(size_t a=i ; a < link_to.size() ; ++a)
if( link_to[a] == '/' )
return 2; // there is not such a directory
// the rest of the path is a file name
out_item = link_to.c_str() + i;
return 1;
}
return 0;
}
/*
return codes:
ok:
0 - the link_to is a path to a directory (out_item skipped, out_dir_tab will not be empty)
1 - the link_to is a path to a file (out_item is used, out_dir_tab will not be empty)
error:
2 - incorrect link_to
3 - there is not a root dir
4 - current_dir_tab was empty
current_dir_tab can be the same container as out_dir_tab
link_to can be a relative path (without the first slash)
*/
int Dirs::FollowLink(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, std::wstring & out_item)
{
temp_link_to = link_to; // link_to can be from the out_item and would be cleared next
out_item.clear();
if( current_dir_tab.empty() )
return 4;
if( temp_link_to.empty() )
{
CopyDirTab(current_dir_tab, out_dir_tab);
return 0;
}
if( temp_link_to[0] == '/' )
{
// temp_link_to is an absolute path
Item * pdir = GetRootDir();
if( !pdir )
return 3;
out_dir_tab.clear();
out_dir_tab.push_back(pdir);
}
else
{
// temp_link_to is a relative path
CopyDirTab(current_dir_tab, out_dir_tab);
}
return FollowLink(out_dir_tab, temp_link_to, out_item);
}
void Dirs::SplitPath(const std::wstring & path, std::wstring & dir, std::wstring & file)
{
@ -483,5 +645,15 @@ return var;
}
// printing first and last slash
void Dirs::LogDir(const std::vector<Item*> & dir_tab)
{
log << '/';
// skipping the first (root) directory
for(size_t i=1 ; i<dir_tab.size() ; ++i)
log << dir_tab[i]->url << '/';
}

View File

@ -39,16 +39,24 @@ 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_tab); // !! zamienic na GetChilds()
bool MakePath(long dir_id, std::wstring & path);
bool MakePath(long dir_id, std::wstring & path, bool clear_path = true);
bool ChangeParent(long dir_id, long new_parent_id);
bool HasParent(long dir_id, long parent_id);
bool DelDir(long dir_id);
bool CreateDirTab(long dir_id, std::vector<Item*> & out_dir_tab);
void LogDir(const std::vector<Item*> & dir_tab);
int AnalyzePath(const std::wstring & path, long & dir_id, std::wstring & dir, std::wstring & file);
int FollowLink(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, std::wstring & out_item);
static void SplitPath(const std::wstring & path, std::wstring & dir, std::wstring & file);
DirContainer::ParentIterator FindFirstParent(long parent_id); // !! zmienic w koncu nazwe na FindFirstChild
DirContainer::ParentIterator NextParent(DirContainer::ParentIterator i);
DirContainer::ParentIterator FindFirstChild(long parent_id); // !! zmienic w koncu nazwe na FindFirstChild
DirContainer::ParentIterator NextChild(DirContainer::ParentIterator i);
DirContainer::ParentIterator ParentEnd();
@ -76,10 +84,16 @@ private:
Notify * notify;
DirContainer dir_tab;
std::wstring temp_path;
std::wstring temp_link_to;
size_t AnalyzeDir(Item * pdir, const std::wstring & path, long & dir_id, std::wstring & dir);
size_t AnalyzeDir(std::vector<Item*> & dir_tab, const std::wstring & link_to);
std::wstring analyze_temp;
void CopyDirTab(const std::vector<Item*> & in, std::vector<Item*> & out);
int FollowLink(std::vector<Item*> & dir_tab, const std::wstring & link_to, std::wstring & out_item);
bool ExtractName(const wchar_t * & s, std::wstring & name);
bool HasReadExecAccessForRoot(const Item & item);

View File

@ -55,7 +55,6 @@
#define WINIX_DIFFERENT_MOUNT_POINTS 29
#define WINIX_ERR_DB_FATAL_ERROR_DURING_CONNECTING 100
#define WINIX_ERR_DB_INCORRECT_QUERY 101
#define WINIX_ERR_DB_INCORRENT_RESULT_STATUS 102
@ -70,6 +69,8 @@
//#define WINIX_ERR_UNKNOWN 1000
#define WINIX_NOTHING_TO_DO 109
typedef int Error;

View File

@ -44,15 +44,19 @@ void Item::Clear()
subject.clear();
content.clear();
modify_index = 0;
url.clear();
content_type = ct_formatted_text;
type = none;
parent_id = -1;
default_item = -1;
link_to.clear();
link_redirect = false;
content_id = -1;
ref = 1;
file_path.clear();
file_fs = -1;

View File

@ -19,6 +19,8 @@
#define WINIX_ITEM_FILETYPE_UNKNOWN 3
struct Item
{
long id;
@ -38,8 +40,9 @@ tm date_modification;
std::wstring subject;
std::wstring content;
long content_id; // used by the database
std::wstring url;
int modify_index;
enum ContentType
{
@ -58,22 +61,24 @@ enum Type
{
dir = 0,
file = 1,
symlink = 2,
none = 1000 // !! pozbyc sie tego
none = 1000
};
Type type;
long default_item;
// used when type is symlink or to a directory too (function 'default')
std::wstring link_to;
int link_redirect;
// static file (if exists)
std::wstring file_path; // relative file path
int file_fs; // file system type where the file was saved
int file_type; // file type (none, image, doc, etc)
bool has_thumb;
@ -86,6 +91,14 @@ std::wstring html_template;
void SetDateModifyToNow();
void Clear();
private:
// used by the database
long content_id; // content id in 'content' table
int ref; // content references
friend class Db;
friend class DbItemColumns;
};

View File

@ -15,21 +15,29 @@
Log::Log()
{
log_level = 3;
current_level = 4; // nothing to log (call Init() first)
item = 0;
item_save = 1;
log_level = 1;
current_level = 100; // nothing to log (call Init() first)
request = 0;
max_requests = 1;
lines = 0;
max_lines = 5000;
log_file_open = false;
}
void Log::Init(int log_l, const std::string & log_f, bool log_std, int log_request)
Log::~Log()
{
log_level = log_l;
log_file = log_f;
log_stdout = log_std;
item_save = log_request;
SaveLogAndClear();
}
void Log::Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests)
{
log_level = log_level_;
log_file = log_file_;
log_stdout = log_std;
max_requests = log_max_requests;
save_each_line = save_each_line_;
// don't open the file here
// because it would be created with the root as an owner
@ -67,6 +75,9 @@ void Log::PutDate(Manipulators m)
Log & Log::operator<<(const void * s)
{
if( current_level > log_level )
return *this;
buffer << s;
return *this;
}
@ -75,6 +86,9 @@ Log & Log::operator<<(const void * s)
Log & Log::operator<<(const char * s)
{
if( current_level > log_level )
return *this;
if( !s )
return *this;
@ -87,7 +101,10 @@ return *this;
Log & Log::operator<<(const std::string & s)
{
buffer << s;
if( current_level > log_level )
return *this;
buffer << s;
return *this;
}
@ -95,7 +112,10 @@ Log & Log::operator<<(const std::string & s)
Log & Log::operator<<(const std::string * s)
{
buffer << *s;
if( current_level > log_level )
return *this;
buffer << *s;
return *this;
}
@ -106,10 +126,11 @@ Log & Log::operator<<(const std::string * s)
Log & Log::operator<<(const wchar_t * s)
{
if( !s )
return *this;
buffer << s;
if( current_level <= log_level )
{
if( s )
buffer << s;
}
return *this;
}
@ -118,7 +139,11 @@ return *this;
Log & Log::operator<<(const std::wstring & s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -126,7 +151,11 @@ Log & Log::operator<<(const std::wstring & s)
Log & Log::operator<<(const std::wstring * s)
{
buffer << *s;
if( current_level <= log_level )
{
buffer << *s;
}
return *this;
}
@ -136,7 +165,11 @@ Log & Log::operator<<(const std::wstring * s)
Log & Log::operator<<(int s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -144,7 +177,11 @@ Log & Log::operator<<(int s)
Log & Log::operator<<(long s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -153,7 +190,11 @@ Log & Log::operator<<(long s)
Log & Log::operator<<(char s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -161,7 +202,11 @@ Log & Log::operator<<(char s)
Log & Log::operator<<(size_t s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -169,7 +214,11 @@ Log & Log::operator<<(size_t s)
Log & Log::operator<<(double s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@ -180,36 +229,23 @@ Log & Log::operator<<(Manipulators m)
switch(m)
{
case logend:
buffer << '\n';
lines += 1;
//if( lines > 3000 )
if( current_level <= log_level )
{
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
buffer << '\n';
lines += 1;
if( save_each_line )
SaveLogAndClear();
}
break;
case logsavenow:
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
break;
case logsave:
item += 1;
SaveLogAndClear();
break;
if( item >= item_save || lines > 3000 )
{
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
}
case logendrequest:
if( ++request >= max_requests || lines > max_lines )
SaveLogAndClear();
break;
case log1:
@ -223,6 +259,10 @@ Log & Log::operator<<(Manipulators m)
case log3:
current_level = 3;
break;
case log4:
current_level = 4;
break;
}
return *this;
@ -240,12 +280,18 @@ void Log::SystemErr(int err)
}
void Log::SaveLogAndClear()
{
SaveLog();
buffer.Clear();
request = 0;
lines = 0;
}
void Log::SaveLog()
{
if( current_level > log_level )
return;
if( buffer.Str().empty() )
return;

View File

@ -18,19 +18,24 @@
#include "textstream.h"
// !! dodac manipulator logsave, logi zostana zapisane pod koniec wykonywania jednego requesta (albo po kilku w zaleznosci od jakiejs opcji w konfigu)
// logsave zostanie wywolane w requestcontroller.cpp przy konczeniu wykonywania requesta
enum Manipulators { logsave, logsavenow, logend, log1, log2, log3 };
// log1 - the first level
// log2
// log3
// log4 - the last level (debug level)
// logend - the end of a line
// logendrequest - end of a current request
// logsave - current log buffer is saved and cleared
enum Manipulators { log1, log2, log3, log4, logend, logendrequest, logsave };
class Log
{
public:
Log();
void Init(int log_l, const std::string & log_f, bool log_std, int log_request);
~Log();
void Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests);
void PutDate(Manipulators m);
Log & operator<<(const void * s);
@ -49,17 +54,46 @@ public:
void SystemErr(int err);
void SaveLog();
void SaveLogAndClear();
private:
// buffer for the log
TextStream<std::wstring> buffer;
int log_level, current_level;
int item, item_save;
// log lovel from the config file
int log_level;
// current level set by a modifier (e.g. log << log3)
int current_level;
// current request for logging
// starts from zero and incremented after logendrequest modifier
int request;
// how many request to save at once
int max_requests;
// file log
std::string log_file;
bool log_stdout;
std::ofstream file;
// logging to stdout
bool log_stdout;
// how many lines there are in the buffer
int lines;
// is the config file already open
bool log_file_open;
// how many lines can be in the config buffer
// default: 5000
int max_lines;
// whether to save each line (for debug)
bool save_each_line;
void OpenFile();
};

View File

@ -860,6 +860,11 @@ return WINIX_ITEM_FILETYPE_UNKNOWN;
}
int SelectFileType(const std::wstring & file_name)
{
return SelectFileType(file_name.c_str());
}
time_t Time(const tm & par)
{
@ -904,3 +909,46 @@ tm Time(time_t par)
return res;
}
void UrlEncode(const std::string & in, std::string & out, bool clear_out)
{
char buffer[10];
if( clear_out )
out.clear();
for(size_t i=0 ; i<in.size() ; ++i)
{
if( (in[i] >= 'a' && in[i] <= 'z') ||
(in[i] >= 'A' && in[i] <= 'Z') ||
(in[i] >= '0' && in[i] <= '9') ||
in[i] == '.' || in[i] == ',' || in[i] == '/' || in[i] == ':' || in[i] == '#' ||
in[i] == '-' || in[i] == '_' || in[i] == '(' || in[i] == ')' )
{
out += in[i];
}
else
{
Toa(static_cast<unsigned char>(in[i]), buffer, 10, 16);
out += '%';
if( buffer[1] == 0 )
out += '0'; // there is only one characters in the buffer
out += buffer;
}
}
}
void UrlEncode(const std::wstring & in, std::string & out, bool clear_out)
{
static std::string ain;
Ezc::WideToUTF8(in, ain);
UrlEncode(ain, out, clear_out);
}

View File

@ -415,9 +415,16 @@ bool RenameFile(const std::wstring & from, const std::wstring & to);
const wchar_t * GetFileExt(const wchar_t * name);
int SelectFileType(const wchar_t * file_name);
int SelectFileType(const std::wstring & file_name);
time_t Time(const tm & par);
time_t Time(const tm * par);
tm Time(time_t par);
void UrlEncode(const std::string & in, std::string & out, bool clear_out = true);
void UrlEncode(const std::wstring & in, std::string & out, bool clear_out = true);
#endif

View File

@ -232,6 +232,9 @@ void Mounts::MountCmsForRoot()
log << log1 << "M: there is no a root dir" << logend;
}
mount.param.resize(mount_par_tab.size());
mount.ClearParams();
std::pair<MountTab::iterator, bool> res = mount_tab.insert( std::make_pair(mount.dir_id, mount) );
pmount = &(res.first->second);
}

View File

@ -168,7 +168,7 @@ void * Plugin::LoadInitFun(const char * filename, Fun1 & fun_init)
return 0;
}
log << log1 << "Plugin: plugin loaded"
log << log2 << "Plugin: plugin loaded"
<< ", file: " << filename
<< ", index: " << plugins.size() << logend;
@ -258,7 +258,7 @@ void Plugin::Call(int message, Slots::iterator & slot)
if( !slot->second.is_running )
{
if( config->log_plugin_call )
log << log3 << "Plugin: calling plugin id: " << slot->second.index << ", message: " << message << logend;
log << log1 << "Plugin: calling plugin id: " << slot->second.index << ", message: " << message << logend;
slot->second.is_running = true;
@ -271,7 +271,7 @@ void Plugin::Call(int message, Slots::iterator & slot)
slot->second.is_running = false;
if( config->log_plugin_call )
log << log3 << "Plugin: returning from plugin id: " << slot->second.index << ", message: " << message << logend;
log << log1 << "Plugin: returning from plugin id: " << slot->second.index << ", message: " << message << logend;
}
else

View File

@ -483,7 +483,7 @@ size_t buf_len = sizeof(buf)/sizeof(wchar_t);
return;
}
swprintf(buf, buf_len, L"%ls/tmp/winix_%u_%d_%u", config->upload_dir.c_str(), (unsigned)getpid(), tmp_filename_postfix, rand());
swprintf(buf, buf_len, L"%ls/tmp/pmp_%u_%d_%u", config->upload_dir.c_str(), (unsigned)getpid(), tmp_filename_postfix, rand());
tmp_filename_postfix += 1;
tmp_filename = buf;

View File

@ -11,6 +11,7 @@
#include "misc.h"
#include "error.h"
#include "templates/templates.h"
#include "functions/functionbase.h"
@ -69,8 +70,9 @@ void System::Init()
notify.Init();
thumb.SetSynchro(synchro);
thumb.SetConvertCmd(config->convert_cmd);
thumb.SetDb(db);
thumb.SetConfig(config);
thumb.SetSystem(this);
}
@ -83,16 +85,13 @@ void System::RedirectTo(const Item & item, const wchar_t * postfix)
if( item.type == Item::dir )
{
// item_id is pointing to a directory
dirs.MakePath(item.id, path);
request->redirect_to += path;
dirs.MakePath(item.id, request->redirect_to, false);
}
else
{
if( !dirs.MakePath(item.parent_id, path) )
log << log1 << "Content: Can't redirect: no dirs for item id: " << item.id << logend;
request->redirect_to += path;
request->redirect_to += item.url;
// item_id is pointing to a file or a symlink
if( dirs.MakePath(item.parent_id, request->redirect_to, false) )
request->redirect_to += item.url;
}
if( postfix )
@ -103,37 +102,32 @@ void System::RedirectTo(const Item & item, const wchar_t * postfix)
void System::RedirectTo(long item_id, const wchar_t * postfix)
{
Item * pdir;
request->redirect_to = config->base_url;
pdir = dirs.GetDir(item_id);
Item * pdir = dirs.GetDir(item_id);
if( pdir )
{
// item_id is pointing to a directory
dirs.MakePath(pdir->id, path);
request->redirect_to += path;
dirs.MakePath(pdir->id, request->redirect_to, false);
}
else
{
// !! zrobic nowy interfejs
// !! GetItem pozamieniac na GetFile
// !! i nie uzywac request->item_tab (zrobic sobie lokalny tutaj)
db->GetItem(request->item_tab, item_id);
if( !request->item_tab.empty() )
// item_id is pointing to a file
DbItemQuery iq;
iq.SetAllSel(false);
iq.WhereId(item_id);
iq.sel_parent_id = true;
iq.sel_url = true;
if( db->GetItem(item_temp, iq) == WINIX_ERR_OK )
{
if( !dirs.MakePath(request->item_tab[0].parent_id, path) )
log << log1 << "Content: Can't redirect: no dirs for item id: "
<< request->item_tab[0].id << ", requested directory id: "
<< request->item_tab[0].parent_id << logend;
request->redirect_to += path + request->item_tab[0].url;
if( dirs.MakePath(item_temp.parent_id, request->redirect_to, false) )
request->redirect_to += item_temp.url;
}
else
{
log << log1 << "Content: Can't redirect: no such item: id: " << item_id << logend;
log << log1 << "System: can't redirect: no such item: id: " << item_id << logend;
}
}
@ -142,6 +136,66 @@ Item * pdir;
}
void System::RedirectTo(const std::wstring & url)
{
request->redirect_to = config->base_url;
if( !url.empty() && url[0] == '/' )
{
// absolute path
request->redirect_to += url;
}
else
{
// relative path
if( !request->dir_tab.empty() )
{
if( dirs.MakePath(request->dir_tab.back()->id, request->redirect_to, false) )
request->redirect_to += url;
}
else
{
request->redirect_to += '/';
request->redirect_to += url;
}
}
}
void System::AddParams(const ParamTab & param_tab, std::wstring & str, bool clear_str)
{
if( clear_str )
str.clear();
for(size_t i=0 ; i<param_tab.size() ; ++i)
{
str += '/';
str += param_tab[i].name;
if( !param_tab[i].value.empty() )
{
str += ':';
str += param_tab[i].value;
}
}
}
void System::RedirectWithFunctionAndParamsTo(const std::wstring & url)
{
RedirectTo(url);
if( !request->function )
return;
request->redirect_to += '/';
request->redirect_to += request->function->fun.url;
AddParams(request->param_tab, request->redirect_to, false);
}
void System::RedirectToLastDir()
{
if( !request->dir_tab.empty() )
@ -319,13 +373,11 @@ bool System::HasReadExecAccessToPath(long dir_id)
}
bool System::DirsHaveReadExecPerm()
bool System::HasReadExecAccessToPath(const std::vector<Item*> & dir_tab)
{
std::vector<Item*>::iterator i;
for(i = request->dir_tab.begin() ; i!=request->dir_tab.end() ; ++i)
for(size_t i=0 ; i < dir_tab.size() ; ++i)
{
if( !HasReadExecAccess(**i) )
if( !HasReadExecAccess(*dir_tab[i]) )
return false;
}
@ -333,6 +385,12 @@ return true;
}
bool System::DirsHaveReadExecPerm()
{
return HasReadExecAccessToPath(request->dir_tab);
}
// if we don't have access we only remove the item from the table
void System::CheckAccessToItems(std::vector<Item> & item_tab)
{
@ -488,7 +546,7 @@ return res;
}
// making a global file path
// making a global file path (in the unix file system)
// you should call CreateNewFile before
bool System::MakeFilePath(const Item & item, std::wstring & path, bool thumb, bool create_dir, int chmod)
{
@ -530,12 +588,36 @@ return true;
}
// item can be a directory, file or a symlink
// if item is a directory then the path will be with a slash at the end
bool System::MakePath(const Item & item, std::wstring & path, bool clear_path)
{
bool res;
if( clear_path )
path.clear();
if( item.type == Item::dir )
{
res = dirs.MakePath(item.id, path);
}
else
{
res = dirs.MakePath(item.parent_id, path);
if( res )
path += item.url;
}
return res;
}
Error System::AddFile(Item & item, int notify_code)
{
if( item.type == Item::dir )
if( item.type != Item::file )
return WINIX_ERR_FILE_EXPECTED;
Error status = db->AddItem(item);
@ -557,7 +639,7 @@ return status;
Error System::EditFile(Item & item, bool with_url, int notify_code)
{
if( item.type == Item::dir )
if( item.type != Item::file )
return WINIX_ERR_FILE_EXPECTED;
if( request->session && request->session->puser )
@ -613,3 +695,270 @@ tm System::LocalTime(const tm & ptm)
{
return LocalTime(&ptm);
}
/*
return codes:
ok:
0 - the link_to is a path to a directory (out_item skipped, out_dir_tab will not be empty)
1 - the link_to is a path to a file or a symlink (out_item is used, out_dir_tab will not be empty)
error:
2 - incorrect link_to
3 - there is not a root dir
4 - current_dir_tab was empty
current_dir_tab can be the same container as out_dir_tab
link_to can be a relative path (without the first slash)
*/
int System::FollowLink(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item)
{
link_to_temp = link_to; // copy the link because it can be from out_item (and will be cleared)
out_item.Clear();
int res = dirs.FollowLink(current_dir_tab, link_to_temp, out_dir_tab, name_temp);
if( res == 1 )
{
if( db->GetItem(out_dir_tab.back()->id, name_temp, out_item) == WINIX_ERR_OK )
return 1;
else
return 2;
}
return res;
}
bool System::FollowAllLinksDirFound(std::vector<Item*> & out_dir_tab,
bool follow_dir_default, bool stop_on_link_redirect, bool check_access)
{
log << log3 << "System: link to a directory: ";
dirs.LogDir(out_dir_tab);
log << logend;
if( check_access && !HasReadExecAccessToPath(out_dir_tab) )
{
log << log1 << "System: no access to the directory structure" << logend;
return false;
}
if( !out_dir_tab.back()->link_to.empty() )
{
if( follow_dir_default )
{
if( !(stop_on_link_redirect && out_dir_tab.back()->link_redirect==1) )
link_to_temp = out_dir_tab.back()->link_to;
}
}
return true;
}
bool System::FollowAllLinksFileOrSymlinkFound(std::vector<Item*> & out_dir_tab, Item & out_item,
bool stop_on_link_redirect, bool check_access)
{
if( out_item.type == Item::symlink )
log << log3 << "System: link to a symlink: ";
else
log << log3 << "System: link to a file: ";
dirs.LogDir(out_dir_tab);
log << out_item.url << logend;
if( check_access && !HasReadExecAccessToPath(out_dir_tab) )
{
log << log1 << "System: no access to the directory structure" << logend;
return false;
}
if( out_item.type == Item::symlink )
{
if( out_item.link_to.empty() )
{
log << log1 << "System: symlink empty" << logend;
return false;
}
else
{
if( !check_access || HasReadAccess(out_item) )
{
if( !(stop_on_link_redirect && out_item.link_redirect==1) )
link_to_temp = out_item.link_to;
}
else
{
log << log1 << "System: no read access to the symlink" << logend;
return false;
}
}
}
return true;
}
/*
return codes:
ok:
0 - the link_to is a path to a directory (out_item skipped, out_dir_tab will not be empty)
1 - the link_to is a path to a file (out_item is used, out_dir_tab will not be empty)
(link_to can be a path to a symlink if stop_on_link_redirect is true)
error:
2 - incorrect link_to
3 - there is not a root dir
4 - current_dir_tab was empty
5 - limit of symlinks exceeded
6 - permission denied to a file/symlink or a directory (or a symlink is empty)
current_dir_tab can be the same container as out_dir_tab
link_to can be a relative path (without the first slash)
if follow_dir_default is true then directories with 'default' flags are followed as well
if stop_on_link_redirect is true then the method stops on a symbolic link (or a directory
with 'default' flag set) where the redirection should be done, you should check then whether
the out_item.back()->link_to is not empty (if the result was 0 ) or
whether out_item.type is symlink (if the result was 1)
to make the redirection
*/
int System::FollowAllLinks(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item,
bool follow_dir_default, bool stop_on_link_redirect, bool check_access)
{
int res;
size_t level = 0;
link_to_temp = link_to;
if( current_dir_tab.empty() )
return 4;
do
{
if( ++level > config->symlinks_follow_max )
{
log << log1 << "System: the number of maximum symlinks exceeded ("
<< config->symlinks_follow_max << ")" << logend;
res = 5;
}
else
{
res = FollowLink(current_dir_tab, link_to_temp, out_dir_tab, out_item);
link_to_temp.clear();
if( res == 0 )
{
out_item.Clear();
res = FollowAllLinksDirFound(out_dir_tab, follow_dir_default, stop_on_link_redirect, check_access) ? 0 : 6;
}
else
if( res == 1 )
{
res = FollowAllLinksFileOrSymlinkFound(out_dir_tab, out_item, stop_on_link_redirect, check_access) ? 1 : 6;
}
else
{
log << log2 << "System: incorrect link: " << link_to << logend;
}
}
}
while( !link_to_temp.empty() );
return res;
}
// the same as FollowAllLinks but starts from the root directory
// link_to must begin with a slash (or can be empty then the root directory is returned)
int System::FollowAllLinks(const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item,
bool follow_dir_default, bool stop_on_link_redirect, bool check_access)
{
if( !link_to.empty() && link_to[0] != '/' )
return 2;
if( root_follow_dir_tab.size() != 1 )
root_follow_dir_tab.resize(1);
Item * root_dir = dirs.GetRootDir();
if( !root_dir )
return 3;
root_follow_dir_tab[0] = root_dir;
return FollowAllLinks(root_follow_dir_tab, link_to,
out_dir_tab, out_item, follow_dir_default, stop_on_link_redirect, check_access);
}
// the same as FollowAllLinks but operates on request->dir_tab and request->item
// and returns bool
// the method is making a redirection if needed
bool System::FollowAllLinks(const std::wstring & link_to,
bool follow_dir_default, bool stop_on_link_redirect, bool check_access)
{
int res = FollowAllLinks(request->dir_tab, link_to, temp_follow_dir_tab, temp_follow_item,
follow_dir_default, stop_on_link_redirect, check_access);
bool ok = (res == 0 || res == 1);
if( ok )
{
request->dir_tab = temp_follow_dir_tab;
if( res == 0 )
{
request->is_item = false;
request->item.Clear();
request->last_item = request->dir_tab.back();
if( !request->dir_tab.back()->link_to.empty() )
RedirectTo(request->dir_tab.back()->link_to);
log << log3 << "System: current directory changed" << logend;
}
else
{
request->is_item = true;
request->item = temp_follow_item;
request->last_item = &request->item;
if( request->item.type == Item::symlink )
RedirectTo(request->item.link_to); // request->item.link_to is not empty
log << log3 << "System: current directory changed and the new file loaded" << logend;
}
mounts.CalcCurMount();
}
else
{
if( res == 5 || res == 6 )
request->status = WINIX_ERR_PERMISSION_DENIED;
else
request->status = WINIX_ERR_NO_ITEM;
}
return ok;
}

View File

@ -66,8 +66,12 @@ public:
void SetSynchro(Synchro * psynchro);
void Init();
void AddParams(const ParamTab & param_tab, std::wstring & str, bool clear_str = true);
void RedirectTo(const Item & item, const wchar_t * postfix = 0);
void RedirectTo(long item_id, const wchar_t * postfix = 0);
void RedirectTo(const std::wstring & url);
void RedirectWithFunctionAndParamsTo(const std::wstring & url);
void RedirectToLastDir();
void RedirectToLastItem(); // redirect to an item if exists or to the last directory
@ -80,6 +84,7 @@ public:
bool HasReadWriteAccess(const Item & item);
bool HasReadExecAccess(const Item & item);
bool HasReadExecAccessToPath(long dir_id);
bool HasReadExecAccessToPath(const std::vector<Item*> & dir_tab);
bool DirsHaveReadExecPerm();
void CheckAccessToItems(std::vector<Item> & item_tab);
@ -93,6 +98,8 @@ public:
bool CreateNewFile(Item & item);
bool MakeFilePath(const Item & item, std::wstring & path, bool thumb = false, bool create_dir = false, int chmod = 0755);
bool MakePath(const Item & item, std::wstring & path, bool clear_path = true);
Error AddFile(Item & item, int notify_code = 0);
Error EditFile(Item & item, bool with_url = true, int notify_code = 0);
@ -101,7 +108,21 @@ public:
tm LocalTime(const tm * ptm);
tm LocalTime(const tm & ptm);
int FollowLink(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item);
int FollowAllLinks(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item,
bool follow_dir_default = false, bool stop_on_link_redirect = false, bool check_access = true);
// starting from root dir
int FollowAllLinks(const std::wstring & link_to,
std::vector<Item*> & out_dir_tab, Item & out_item,
bool follow_dir_default = false, bool stop_on_link_redirect = false, bool check_access = true);
// using request->dir_tab and request->item
bool FollowAllLinks(const std::wstring & link_to,
bool follow_dir_default = false, bool stop_on_link_redirect = false, bool check_access = true);
private:
Request * request;
@ -109,10 +130,22 @@ private:
Db * db;
Synchro * synchro;
std::wstring path;
Item item_temp;
std::wstring link_to_temp, name_temp;
// for FollowAllLinks
std::vector<Item*> temp_follow_dir_tab;
std::vector<Item*> root_follow_dir_tab;
Item temp_follow_item;
bool CreateNewFileSimpleFs(Item & item);
bool CreateNewFileHashFs(Item & item);
bool FollowAllLinksDirFound(std::vector<Item*> & out_dir_tab,
bool follow_dir_default, bool stop_on_link_redirect, bool check_access);
bool FollowAllLinksFileOrSymlinkFound(std::vector<Item*> & out_dir_tab, Item & out_item,
bool stop_on_link_redirect, bool check_access);
};

View File

@ -2,24 +2,30 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2009, Tomasz Sowa
* Copyright (c) 2009-2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucorecorethread
#define headerfilecmslucorecorethread
#ifndef headerfile_winix_plugins_thread_thread
#define headerfile_winix_plugins_thread_thread
#include <string>
namespace Thread
{
class Thread
{
public:
long id;
long parent_id;
long file_id;
//long parent_id;
long dir_id;
bool closed;
@ -50,4 +56,10 @@ public:
};
} // namespace
#endif

View File

@ -7,17 +7,14 @@
*
*/
#include <ctime>
#include "thumb.h"
#include "utf8.h"
#include "log.h"
#include "system.h"
void Thumb::SetConvertCmd(const std::wstring & cmd)
{
convert_cmd = cmd;
}
void Thumb::SetDb(Db * pdb)
{
@ -25,12 +22,22 @@ void Thumb::SetDb(Db * pdb)
}
// first thread (objects locked)
void Thumb::CreateThumb(long item_id, const std::wstring & source, const std::wstring & dst, size_t cx, size_t cy, int aspect_mode)
void Thumb::SetConfig(Config * pconfig)
{
item_temp.item_id = item_id;
item_temp.source = source;
item_temp.dst = dst;
config = pconfig;
}
void Thumb::SetSystem(System * psystem)
{
system = psystem;
}
// first thread (objects locked)
void Thumb::CreateThumb(const Item & item, size_t cx, size_t cy, int aspect_mode)
{
item_temp.file = item;
item_temp.cx = cx;
item_temp.cy = cy;
item_temp.aspect_mode = aspect_mode;
@ -155,33 +162,107 @@ void Thumb::SelectAspect()
}
// second thread (objects are not locked)
void Thumb::CreateThumbnail()
{
command.Clear();
Ezc::WideToUTF8(convert_cmd, tempa);
// second thread (objects are not locked)
bool Thumb::CreateCommand()
{
bool res;
command.Clear();
stream_tmp_path.Clear();
Lock();
Ezc::WideToUTF8(config->convert_cmd, tempa);
command << tempa << " -quiet -strip -thumbnail ";
SelectAspect();
command << " ";
Ezc::WideToUTF8(item_work.source, tempa);
EscapePath(tempa);
Ezc::WideToUTF8(item_work.dst, tempa);
EscapePath(tempa);
if( system(command.CStr()) == 0 )
if( system->MakeFilePath(item_work.file, src_path) )
{
Lock();
log << log3 << "Thumb: created a thumbnail: " << tempa << logend;
db->EditHasThumbById(true, item_work.item_id);
Unlock();
Ezc::WideToUTF8(src_path, tempa);
EscapePath(tempa);
stream_tmp_path << config->upload_dir << L"/tmp/thumb_" << std::time(0);
Ezc::WideToUTF8(stream_tmp_path.Str(), string_tmp_patha);
EscapePath(string_tmp_patha);
res = true;
}
else
{
log << log1 << "Thumb: cannot create a source path" << logend;
res = false;
}
Unlock();
return res;
}
// second thread (objects are not locked)
void Thumb::SaveTmpThumbnail()
{
bool moved = false;
Lock();
// the file could have been changed especially when creating thumbnail lasted too long
iq.SetAll(false, false);
iq.sel_parent_id = true;
iq.sel_file = true;
iq.sel_url = true;
iq.sel_type = true;
iq.WhereId(item_work.file.id);
if( db->GetItem(item_work.file, iq) == WINIX_ERR_OK )
{
if( system->MakeFilePath(item_work.file, dst_path, true, true, config->upload_dirs_chmod) )
{
if( RenameFile(stream_tmp_path.Str(), dst_path) )
{
log << log3 << "Thumb: created a thumbnail: " << dst_path << logend;
db->EditHasThumbById(true, item_work.file.id);
moved = true;
}
else
{
log << log1 << "Thumb: cannot move a temporary file: " << stream_tmp_path.Str() << ", to: " << dst_path << logend;
}
}
else
{
log << log1 << "Thumb: cannot create a destination path" << logend;
}
}
if( !moved )
::RemoveFile(stream_tmp_path.Str());
Unlock();
}
// second thread (objects are not locked)
void Thumb::CreateThumbnail()
{
if( !CreateCommand() )
return;
int res = std::system(command.CStr());
if( res == 0 )
{
SaveTmpThumbnail();
}
else
{
Lock();
log << log3 << "Thumb: some problems with creating a thumbnail: " << tempa << logend;
log << log3 << "Thumb: some problems with creating a thumbnail " << tempa
<< ", 'convert' process returned: " << res << logend;
Unlock();
}
}

View File

@ -10,11 +10,16 @@
#ifndef headerfilecmslucorethumb
#define headerfilecmslucorethumb
#include "basethread.h"
#include <string>
#include <list>
#include "basethread.h"
#include "textstream.h"
#include "db/db.h"
#include "core/item.h"
#include "core/config.h"
class System;
@ -46,21 +51,21 @@ class Thumb : public BaseThread
{
public:
void CreateThumb(long item_id, const std::wstring & source, const std::wstring & dst,
size_t cx, size_t cy, int aspect_mode = WINIX_THUMB_MODE_2);
void CreateThumb(const Item & item, size_t cx, size_t cy, int aspect_mode);
void SetConvertCmd(const std::wstring & cmd);
void SetDb(Db * pdb);
void SetConfig(Config * pconfig);
void SetSystem(System * psystem);
private:
Db * db;
Config * config;
System * system;
struct ThumbItem
{
long item_id;
std::wstring source;
std::wstring dst;
Item file;
size_t cx;
size_t cy;
int aspect_mode;
@ -71,16 +76,18 @@ private:
ThumbTab thumb_tab;
ThumbItem item_temp;
// this is set before the second thread starts
std::wstring convert_cmd;
// only for second thread
ThumbItem item_work;
std::string tempa;
std::wstring src_path, dst_path;
std::string tempa, string_tmp_patha;
TextStream<std::string> command;
TextStream<std::wstring> stream_tmp_path;
DbItemQuery iq;
virtual bool SignalReceived();
virtual void Do();
bool CreateCommand();
void SaveTmpThumbnail();
void CreateThumbnail();
void SelectAspect();
void EscapePath(const std::string & path);

View File

@ -185,7 +185,7 @@ void UGContainer<Type>::AddIndexes(UGContainer<Type>::SizeType pos)
table_id.insert( std::make_pair(table[pos].id, pos) );
table_name.insert( std::make_pair(table[pos].name, pos) );
log << log2 << "UGCont: added indexes to: id: " << table[pos].id << ", name: " << table[pos].name << logend;
log << log4 << "UGCont: added indexes to: id: " << table[pos].id << ", name: " << table[pos].name << logend;
}
@ -193,7 +193,7 @@ void UGContainer<Type>::AddIndexes(UGContainer<Type>::SizeType pos)
template<class Type>
void UGContainer<Type>::RebuildIndexes()
{
log << log2 << "UGCont: rebuilding indexes" << logend;
log << log4 << "UGCont: rebuilding indexes" << logend;
table_id.clear();
table_name.clear();
@ -204,7 +204,7 @@ void UGContainer<Type>::RebuildIndexes()
for(i=0 ; i!=len ; ++i)
AddIndexes( i );
log << log2 << "UGCont: indexes rebuilt, table.size: " << table.size() << ", table_id.size: "
log << log4 << "UGCont: indexes rebuilt, table.size: " << table.size() << ", table_id.size: "
<< table_id.size() << ", table_name.size: " << table_name.size() << logend;
}

View File

@ -13,7 +13,7 @@
#define WINIX_VER_MAJOR 0
#define WINIX_VER_MINOR 4
#define WINIX_VER_REVISION 0
#define WINIX_VER_REVISION 5
#endif

975
db/db.cpp

File diff suppressed because it is too large Load Diff

35
db/db.h
View File

@ -48,17 +48,13 @@ public:
Error AddItem(Item & item);
Error EditItemById(Item & item, bool with_url = true);
Error EditItemByUrl(Item & item, bool with_url = true);
void CheckAllUrlSubject();
// !! nie zwracac zadnych kodow bledow?
void GetItems(std::vector<Item> & item_tab, const DbItemQuery & item_query);
void GetItems(std::vector<long> & item_tab, const DbItemQuery & item_query);
// !! pobiera tylko jeden item (cos wymyslec innego z nazwa albo argumentem)
void GetItem(std::vector<Item> & item_tab, long id);
Error GetItem(Item & item, const DbItemQuery & item_query);
bool GetPriv(Item & item, long id);
Error EditPrivById(Item & item, long id);
@ -70,7 +66,7 @@ public:
Error EditSubjectById(Item & item, long id);
bool DelItem(const Item & item);
Error DelItem(const Item & item);
void GetDirs(DirContainer & dir_tab);
void GetUsers(UGContainer<User> & user_tab);
void GetGroups(UGContainer<Group> & group_tab);
@ -80,21 +76,15 @@ public:
Error GetItemById(long item_id, Item & item);
Error GetItem(long parent_id, const std::wstring & url, Item & item);
Error EditDefaultItem(long id, long new_default_item);
Error EditLinkItem(long id, const std::wstring & link_to, int link_redirect);
Error EditTemplateItemById(long id, const std::wstring & new_html_template);
long GetItemId(long parent_id, const std::wstring & url, Item::Type type);
long GetFileId(long parent_id, const std::wstring & url);
long GetDirId(long parent_id, const std::wstring & url);
Error AddHardLink(Item & item);
Error AddThread(Thread & thread);
Error GetThreadByDirId(long dir_id, Thread & thread);
Error GetThreads(long parent_id, std::vector<Thread> & thread_tab);
Error EditThreadAddItem(long dir_id, long item_id);
Error EditThreadRemoveItem(long dir_id);
Error RemoveThread(long dir_id);
@ -102,6 +92,7 @@ protected:
DbTextStream query, query_create_url;
std::wstring temp_url;
Item dir_temp;
bool AddItemCreateUrlSubject(Item & item);
@ -110,18 +101,16 @@ protected:
Error EditItemInItem(Item & item, bool with_url);
Error EditItemInContent(Item & item);
Error EditItemGetId(Item & item);
Error EditItemGetContentId(Item & item);
void CheckAllUrlSubjectModifyItem(Item & item);
Error EditItemGetIdsByUrl(Item & item);
long GetContentId(long item_id);
PGresult * GetItemsQuery(const DbItemQuery & iq, bool skip_other_sel = false);
bool DelItemDelItem(const Item & item);
void DelItemDelContent(const Item & item);
Error DelItemCountContents(const Item & item, long & contents);
Error DelItemDelItem(const Item & item);
Error DelItemDelContent(const Item & item);
Error IncrementContentRef(long content_id);
Error DecrementContentRef(long content_id);
};

View File

@ -346,6 +346,29 @@ size_t buffer_len = sizeof(buffer) / sizeof(wchar_t);
Error DbBase::DoCommand(const DbTextStream & command)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
r = AssertQuery(command);
AssertResult(r, PGRES_COMMAND_OK);
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error DbBase::DoCommand(const char * command)
{
PGresult * r = 0;
@ -353,9 +376,7 @@ Error DbBase::DoCommand(const char * command)
try
{
bquery.Clear();
bquery << R(command);
r = AssertQuery(bquery);
r = AssertQuery(command);
AssertResult(r, PGRES_COMMAND_OK);
}
catch(const Error & e)
@ -391,4 +412,18 @@ Error DbBase::CommitTrans()
Error DbBase::EndTrans(Error err)
{
if( err == WINIX_ERR_OK )
{
err = CommitTrans();
}
else
{
// we returned the old err code
RollbackTrans();
}
return err;
}

View File

@ -58,10 +58,12 @@ public:
static const char * ConvertTime(const tm & t); // warning: it uses its own static buffer
void CreateIdList(const std::vector<long> & id_tab, std::wstring & list, bool add_parentheses = true);
Error DoCommand(const DbTextStream & command);
Error DoCommand(const char * command);
Error BeginTrans();
Error RollbackTrans();
Error CommitTrans();
Error EndTrans(Error err);
protected:

View File

@ -25,7 +25,8 @@ void DbItemColumns::SetColumns(PGresult * r)
type = PQfnumber(r, "type");
parent_id = PQfnumber(r, "parent_id");
content_id = PQfnumber(r, "content_id");
default_item = PQfnumber(r, "default_item");
link_to = PQfnumber(r, "link_to");
link_redirect = PQfnumber(r, "link_redirect");
subject = PQfnumber(r, "subject");
content = PQfnumber(r, "content");
content_type = PQfnumber(r, "content_type");
@ -36,6 +37,8 @@ void DbItemColumns::SetColumns(PGresult * r)
file_fs = PQfnumber(r, "file_fs");
file_type = PQfnumber(r, "file_type");
has_thumb = PQfnumber(r, "has_thumb");
ref = PQfnumber(r, "ref");
modify_index = PQfnumber(r, "modify_index");
}
@ -48,21 +51,25 @@ void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
if( privileges != -1 ) item.privileges = DbBase::AssertValueInt(r, row, privileges);
if( date_creation != -1 ) item.date_creation = DbBase::AssertValueTm(r, row, date_creation);
if( date_modification != -1 ) item.date_modification = DbBase::AssertValueTm(r, row, date_modification);
if( url != -1 ) item.url = DbBase::AssertValueWide(r, row, url);
if( type != -1 ) item.type = static_cast<Item::Type>( DbBase::AssertValueInt(r, row, type) );
if( parent_id != -1 ) item.parent_id = DbBase::AssertValueLong(r, row, parent_id);
if( content_id != -1 ) item.content_id = DbBase::AssertValueLong(r, row, content_id);
if( default_item != -1 ) item.default_item = DbBase::AssertValueLong(r, row, default_item);
if( subject != -1 ) item.subject = DbBase::AssertValueWide(r, row, subject);
if( content != -1 ) item.content = DbBase::AssertValueWide(r, row, content);
if( link_redirect != -1 ) item.link_redirect = DbBase::AssertValueInt(r, row, link_redirect);
if( content_type != -1 ) item.content_type = static_cast<Item::ContentType>( DbBase::AssertValueInt(r, row, content_type) );
if( guest_name != -1 ) item.guest_name = DbBase::AssertValueWide(r, row, guest_name);
if( html_template != -1 ) item.html_template = DbBase::AssertValueWide(r, row, html_template);
if( modification_user_id != -1 ) item.modification_user_id = DbBase::AssertValueLong(r, row, modification_user_id);
if( file_path != -1 ) item.file_path = DbBase::AssertValueWide(r, row, file_path);
if( file_fs != -1 ) item.file_fs = DbBase::AssertValueInt(r, row, file_fs);
if( file_type != -1 ) item.file_type = DbBase::AssertValueInt(r, row, file_type);
if( has_thumb != -1 ) item.has_thumb = DbBase::AssertValueBool(r, row, has_thumb);
if( ref != -1 ) item.ref = DbBase::AssertValueInt(r, row, ref);
if( modify_index != -1 ) item.modify_index = DbBase::AssertValueInt(r, row, modify_index);
if( url != -1 ) DbBase::AssertValueWide(r, row, url, item.url);
if( content != -1 ) DbBase::AssertValueWide(r, row, content, item.content);
if( subject != -1 ) DbBase::AssertValueWide(r, row, subject, item.subject);
if( file_path != -1 ) DbBase::AssertValueWide(r, row, file_path, item.file_path);
if( link_to != -1 ) DbBase::AssertValueWide(r, row, link_to, item.link_to);
if( guest_name != -1 ) DbBase::AssertValueWide(r, row, guest_name, item.guest_name);
if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template);
}

View File

@ -29,7 +29,8 @@ struct DbItemColumns
int type;
int parent_id;
int content_id;
int default_item;
int link_to;
int link_redirect;
int subject;
int content;
int content_type;
@ -40,6 +41,8 @@ struct DbItemColumns
int file_fs;
int file_type;
int has_thumb;
int ref;
int modify_index;
void SetColumns(PGresult * r);
void SetItem(PGresult * r, long row, Item & item);

View File

@ -12,10 +12,10 @@
DbItemQuery::DbItemQuery()
{
sort_asc = true;
file_type_equal = true;
SetAll(true, false);
@ -24,6 +24,9 @@ DbItemQuery::DbItemQuery()
type = Item::none;
file_type = WINIX_ITEM_FILETYPE_NONE;
type_equal = true;
file_type_equal = true;
limit = 0; // limit and offset not used by default
offset = 0;
}
@ -42,7 +45,7 @@ void DbItemQuery::SetAllSel(bool sel)
sel_content = sel;
sel_url = sel;
sel_type = sel;
sel_default_item = sel;
sel_link = sel;
sel_file = sel;
sel_html_template = sel;
}
@ -83,10 +86,11 @@ void DbItemQuery::WhereParentId(long parent_id_)
void DbItemQuery::WhereType(Item::Type type_)
void DbItemQuery::WhereType(Item::Type type_, bool equal)
{
where_type = true;
type = type_;
type_equal = equal;
}

View File

@ -18,7 +18,7 @@
struct DbItemQuery
{
// id is selected always
// id and content_id is selected always
bool sel_parent_id; // parent_id
bool sel_user_id; // user_id, modification_user_id
bool sel_group_id; // group_id
@ -26,10 +26,10 @@ struct DbItemQuery
bool sel_privileges; // privileges
bool sel_date; // date_creation, date_modification
bool sel_subject; // subject
bool sel_content; // content, content_type, (content_id)
bool sel_content; // content, content_type, ref, modify_index
bool sel_url; // url
bool sel_type; // type (dir, file, none)
bool sel_default_item; // default_item
bool sel_link; // link_to, link_redirect
bool sel_file; // file_path, file_fs, file_type, has_thumb
bool sel_html_template; // template
@ -41,6 +41,7 @@ struct DbItemQuery
long id; // if where_id is true
long parent_id; // if where_parent_id is true
Item::Type type;
bool type_equal;
int file_type;
bool file_type_equal; // if true means file_type should be equal
bool sort_asc;
@ -56,7 +57,7 @@ struct DbItemQuery
void WhereId(long id_);
void WhereParentId(long parent_id_);
void WhereType(Item::Type type_);
void WhereType(Item::Type type_, bool equal = true);
void WhereFileType(int file_t, bool equal = true);
void Limit(long l); // setting 0 turns off

View File

@ -16,18 +16,18 @@ adduser.o: ../core/confparser.h ../templates/misc.h
adduser.o: ../templates/localefilter.h ../templates/locale.h
adduser.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
adduser.o: ../../ezc/src/pattern.h functions.h functionparser.h cat.h chmod.h
adduser.o: privchanger.h chown.h ckeditor.h cp.h createthread.h default.h
adduser.o: download.h emacs.h last.h login.h logout.h ls.h mkdir.h mv.h
adduser.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
adduser.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
adduser.o: uptime.h who.h vim.h ../core/htmlfilter.h
adduser.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
adduser.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
adduser.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
adduser.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
adduser.o: ../core/mountparser.h ../core/users.h ../core/groups.h
adduser.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
adduser.o: ../core/basethread.h ../core/synchro.h
adduser.o: privchanger.h chown.h ckeditor.h cp.h createthread.h
adduser.o: ../functions/functionbase.h default.h download.h emacs.h last.h
adduser.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h
adduser.o: rm.h run.h specialdefault.h stat.h subject.h funthread.h
adduser.o: template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
adduser.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
adduser.o: ../templates/htmltextstream.h ../notify/notifythread.h
adduser.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
adduser.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
adduser.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
adduser.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
adduser.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
cat.o: cat.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
cat.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
cat.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -43,17 +43,17 @@ cat.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
cat.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
cat.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
cat.o: functions.h functionparser.h adduser.h chmod.h privchanger.h chown.h
cat.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
cat.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
cat.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
cat.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
cat.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
cat.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
cat.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
cat.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
cat.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
cat.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
cat.o: ../core/synchro.h
cat.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
cat.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
cat.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
cat.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
cat.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
cat.o: ../templates/htmltextstream.h ../notify/notifythread.h
cat.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
cat.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
cat.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
cat.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
cat.o: ../core/basethread.h ../core/synchro.h
chmod.o: chmod.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
chmod.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
chmod.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -70,17 +70,17 @@ chmod.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
chmod.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
chmod.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
chmod.o: functionparser.h adduser.h cat.h chown.h privchanger.h ckeditor.h
chmod.o: cp.h createthread.h default.h download.h emacs.h last.h login.h
chmod.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
chmod.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
chmod.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
chmod.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
chmod.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
chmod.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
chmod.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
chmod.o: ../core/mountparser.h ../core/users.h ../core/groups.h
chmod.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
chmod.o: ../core/basethread.h ../core/synchro.h
chmod.o: cp.h createthread.h ../functions/functionbase.h default.h download.h
chmod.o: emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h
chmod.o: reload.h rm.h run.h specialdefault.h stat.h subject.h funthread.h
chmod.o: template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
chmod.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
chmod.o: ../templates/htmltextstream.h ../notify/notifythread.h
chmod.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
chmod.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
chmod.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
chmod.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
chmod.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
chown.o: chown.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
chown.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
chown.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -97,17 +97,17 @@ chown.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
chown.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
chown.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
chown.o: functionparser.h adduser.h cat.h chmod.h privchanger.h ckeditor.h
chown.o: cp.h createthread.h default.h download.h emacs.h last.h login.h
chown.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
chown.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
chown.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
chown.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
chown.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
chown.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
chown.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
chown.o: ../core/mountparser.h ../core/users.h ../core/groups.h
chown.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
chown.o: ../core/basethread.h ../core/synchro.h
chown.o: cp.h createthread.h ../functions/functionbase.h default.h download.h
chown.o: emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h
chown.o: reload.h rm.h run.h specialdefault.h stat.h subject.h funthread.h
chown.o: template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
chown.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
chown.o: ../templates/htmltextstream.h ../notify/notifythread.h
chown.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
chown.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
chown.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
chown.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
chown.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
ckeditor.o: ckeditor.h functionbase.h ../core/item.h ../db/db.h
ckeditor.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
ckeditor.o: ../core/textstream.h ../core/misc.h ../core/item.h
@ -126,13 +126,13 @@ ckeditor.o: ../templates/localefilter.h ../templates/locale.h
ckeditor.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
ckeditor.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
ckeditor.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
ckeditor.o: cp.h createthread.h default.h download.h emacs.h last.h login.h
ckeditor.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
ckeditor.o: specialdefault.h stat.h subject.h funthread.h template.h
ckeditor.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
ckeditor.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
ckeditor.o: ../templates/htmltextstream.h ../notify/notifythread.h
ckeditor.o: ../core/basethread.h ../core/synchro.h
ckeditor.o: cp.h createthread.h ../functions/functionbase.h default.h
ckeditor.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
ckeditor.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
ckeditor.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
ckeditor.o: uptime.h who.h vim.h ../core/htmlfilter.h
ckeditor.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
ckeditor.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
ckeditor.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
ckeditor.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
ckeditor.o: ../core/mountparser.h ../core/users.h ../core/groups.h
@ -153,49 +153,48 @@ cp.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
cp.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
cp.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
cp.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
cp.o: chown.h ckeditor.h createthread.h default.h download.h emacs.h last.h
cp.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
cp.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
cp.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
cp.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
cp.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
cp.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
cp.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
cp.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
cp.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
cp.o: ../core/synchro.h ../core/misc.h
createthread.o: createthread.h functionbase.h ../core/item.h ../db/db.h
createthread.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
createthread.o: ../core/textstream.h ../core/misc.h ../core/item.h
createthread.o: ../core/error.h ../core/log.h ../core/textstream.h
createthread.o: ../db/dbitemquery.h ../db/dbitemcolumns.h ../core/user.h
createthread.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
createthread.o: ../core/ugcontainer.h ../core/request.h
createthread.o: ../core/requesttypes.h ../core/session.h ../core/error.h
createthread.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
createthread.o: ../core/config.h ../core/confparser.h ../core/htmlfilter.h
createthread.o: ../templates/htmltextstream.h ../core/config.h
createthread.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h
createthread.o: ../core/request.h ../notify/notify.h ../notify/notifypool.h
createthread.o: ../templates/locale.h ../core/confparser.h
createthread.o: ../templates/misc.h ../templates/localefilter.h
createthread.o: ../templates/locale.h ../../ezc/src/ezc.h
createthread.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h
createthread.o: ../../ezc/src/pattern.h functions.h functionparser.h
createthread.o: adduser.h cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h
createthread.o: default.h download.h emacs.h last.h login.h logout.h ls.h
createthread.o: mkdir.h mv.h node.h priv.h reload.h rm.h run.h
createthread.o: specialdefault.h stat.h subject.h funthread.h template.h
createthread.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
createthread.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
createthread.o: ../templates/htmltextstream.h ../notify/notifythread.h
createthread.o: ../core/basethread.h ../core/synchro.h
createthread.o: ../notify/templatesnotify.h ../core/users.h
cp.o: chown.h ckeditor.h createthread.h ../functions/functionbase.h default.h
cp.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
cp.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
cp.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
cp.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
cp.o: ../templates/htmltextstream.h ../notify/notifythread.h
cp.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
cp.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
cp.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
cp.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
cp.o: ../core/basethread.h ../core/synchro.h ../core/misc.h
createthread.o: createthread.h ../functions/functionbase.h functions.h
createthread.o: functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
createthread.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
createthread.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
createthread.o: ../core/textstream.h ../db/dbitemquery.h
createthread.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
createthread.o: ../core/thread.h ../core/dircontainer.h ../core/ugcontainer.h
createthread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
createthread.o: ../core/error.h ../core/user.h ../core/plugindata.h
createthread.o: ../core/rebus.h ../core/config.h ../core/confparser.h
createthread.o: ../core/htmlfilter.h ../templates/htmltextstream.h
createthread.o: ../core/config.h ../core/system.h ../core/dirs.h
createthread.o: ../core/dircontainer.h ../core/request.h ../notify/notify.h
createthread.o: ../notify/notifypool.h ../templates/locale.h
createthread.o: ../core/confparser.h ../templates/misc.h
createthread.o: ../templates/localefilter.h ../templates/locale.h
createthread.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
createthread.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
createthread.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
createthread.o: ../notify/notifythread.h ../core/basethread.h
createthread.o: ../core/synchro.h ../notify/templatesnotify.h ../core/users.h
createthread.o: ../core/ugcontainer.h ../core/lastcontainer.h
createthread.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
createthread.o: ../core/users.h ../core/groups.h ../core/group.h
createthread.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
createthread.o: ../core/synchro.h
createthread.o: ../core/synchro.h functionparser.h adduser.h cat.h chmod.h
createthread.o: privchanger.h chown.h ckeditor.h cp.h default.h download.h
createthread.o: emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h
createthread.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
createthread.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h
createthread.o: who.h vim.h ../core/htmlfilter.h
default.o: default.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
default.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
default.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -213,10 +212,10 @@ default.o: ../templates/localefilter.h ../templates/locale.h
default.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
default.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
default.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
default.o: download.h emacs.h last.h login.h logout.h ls.h mkdir.h mv.h
default.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
default.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
default.o: uptime.h who.h vim.h ../core/htmlfilter.h
default.o: ../functions/functionbase.h download.h emacs.h last.h login.h
default.o: logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
default.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
default.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
default.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
default.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
default.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
@ -242,13 +241,13 @@ download.o: ../templates/localefilter.h ../templates/locale.h
download.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
download.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
download.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
download.o: ckeditor.h cp.h createthread.h default.h emacs.h last.h login.h
download.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
download.o: specialdefault.h stat.h subject.h funthread.h template.h
download.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
download.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
download.o: ../templates/htmltextstream.h ../notify/notifythread.h
download.o: ../core/basethread.h ../core/synchro.h
download.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h
download.o: default.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
download.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
download.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
download.o: uptime.h who.h vim.h ../core/htmlfilter.h
download.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
download.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
download.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
download.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
download.o: ../core/mountparser.h ../core/users.h ../core/groups.h
@ -270,20 +269,20 @@ emacs.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
emacs.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
emacs.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
emacs.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
emacs.o: ckeditor.h cp.h createthread.h default.h download.h last.h login.h
emacs.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
emacs.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
emacs.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
emacs.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
emacs.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
emacs.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
emacs.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
emacs.o: ../core/mountparser.h ../core/users.h ../core/groups.h
emacs.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
emacs.o: ../core/basethread.h ../core/synchro.h ../templates/templates.h
emacs.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
emacs.o: ../core/httpsimpleparser.h ../core/log.h
emacs.o: ../templates/indexpatterns.h ../core/sessionmanager.h
emacs.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
emacs.o: download.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h
emacs.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
emacs.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
emacs.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
emacs.o: ../templates/htmltextstream.h ../notify/notifythread.h
emacs.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
emacs.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
emacs.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
emacs.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
emacs.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
emacs.o: ../templates/templates.h ../templates/patterncacher.h
emacs.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
emacs.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
emacs.o: ../core/sessioncontainer.h ../core/system.h
functionbase.o: functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
functionbase.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
@ -303,9 +302,10 @@ functionbase.o: ../templates/localefilter.h ../templates/locale.h
functionbase.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
functionbase.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
functionbase.o: functionparser.h adduser.h cat.h chmod.h privchanger.h
functionbase.o: chown.h ckeditor.h cp.h createthread.h default.h download.h
functionbase.o: emacs.h last.h login.h logout.h ls.h mkdir.h mv.h node.h
functionbase.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
functionbase.o: chown.h ckeditor.h cp.h createthread.h
functionbase.o: ../functions/functionbase.h default.h download.h emacs.h
functionbase.o: last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h
functionbase.o: reload.h rm.h run.h specialdefault.h stat.h subject.h
functionbase.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h
functionbase.o: who.h vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
functionbase.o: ../templates/htmltextstream.h ../notify/notifythread.h
@ -335,8 +335,9 @@ functionparser.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
functionparser.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
functionparser.o: functions.h functionbase.h ../core/config.h
functionparser.o: ../core/synchro.h adduser.h cat.h chmod.h privchanger.h
functionparser.o: chown.h ckeditor.h cp.h createthread.h default.h download.h
functionparser.o: emacs.h last.h login.h logout.h ls.h mkdir.h mv.h node.h
functionparser.o: chown.h ckeditor.h cp.h createthread.h
functionparser.o: ../functions/functionbase.h default.h download.h emacs.h
functionparser.o: last.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h
functionparser.o: priv.h reload.h rm.h run.h specialdefault.h stat.h
functionparser.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
functionparser.o: uptime.h who.h vim.h ../core/htmlfilter.h
@ -373,47 +374,20 @@ functions.o: ../core/mount.h ../core/mountparser.h ../core/users.h
functions.o: ../core/groups.h ../core/group.h ../core/loadavg.h
functions.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
functions.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
functions.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h
functions.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h
functions.o: rm.h run.h specialdefault.h stat.h subject.h funthread.h
functions.o: template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
functions.o: ../core/htmlfilter.h ../core/log.h ../core/misc.h
functions.o: ../core/plugin.h ../core/pluginmsg.h ../core/system.h
functions.o: ../core/sessionmanager.h ../core/sessioncontainer.h
functions.o: ../functions/functions.h ../templates/templates.h
functions.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
functions.o: ../core/httpsimpleparser.h ../core/log.h
functions.o: ../templates/indexpatterns.h ../core/sessionmanager.h
funthread.o: ../core/misc.h funthread.h functionbase.h ../core/item.h
funthread.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
funthread.o: ../core/textstream.h ../core/misc.h ../core/item.h
funthread.o: ../core/error.h ../core/log.h ../core/textstream.h
funthread.o: ../db/dbitemquery.h ../db/dbitemcolumns.h ../core/user.h
funthread.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
funthread.o: ../core/ugcontainer.h ../core/request.h ../core/requesttypes.h
funthread.o: ../core/session.h ../core/error.h ../core/user.h
funthread.o: ../core/plugindata.h ../core/rebus.h ../core/config.h
funthread.o: ../core/confparser.h ../core/htmlfilter.h
funthread.o: ../templates/htmltextstream.h ../core/config.h ../core/system.h
funthread.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
funthread.o: ../notify/notify.h ../notify/notifypool.h ../templates/locale.h
funthread.o: ../core/confparser.h ../templates/misc.h
funthread.o: ../templates/localefilter.h ../templates/locale.h
funthread.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
funthread.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
funthread.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
funthread.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h
funthread.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h
funthread.o: rm.h run.h specialdefault.h stat.h subject.h template.h
funthread.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
funthread.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
funthread.o: ../templates/htmltextstream.h ../notify/notifythread.h
funthread.o: ../core/basethread.h ../core/synchro.h
funthread.o: ../notify/templatesnotify.h ../core/users.h
funthread.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/mounts.h
funthread.o: ../core/mount.h ../core/mountparser.h ../core/users.h
funthread.o: ../core/groups.h ../core/group.h ../core/loadavg.h
funthread.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
functions.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h
functions.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h
functions.o: mkdir.h mv.h node.h priv.h reload.h rm.h run.h specialdefault.h
functions.o: stat.h subject.h funthread.h template.h tinymce.h uname.h
functions.o: upload.h uptime.h who.h vim.h ../core/htmlfilter.h ../core/log.h
functions.o: ../core/misc.h ../core/plugin.h ../core/pluginmsg.h
functions.o: ../core/system.h ../core/sessionmanager.h
functions.o: ../core/sessioncontainer.h ../functions/functions.h
functions.o: ../templates/templates.h ../templates/patterncacher.h
functions.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
functions.o: ../core/log.h ../templates/indexpatterns.h
functions.o: ../core/sessionmanager.h
funthread.o: ../core/misc.h funthread.h ../functions/functionbase.h
funthread.o: ../core/thread.h
last.o: last.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
last.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
last.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -430,17 +404,44 @@ last.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
last.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
last.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
last.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
last.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h login.h
last.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
last.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
last.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
last.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
last.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
last.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
last.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
last.o: ../core/mountparser.h ../core/users.h ../core/groups.h
last.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
last.o: ../core/basethread.h ../core/synchro.h
last.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
last.o: download.h emacs.h login.h logout.h ln.h ls.h mkdir.h mv.h node.h
last.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
last.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
last.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
last.o: ../templates/htmltextstream.h ../notify/notifythread.h
last.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
last.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
last.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
last.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
last.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
ln.o: ln.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
ln.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h ../core/misc.h
ln.o: ../core/item.h ../core/error.h ../core/log.h ../core/textstream.h
ln.o: ../db/dbitemquery.h ../db/dbitemcolumns.h ../core/user.h
ln.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
ln.o: ../core/ugcontainer.h ../core/request.h ../core/requesttypes.h
ln.o: ../core/session.h ../core/error.h ../core/user.h ../core/plugindata.h
ln.o: ../core/rebus.h ../core/config.h ../core/confparser.h
ln.o: ../core/htmlfilter.h ../templates/htmltextstream.h ../core/config.h
ln.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h
ln.o: ../core/request.h ../notify/notify.h ../notify/notifypool.h
ln.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
ln.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
ln.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
ln.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
ln.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
ln.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h mv.h
ln.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
ln.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
ln.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
ln.o: ../templates/htmltextstream.h ../notify/notifythread.h
ln.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
ln.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
ln.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
ln.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
ln.o: ../core/basethread.h ../core/synchro.h ../core/misc.h
ln.o: ../functions/functions.h
login.o: login.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
login.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
login.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -457,17 +458,17 @@ login.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
login.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
login.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
login.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
login.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
login.o: logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
login.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
login.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
login.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
login.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
login.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
login.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
login.o: ../core/mountparser.h ../core/users.h ../core/groups.h
login.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
login.o: ../core/basethread.h ../core/synchro.h
login.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
login.o: download.h emacs.h last.h logout.h ln.h ls.h mkdir.h mv.h node.h
login.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
login.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
login.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
login.o: ../templates/htmltextstream.h ../notify/notifythread.h
login.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
login.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
login.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
login.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
login.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
logout.o: logout.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
logout.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
logout.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -485,16 +486,17 @@ logout.o: ../templates/localefilter.h ../templates/locale.h
logout.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
logout.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
logout.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
logout.o: default.h download.h emacs.h last.h login.h ls.h mkdir.h mv.h
logout.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
logout.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
logout.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
logout.o: ../templates/htmltextstream.h ../notify/notifythread.h
logout.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
logout.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
logout.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
logout.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
logout.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
logout.o: ../functions/functionbase.h default.h download.h emacs.h last.h
logout.o: login.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
logout.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
logout.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
logout.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
logout.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
logout.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
logout.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
logout.o: ../core/mountparser.h ../core/users.h ../core/groups.h
logout.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
logout.o: ../core/basethread.h ../core/synchro.h
ls.o: ls.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
ls.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h ../core/misc.h
ls.o: ../core/item.h ../core/error.h ../core/log.h ../core/textstream.h
@ -510,17 +512,17 @@ ls.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
ls.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
ls.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
ls.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
ls.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
ls.o: last.h login.h logout.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
ls.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
ls.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
ls.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
ls.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
ls.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
ls.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
ls.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
ls.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
ls.o: ../core/synchro.h
ls.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
ls.o: default.h download.h emacs.h last.h login.h logout.h ln.h mkdir.h mv.h
ls.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
ls.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
ls.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
ls.o: ../templates/htmltextstream.h ../notify/notifythread.h
ls.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
ls.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
ls.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
ls.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
ls.o: ../core/basethread.h ../core/synchro.h
mkdir.o: mkdir.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
mkdir.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
mkdir.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -537,17 +539,17 @@ mkdir.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
mkdir.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
mkdir.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
mkdir.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
mkdir.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
mkdir.o: login.h logout.h ls.h mv.h node.h priv.h reload.h rm.h run.h
mkdir.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
mkdir.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
mkdir.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
mkdir.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
mkdir.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
mkdir.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
mkdir.o: ../core/mountparser.h ../core/users.h ../core/groups.h
mkdir.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
mkdir.o: ../core/basethread.h ../core/synchro.h
mkdir.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
mkdir.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mv.h node.h
mkdir.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
mkdir.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
mkdir.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
mkdir.o: ../templates/htmltextstream.h ../notify/notifythread.h
mkdir.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
mkdir.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
mkdir.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
mkdir.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
mkdir.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
mv.o: mv.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
mv.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h ../core/misc.h
mv.o: ../core/item.h ../core/error.h ../core/log.h ../core/textstream.h
@ -563,17 +565,17 @@ mv.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
mv.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
mv.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
mv.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
mv.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
mv.o: last.h login.h logout.h ls.h mkdir.h node.h priv.h reload.h rm.h run.h
mv.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
mv.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
mv.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
mv.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
mv.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
mv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
mv.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
mv.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
mv.o: ../core/synchro.h
mv.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
mv.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
mv.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
mv.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
mv.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
mv.o: ../templates/htmltextstream.h ../notify/notifythread.h
mv.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
mv.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
mv.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
mv.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
mv.o: ../core/basethread.h ../core/synchro.h
node.o: node.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
node.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
node.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -590,17 +592,17 @@ node.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
node.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
node.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
node.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
node.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
node.o: login.h logout.h ls.h mkdir.h mv.h priv.h reload.h rm.h run.h
node.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
node.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
node.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
node.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
node.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
node.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
node.o: ../core/mountparser.h ../core/users.h ../core/groups.h
node.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
node.o: ../core/basethread.h ../core/synchro.h
node.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
node.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
node.o: priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
node.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
node.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
node.o: ../templates/htmltextstream.h ../notify/notifythread.h
node.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
node.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
node.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
node.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
node.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
priv.o: priv.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
priv.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
priv.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -617,17 +619,17 @@ priv.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
priv.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
priv.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
priv.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
priv.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
priv.o: login.h logout.h ls.h mkdir.h mv.h node.h reload.h rm.h run.h
priv.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
priv.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
priv.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
priv.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
priv.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
priv.o: ../core/mountparser.h ../core/users.h ../core/groups.h
priv.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
priv.o: ../core/basethread.h ../core/synchro.h
priv.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
priv.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
priv.o: node.h reload.h rm.h run.h specialdefault.h stat.h subject.h
priv.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
priv.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
priv.o: ../templates/htmltextstream.h ../notify/notifythread.h
priv.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
priv.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
priv.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
priv.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
priv.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
privchanger.o: privchanger.h ../core/request.h ../core/requesttypes.h
privchanger.o: ../core/session.h ../core/item.h ../core/error.h
privchanger.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
@ -647,14 +649,14 @@ privchanger.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
privchanger.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
privchanger.o: functionbase.h ../core/config.h ../core/synchro.h
privchanger.o: functionparser.h adduser.h cat.h chmod.h chown.h ckeditor.h
privchanger.o: cp.h createthread.h default.h download.h emacs.h last.h
privchanger.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
privchanger.o: run.h specialdefault.h stat.h subject.h funthread.h template.h
privchanger.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
privchanger.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
privchanger.o: ../templates/htmltextstream.h ../notify/notifythread.h
privchanger.o: ../core/basethread.h ../core/synchro.h
privchanger.o: ../notify/templatesnotify.h ../core/users.h
privchanger.o: cp.h createthread.h ../functions/functionbase.h default.h
privchanger.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
privchanger.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
privchanger.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
privchanger.o: uptime.h who.h vim.h ../core/htmlfilter.h
privchanger.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
privchanger.o: ../notify/notifythread.h ../core/basethread.h
privchanger.o: ../core/synchro.h ../notify/templatesnotify.h ../core/users.h
privchanger.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/mounts.h
privchanger.o: ../core/mount.h ../core/mountparser.h ../core/users.h
privchanger.o: ../core/groups.h ../core/group.h ../core/loadavg.h
@ -676,19 +678,20 @@ reload.o: ../templates/localefilter.h ../templates/locale.h
reload.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
reload.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
reload.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
reload.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h
reload.o: mv.h node.h priv.h rm.h run.h specialdefault.h stat.h subject.h
reload.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
reload.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
reload.o: ../templates/htmltextstream.h ../notify/notifythread.h
reload.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
reload.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
reload.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
reload.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
reload.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
reload.o: ../templates/templates.h ../templates/patterncacher.h
reload.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
reload.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
reload.o: ../functions/functionbase.h default.h download.h emacs.h last.h
reload.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h rm.h run.h
reload.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
reload.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
reload.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
reload.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
reload.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
reload.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
reload.o: ../core/mountparser.h ../core/users.h ../core/groups.h
reload.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
reload.o: ../core/basethread.h ../core/synchro.h ../templates/templates.h
reload.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
reload.o: ../core/httpsimpleparser.h ../core/log.h
reload.o: ../templates/indexpatterns.h ../core/sessionmanager.h
reload.o: ../core/sessioncontainer.h ../core/system.h
rm.o: rm.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
rm.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h ../core/misc.h
@ -705,22 +708,23 @@ rm.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
rm.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
rm.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
rm.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
rm.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
rm.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h run.h
rm.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
rm.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
rm.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
rm.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
rm.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
rm.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
rm.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
rm.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
rm.o: ../core/synchro.h ../core/plugin.h ../core/pluginmsg.h ../core/system.h
rm.o: ../core/sessionmanager.h ../core/sessioncontainer.h
rm.o: ../functions/functions.h ../templates/templates.h
rm.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
rm.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
rm.o: ../core/sessionmanager.h ../core/misc.h
rm.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
rm.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
rm.o: mv.h node.h priv.h reload.h run.h specialdefault.h stat.h subject.h
rm.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
rm.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
rm.o: ../templates/htmltextstream.h ../notify/notifythread.h
rm.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
rm.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
rm.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
rm.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
rm.o: ../core/basethread.h ../core/synchro.h ../core/plugin.h
rm.o: ../core/pluginmsg.h ../core/system.h ../core/sessionmanager.h
rm.o: ../core/sessioncontainer.h ../functions/functions.h
rm.o: ../templates/templates.h ../templates/patterncacher.h
rm.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
rm.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
rm.o: ../core/misc.h
run.o: run.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
run.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
run.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -736,17 +740,17 @@ run.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
run.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
run.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
run.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
run.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
run.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
run.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
run.o: uname.h upload.h uptime.h who.h vim.h ../core/htmlfilter.h
run.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
run.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
run.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
run.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
run.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
run.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
run.o: ../core/synchro.h
run.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
run.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
run.o: mv.h node.h priv.h reload.h rm.h specialdefault.h stat.h subject.h
run.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h vim.h
run.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
run.o: ../templates/htmltextstream.h ../notify/notifythread.h
run.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
run.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
run.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
run.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
run.o: ../core/basethread.h ../core/synchro.h
specialdefault.o: specialdefault.h functionbase.h ../core/item.h ../db/db.h
specialdefault.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
specialdefault.o: ../core/textstream.h ../core/misc.h ../core/item.h
@ -766,19 +770,19 @@ specialdefault.o: ../templates/locale.h ../../ezc/src/ezc.h
specialdefault.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h
specialdefault.o: ../../ezc/src/pattern.h functions.h functionparser.h
specialdefault.o: adduser.h cat.h chmod.h privchanger.h chown.h ckeditor.h
specialdefault.o: cp.h createthread.h default.h download.h emacs.h last.h
specialdefault.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h
specialdefault.o: rm.h run.h stat.h subject.h funthread.h template.h
specialdefault.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
specialdefault.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
specialdefault.o: ../templates/htmltextstream.h ../notify/notifythread.h
specialdefault.o: cp.h createthread.h ../functions/functionbase.h default.h
specialdefault.o: download.h emacs.h last.h login.h logout.h ln.h ls.h
specialdefault.o: mkdir.h mv.h node.h priv.h reload.h rm.h run.h stat.h
specialdefault.o: subject.h funthread.h template.h tinymce.h uname.h upload.h
specialdefault.o: uptime.h who.h vim.h ../core/htmlfilter.h
specialdefault.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
specialdefault.o: ../notify/notifythread.h ../core/basethread.h
specialdefault.o: ../core/synchro.h ../notify/templatesnotify.h
specialdefault.o: ../core/users.h ../core/ugcontainer.h
specialdefault.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
specialdefault.o: ../core/mountparser.h ../core/users.h ../core/groups.h
specialdefault.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
specialdefault.o: ../core/basethread.h ../core/synchro.h
specialdefault.o: ../notify/templatesnotify.h ../core/users.h
specialdefault.o: ../core/ugcontainer.h ../core/lastcontainer.h
specialdefault.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
specialdefault.o: ../core/users.h ../core/groups.h ../core/group.h
specialdefault.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
specialdefault.o: ../core/synchro.h
stat.o: stat.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
stat.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
stat.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -795,17 +799,17 @@ stat.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
stat.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
stat.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
stat.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
stat.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
stat.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
stat.o: specialdefault.h subject.h funthread.h template.h tinymce.h uname.h
stat.o: upload.h uptime.h who.h vim.h ../core/htmlfilter.h
stat.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
stat.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
stat.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
stat.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
stat.o: ../core/mountparser.h ../core/users.h ../core/groups.h
stat.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
stat.o: ../core/basethread.h ../core/synchro.h
stat.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
stat.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
stat.o: node.h priv.h reload.h rm.h run.h specialdefault.h subject.h
stat.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
stat.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
stat.o: ../templates/htmltextstream.h ../notify/notifythread.h
stat.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
stat.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
stat.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
stat.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
stat.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
subject.o: subject.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
subject.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
subject.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -823,10 +827,11 @@ subject.o: ../templates/localefilter.h ../templates/locale.h
subject.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
subject.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
subject.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
subject.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h
subject.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
subject.o: funthread.h template.h tinymce.h uname.h upload.h uptime.h who.h
subject.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
subject.o: ../functions/functionbase.h default.h download.h emacs.h last.h
subject.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h
subject.o: rm.h run.h specialdefault.h stat.h funthread.h template.h
subject.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
subject.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
subject.o: ../templates/htmltextstream.h ../notify/notifythread.h
subject.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
subject.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
@ -851,11 +856,11 @@ template.o: ../templates/localefilter.h ../templates/locale.h
template.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
template.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
template.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
template.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h
template.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h
template.o: rm.h run.h specialdefault.h stat.h subject.h funthread.h
template.o: tinymce.h uname.h upload.h uptime.h who.h vim.h
template.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
template.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h
template.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h
template.o: mkdir.h mv.h node.h priv.h reload.h rm.h run.h specialdefault.h
template.o: stat.h subject.h funthread.h tinymce.h uname.h upload.h uptime.h
template.o: who.h vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
template.o: ../templates/htmltextstream.h ../notify/notifythread.h
template.o: ../core/basethread.h ../core/synchro.h
template.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
@ -880,10 +885,11 @@ tinymce.o: ../templates/localefilter.h ../templates/locale.h
tinymce.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
tinymce.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
tinymce.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
tinymce.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h
tinymce.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
tinymce.o: subject.h funthread.h template.h uname.h upload.h uptime.h who.h
tinymce.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
tinymce.o: ../functions/functionbase.h default.h download.h emacs.h last.h
tinymce.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h
tinymce.o: rm.h run.h specialdefault.h stat.h subject.h funthread.h
tinymce.o: template.h uname.h upload.h uptime.h who.h vim.h
tinymce.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
tinymce.o: ../templates/htmltextstream.h ../notify/notifythread.h
tinymce.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
tinymce.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
@ -906,17 +912,17 @@ uname.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
uname.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
uname.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h functions.h
uname.o: functionparser.h adduser.h cat.h chmod.h privchanger.h chown.h
uname.o: ckeditor.h cp.h createthread.h default.h download.h emacs.h last.h
uname.o: login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h run.h
uname.o: specialdefault.h stat.h subject.h funthread.h template.h tinymce.h
uname.o: upload.h uptime.h who.h vim.h ../core/htmlfilter.h
uname.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
uname.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
uname.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
uname.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
uname.o: ../core/mountparser.h ../core/users.h ../core/groups.h
uname.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
uname.o: ../core/basethread.h ../core/synchro.h
uname.o: ckeditor.h cp.h createthread.h ../functions/functionbase.h default.h
uname.o: download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h mv.h
uname.o: node.h priv.h reload.h rm.h run.h specialdefault.h stat.h subject.h
uname.o: funthread.h template.h tinymce.h upload.h uptime.h who.h vim.h
uname.o: ../core/htmlfilter.h ../../ezc/src/stringconv.h
uname.o: ../templates/htmltextstream.h ../notify/notifythread.h
uname.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
uname.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
uname.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
uname.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
uname.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
upload.o: upload.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
upload.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
upload.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -934,17 +940,18 @@ upload.o: ../templates/localefilter.h ../templates/locale.h
upload.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
upload.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
upload.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
upload.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h
upload.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
upload.o: subject.h funthread.h template.h tinymce.h uname.h uptime.h who.h
upload.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
upload.o: ../templates/htmltextstream.h ../notify/notifythread.h
upload.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
upload.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
upload.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
upload.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
upload.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
upload.o: ../core/misc.h ../functions/functions.h
upload.o: ../functions/functionbase.h default.h download.h emacs.h last.h
upload.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
upload.o: run.h specialdefault.h stat.h subject.h funthread.h template.h
upload.o: tinymce.h uname.h uptime.h who.h vim.h ../core/htmlfilter.h
upload.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
upload.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
upload.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
upload.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
upload.o: ../core/mountparser.h ../core/users.h ../core/groups.h
upload.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
upload.o: ../core/basethread.h ../core/synchro.h ../core/misc.h
upload.o: ../functions/functions.h
uptime.o: uptime.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
uptime.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
uptime.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -962,16 +969,17 @@ uptime.o: ../templates/localefilter.h ../templates/locale.h
uptime.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
uptime.o: ../../ezc/src/pattern.h functions.h functionparser.h adduser.h
uptime.o: cat.h chmod.h privchanger.h chown.h ckeditor.h cp.h createthread.h
uptime.o: default.h download.h emacs.h last.h login.h logout.h ls.h mkdir.h
uptime.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
uptime.o: subject.h funthread.h template.h tinymce.h uname.h upload.h who.h
uptime.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
uptime.o: ../templates/htmltextstream.h ../notify/notifythread.h
uptime.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
uptime.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
uptime.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
uptime.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
uptime.o: ../core/thumb.h ../core/basethread.h ../core/synchro.h
uptime.o: ../functions/functionbase.h default.h download.h emacs.h last.h
uptime.o: login.h logout.h ln.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
uptime.o: run.h specialdefault.h stat.h subject.h funthread.h template.h
uptime.o: tinymce.h uname.h upload.h who.h vim.h ../core/htmlfilter.h
uptime.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
uptime.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
uptime.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
uptime.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
uptime.o: ../core/mountparser.h ../core/users.h ../core/groups.h
uptime.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
uptime.o: ../core/basethread.h ../core/synchro.h
vim.o: vim.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
vim.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
vim.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -987,17 +995,17 @@ vim.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
vim.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
vim.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
vim.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
vim.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
vim.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
vim.o: run.h specialdefault.h stat.h subject.h funthread.h template.h
vim.o: tinymce.h uname.h upload.h uptime.h who.h ../core/htmlfilter.h
vim.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
vim.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
vim.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
vim.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
vim.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
vim.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
vim.o: ../core/synchro.h
vim.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
vim.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
vim.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
vim.o: subject.h funthread.h template.h tinymce.h uname.h upload.h uptime.h
vim.o: who.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
vim.o: ../templates/htmltextstream.h ../notify/notifythread.h
vim.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
vim.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
vim.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
vim.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
vim.o: ../core/basethread.h ../core/synchro.h
who.o: who.h functionbase.h ../core/item.h ../db/db.h ../db/dbbase.h
who.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
who.o: ../core/misc.h ../core/item.h ../core/error.h ../core/log.h
@ -1013,14 +1021,14 @@ who.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
who.o: ../templates/localefilter.h ../templates/locale.h ../../ezc/src/ezc.h
who.o: ../../ezc/src/utf8.h ../../ezc/src/generator.h ../../ezc/src/pattern.h
who.o: functions.h functionparser.h adduser.h cat.h chmod.h privchanger.h
who.o: chown.h ckeditor.h cp.h createthread.h default.h download.h emacs.h
who.o: last.h login.h logout.h ls.h mkdir.h mv.h node.h priv.h reload.h rm.h
who.o: run.h specialdefault.h stat.h subject.h funthread.h template.h
who.o: tinymce.h uname.h upload.h uptime.h vim.h ../core/htmlfilter.h
who.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
who.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
who.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
who.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
who.o: ../core/mountparser.h ../core/users.h ../core/groups.h ../core/group.h
who.o: ../core/loadavg.h ../core/thumb.h ../core/basethread.h
who.o: ../core/synchro.h
who.o: chown.h ckeditor.h cp.h createthread.h ../functions/functionbase.h
who.o: default.h download.h emacs.h last.h login.h logout.h ln.h ls.h mkdir.h
who.o: mv.h node.h priv.h reload.h rm.h run.h specialdefault.h stat.h
who.o: subject.h funthread.h template.h tinymce.h uname.h upload.h uptime.h
who.o: vim.h ../core/htmlfilter.h ../../ezc/src/stringconv.h
who.o: ../templates/htmltextstream.h ../notify/notifythread.h
who.o: ../core/basethread.h ../core/synchro.h ../notify/templatesnotify.h
who.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
who.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h ../core/users.h
who.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
who.o: ../core/basethread.h ../core/synchro.h

View File

@ -1 +1 @@
o = adduser.o cat.o chmod.o chown.o ckeditor.o cp.o createthread.o default.o download.o emacs.o functionbase.o functionparser.o functions.o funthread.o last.o login.o logout.o ls.o mkdir.o mv.o node.o priv.o privchanger.o reload.o rm.o run.o specialdefault.o stat.o subject.o template.o tinymce.o uname.o upload.o uptime.o vim.o who.o
o = adduser.o cat.o chmod.o chown.o ckeditor.o cp.o createthread.o default.o download.o emacs.o functionbase.o functionparser.o functions.o funthread.o last.o ln.o login.o logout.o ls.o mkdir.o mv.o node.o priv.o privchanger.o reload.o rm.o run.o specialdefault.o stat.o subject.o template.o tinymce.o uname.o upload.o uptime.o vim.o who.o

View File

@ -7,7 +7,6 @@
*
*/
#include <errno.h>
#include "cp.h"
#include "core/misc.h"
#include "functions.h"
@ -22,11 +21,17 @@ Cp::Cp()
}
bool Cp::CpCheckAccessFrom()
bool Cp::HasAccess()
{
return CheckAccessFrom();
}
bool Cp::CheckAccessFrom()
{
if( request->is_item )
{
if( !system->HasReadAccess(request->item) )
if( !system->HasReadAccess(request->item) || request->item.type == Item::symlink )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
@ -39,22 +44,15 @@ bool Cp::CpCheckAccessFrom()
request->status = WINIX_ERR_PERMISSION_DENIED;
}
return true;
}
bool Cp::CheckAccessTo(long dir_id)
bool Cp::CheckAccessTo()
{
Item * pdir = system->dirs.GetDir(dir_id);
if( !pdir )
{
request->status = WINIX_ERR_INCORRECT_DIR;
return false;
}
if( !system->HasReadExecAccessToPath(dir_id) || !system->HasWriteAccess(*pdir) )
if( dir_tab.empty() ||
!system->HasReadExecAccessToPath(dir_tab) ||
!system->HasWriteAccess(*dir_tab.back()) )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
@ -65,157 +63,230 @@ return true;
bool Cp::ParseDir(long & dir_id, std::wstring & dir, std::wstring & file)
bool Cp::ParseDir()
{
int res = system->dirs.AnalyzePath(request->PostVar(L"to"), dir_id, dir, file);
const std::wstring & new_dir = request->PostVar(L"to");
int res = system->dirs.FollowLink(request->dir_tab, new_dir, dir_tab, file);
if( res == 1 )
if( res == 3 )
request->status = WINIX_ERR_NO_ROOT_DIR;
else
if( res != 0 )
if( res != 0 && res != 1 )
request->status = WINIX_ERR_INCORRECT_DIR;
return res == 0;
return res == 0 || res == 1;
}
void Cp::CpStaticFile(Item & item)
bool Cp::CopyStaticFile(const std::wstring & from, const std::wstring & to)
{
bool res1 = system->MakeFilePath(item, old_path);
bool res2 = system->CreateNewFile(item);
bool res3 = system->MakeFilePath(item, mv_new_path, false, true, config->upload_dirs_chmod);
if( from == to )
{
log << log3 << "Cp: the same path to a static file: " << to << logend;
return true;
}
if( !res1 || !res2 || !res3 )
if( ::CopyFile(from, to) )
{
log << log2 << "Cp: copied a static file from: " << from << ", to: " << to << logend;
return true;
}
else
{
log << log1 << "Cp: can't copy a file from: " << from << ", to: " << to << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
}
}
void Cp::CopyStaticFile(Item & item)
{
bool res1, res2, res3, res4, res5;
res1 = system->MakeFilePath(item, old_path, false);
res2 = !item.has_thumb || system->MakeFilePath(item, old_path_thumb, true);
res3 = system->CreateNewFile(item);
res4 = system->MakeFilePath(item, new_path, false, true, config->upload_dirs_chmod);
res5 = !item.has_thumb || system->MakeFilePath(item, new_path_thumb, true, true, config->upload_dirs_chmod);
if( !res1 || !res2 || !res3 || !res4 || !res5 )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( CopyFile(old_path, mv_new_path) )
{
log << log1 << "Cp: copied static file from: " << old_path << ", to: " << mv_new_path << logend;
request->status = db->EditFileById(item, item.id);
}
else
if( CopyStaticFile(old_path, new_path) )
{
log << log1 << "Cp: can't copy a file from: " << old_path << ", to: " << mv_new_path << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
request->status = db->EditFileById(item, item.id);
if( item.has_thumb )
CopyStaticFile(old_path_thumb, new_path_thumb);
}
}
void Cp::CpSetNewAttributes(Item & item)
void Cp::SetNewAttributes(Item & item)
{
item.user_id = cp_new_user;
item.group_id = cp_new_group;
item.user_id = new_user;
item.group_id = new_group;
item.SetDateModifyToNow();
}
void Cp::CpItem(Item & item, long dst_dir_id)
void Cp::CopyFile(Item & item, long dst_dir_id)
{
if( !system->HasReadAccess(item) )
return; // !! w przyszlosci bedziemy dodawac komunikaty do specjalnej tablicy (narazie nie zaimplementowane)
if( !preserve_attr )
SetNewAttributes(item);
item.parent_id = dst_dir_id;
if( !cp_preserve_attr )
CpSetNewAttributes(item);
request->status = system->AddFile(item);
item.parent_id = dst_dir_id;
request->status = db->AddItem(item);
if( request->status == WINIX_ERR_OK )
{
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
CpStaticFile(item);
CopyStaticFile(item);
}
}
void Cp::CopyFileOrSymlink(Item & item, long dst_dir_id)
{
if( !system->HasReadAccess(item) )
return; // !! w przyszlosci bedziemy dodawac komunikaty do specjalnej tablicy (narazie nie zaimplementowane)
if( item.type == Item::symlink && follow_symlinks )
{
if( system->dirs.CreateDirTab(item.parent_id, symlink_dir_tab) )
{
int res = system->FollowAllLinks(symlink_dir_tab, item.link_to, symlink_dir_tab, item);
if( res == 0 )
CopyDirTree(*symlink_dir_tab.back(), dst_dir_id);
else
if( res == 1 )
CopyFile(item, dst_dir_id);
}
}
else
{
CopyFile(item, dst_dir_id);
}
}
void Cp::CpPrepare()
void Cp::Prepare()
{
cp_iq.SetAll(true, false);
cp_iq.WhereType(Item::file);
iq.SetAll(true, false);
iq.WhereType(Item::dir, false);
cp_new_user = -1;
cp_new_group = -1;
new_user = -1;
new_group = dir_tab.back()->group_id;
if( request->session->puser )
cp_new_user = request->session->puser->id;
new_user = request->session->puser->id;
Item * pdir = system->dirs.GetDir(mv_dir_id);
if( pdir )
cp_new_group = pdir->group_id;
loop_checker.clear();
}
void Cp::CpFilesInDir(const Item & dir, long dst_dir_id)
{
cp_iq.WhereParentId(dir.id);
db->GetItems(request->item_tab, cp_iq);
for(size_t i=0 ; i<request->item_tab.size() ; ++i)
CpItem(request->item_tab[i], dst_dir_id);
void Cp::CopyFilesInDir(const Item & dir, long dst_dir_id)
{
iq.WhereParentId(dir.id);
db->GetItems(item_tab, iq);
for(size_t i=0 ; i<item_tab.size() ; ++i)
CopyFileOrSymlink(item_tab[i], dst_dir_id);
}
void Cp::CpContentOfDir(const Item & item, long dst_dir_id)
void Cp::CopyDirContentTree(const Item & dir, long dst_dir_id)
{
DirContainer::ParentIterator i = system->dirs.FindFirstParent(item.id);
DirContainer::ParentIterator i = system->dirs.FindFirstChild(dir.id);
// go through all directories
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextParent(i) )
CpDir(*(i->second), dst_dir_id);
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextChild(i) )
CopyDirTree(*(i->second), dst_dir_id);
CpFilesInDir(item, dst_dir_id);
CopyFilesInDir(dir, dst_dir_id);
}
bool Cp::WasThisDir(const Item & dir)
{
for(size_t i=0 ; i<loop_checker.size() ; ++i)
if( loop_checker[i] == dir.id )
return true;
return false;
}
// we shouldn't change 'item' because we have references to our app.dirs objects
long Cp::CpDir(const Item & item, long dst_dir_id)
long Cp::CopyDirTree(const Item & dir, long dst_dir_id)
{
cp_temp = item;
cp_temp.parent_id = dst_dir_id;
if( !mv_file.empty() )
if( WasThisDir(dir) )
{
cp_temp.url = mv_file;
mv_file.clear();
functions->PrepareUrl(cp_temp);
log << log1 << "Cp: a loop between directories found (created by a symlink), "
<< "dir_id: " << dir.id << ", dir_url: " << dir.url << logend;
return -1;
}
if( !cp_preserve_attr )
CpSetNewAttributes(cp_temp);
loop_checker.push_back(dir.id);
temp = dir;
temp.parent_id = dst_dir_id;
if( cp_remove_defaults )
cp_temp.default_item = -1;
if( !file.empty() )
{
temp.url = file;
functions->PrepareUrl(temp);
file.clear();
}
request->status = system->dirs.AddDirectory(cp_temp);
long new_dir_id = cp_temp.id; // remember the new dir_id
if( !preserve_attr )
SetNewAttributes(temp);
if( system->HasReadExecAccess(item) )
CpContentOfDir(item, cp_temp.id);
if( remove_defaults )
{
temp.link_to.clear();
temp.link_redirect = 0;
}
request->status = system->dirs.AddDirectory(temp);
loop_checker.push_back(temp.id);
// remember the new dir_id because temp can be changed
// this method is called in recurrences
long new_dir_id = temp.id;
if( system->HasReadExecAccess(dir) )
CopyDirContentTree(dir, temp.id);
return new_dir_id; // and return it
}
bool Cp::IsTheSameFile(const Item & item)
{
if( mv_file.empty() )
if( file.empty() )
{
if( item.parent_id == mv_dir_id )
if( item.parent_id == dir_tab.back()->id )
return true; // nothing to do
}
else
{
if( item.parent_id == mv_dir_id && item.url == mv_file )
if( item.parent_id == dir_tab.back()->id && item.url == file )
return true; // nothing to do
}
@ -226,101 +297,94 @@ return false;
// here 'item' can be changed in place
void Cp::CpItemCheck(Item & item, bool redirect)
void Cp::PostCopyFile(Item & item, bool redirect)
{
if( IsTheSameFile(item) )
return;
if( !mv_file.empty() )
if( !file.empty() )
{
item.url = mv_file;
item.url = file;
functions->PrepareUrl(item);
file.clear();
}
CpItem(item, mv_dir_id);
CopyFileOrSymlink(item, dir_tab.back()->id);
if( request->status==WINIX_ERR_OK && redirect )
if( request->status == WINIX_ERR_OK && redirect )
system->RedirectTo(item);
}
void Cp::CpContentOfDirCheck(const Item & item, bool redirect)
void Cp::PostCopyDirContent(const Item & dir, bool redirect)
{
if( !mv_file.empty() )
if( !file.empty() )
{
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
if( mv_dir_id == item.id )
if( dir_tab.back()->id == dir.id )
return; // nothing to do
if( system->dirs.HasParent(mv_dir_id, item.id) )
{
log << log1 << "Content: cannot copy directory to inside it" << logend;
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
CopyDirContentTree(dir, dir_tab.back()->id);
CpContentOfDir(item, mv_dir_id);
if( request->status==WINIX_ERR_OK && redirect )
system->RedirectTo(mv_dir_id);
if( request->status == WINIX_ERR_OK && redirect )
system->RedirectTo(dir_tab.back()->id);
}
void Cp::CpDirCheck(const Item & item, bool redirect)
void Cp::PostCopyDir(const Item & dir, bool redirect)
{
if( mv_file.empty() && mv_dir_id == item.id )
long dir_id = dir_tab.back()->id;
if( file.empty() && dir_id == dir.id )
return; // nothing to do
if( mv_dir_id == item.id || system->dirs.HasParent(mv_dir_id, item.id) )
{
log << log1 << "Content: cannot copy directory to inside it" << logend;
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
long new_dir_id = CopyDirTree(dir, dir_id);
long new_dir_id = CpDir(item, mv_dir_id);
if( request->status==WINIX_ERR_OK && redirect )
if( new_dir_id != -1 && request->status == WINIX_ERR_OK && redirect )
system->RedirectTo(new_dir_id);
}
void Cp::MakePost()
void Cp::Clear()
{
if( CpCheckAccessFrom() &&
ParseDir(mv_dir_id, mv_dir, mv_file) &&
CheckAccessTo(mv_dir_id) )
{
CpPrepare();
cp_preserve_attr = request->IsPostVar(L"preserveattr");
if( request->is_item )
{
CpItemCheck(request->item);
}
else
{
cp_remove_defaults = request->IsPostVar(L"removedefaults");
if( request->IsPostVar(L"onlycontent") )
CpContentOfDirCheck(*request->dir_tab.back());
else
CpDirCheck(*request->dir_tab.back());
}
}
loop_checker.clear();
dir_tab.clear();
item_tab.clear();
symlink_dir_tab.clear();
}
void Cp::MakeGet()
void Cp::MakePost()
{
CpCheckAccessFrom();
if( ParseDir() && CheckAccessTo() )
{
Prepare();
preserve_attr = request->IsPostVar(L"preserveattr");
remove_defaults = request->IsPostVar(L"removedefaults");
follow_symlinks = request->IsPostVar(L"followsymlinks");
if( request->is_item )
{
PostCopyFile(request->item);
}
else
{
if( request->IsPostVar(L"onlycontent") )
PostCopyDirContent(*request->dir_tab.back());
else
PostCopyDir(*request->dir_tab.back());
}
Clear();
}
}

View File

@ -18,45 +18,58 @@ namespace Fun
{
class Cp : public FunctionBase
{
public:
Cp();
bool HasAccess();
void MakePost();
private:
// !! wywalic przedrostki cp_ Cp
Item temp;
DbItemQuery iq;
bool remove_defaults;
bool preserve_attr;
bool follow_symlinks;
long new_user;
long new_group;
Item cp_temp;
DbItemQuery cp_iq;
bool cp_remove_defaults;
bool cp_preserve_attr;
long cp_new_user;
long cp_new_group;
// destination dir (will not be empty)
std::vector<Item*> dir_tab, symlink_dir_tab;
std::wstring mv_dir;
std::wstring mv_file;
std::wstring mv_new_path;
std::wstring old_path;
long mv_dir_id;
// for testing loops in directories (between symlinks)
std::vector<long> loop_checker;
bool CpCheckAccessFrom();
bool CheckAccessTo(long dir_id);
bool ParseDir(long & dir_id, std::wstring & dir, std::wstring & file);
void CpStaticFile(Item & item);
void CpSetNewAttributes(Item & item);
void CpItem(Item & item, long dst_dir_id);
void CpPrepare();
void CpFilesInDir(const Item & dir, long dst_dir_id);
void CpContentOfDir(const Item & item, long dst_dir_id);
long CpDir(const Item & item, long dst_dir_id);
// destination file (if exists)
std::wstring file;
// for copying static files
std::wstring new_path, new_path_thumb;
std::wstring old_path, old_path_thumb;
std::vector<Item> item_tab;
bool WasThisDir(const Item & dir);
bool CheckAccessFrom();
bool CheckAccessTo();
bool ParseDir();
bool CopyStaticFile(const std::wstring & from, const std::wstring & to);
void CopyStaticFile(Item & item);
void SetNewAttributes(Item & item);
void CopyFile(Item & item, long dst_dir_id);
void CopyFileOrSymlink(Item & item, long dst_dir_id);
void Prepare();
void CopyFilesInDir(const Item & dir, long dst_dir_id);
void CopyDirContentTree(const Item & item, long dst_dir_id);
long CopyDirTree(const Item & item, long dst_dir_id);
bool IsTheSameFile(const Item & item);
void CpItemCheck(Item & item, bool redirect = true);
void CpContentOfDirCheck(const Item & item, bool redirect = true);
void CpDirCheck(const Item & item, bool redirect = true);
void MakePost();
void MakeGet();
void Clear();
void PostCopyFile(Item & item, bool redirect = true);
void PostCopyDirContent(const Item & dir, bool redirect = true);
void PostCopyDir(const Item & dir, bool redirect = true);
};

View File

@ -11,7 +11,7 @@
#include "functions.h"
namespace Fun
namespace Thread
{
CreateThread::CreateThread()

View File

@ -7,14 +7,14 @@
*
*/
#ifndef headerfilecmslucontentcreatethread
#define headerfilecmslucontentcreatethread
#ifndef headerfile_winix_plugins_thread_createthread
#define headerfile_winix_plugins_thread_createthread
#include "functionbase.h"
#include "functions/functionbase.h"
namespace Fun
namespace Thread
{

View File

@ -20,103 +20,33 @@ Default::Default()
}
long Default::PostFunDefaultParsePath()
bool Default::HasAccess()
{
Item * pdir, * pdir2;
long defaultid = -1;
const std::wstring & path = request->PostVar(L"defaultitem");
if( !path.empty() )
{
std::wstring dir, file;
Dirs::SplitPath(path, dir, file);
pdir = system->dirs.GetDir(dir);
if( !pdir )
throw Error(WINIX_ERR_INCORRECT_DIR);
if( file.empty() )
{
defaultid = pdir->id;
}
else
{
// checking whether the file is a directory too (the method SplitPath does not check it)
pdir2 = system->dirs.GetDir(file, pdir->id);
if( !pdir2 )
{
defaultid = db->GetFileId(pdir->id, file);
if( defaultid == -1 )
throw Error(WINIX_ERR_NO_ITEM);
}
else
{
// file is a directory
defaultid = pdir2->id;
}
}
}
return defaultid;
return !request->is_item && system->HasWriteAccess(*request->dir_tab.back());
}
void Default::MakePost()
{
if( !system->HasWriteAccess(*request->dir_tab.back()) )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
Item & dir = *request->dir_tab.back();
try
{
long defaultid = PostFunDefaultParsePath();
dir.link_to = request->PostVar(L"linkto");
dir.link_redirect = request->IsPostVar(L"makeredirect") ? 1 : 0;
TrimWhite(dir.link_to);
if( defaultid != request->dir_tab.back()->id )
{
request->status = db->EditDefaultItem(request->dir_tab.back()->id, defaultid);
if( request->status == WINIX_ERR_OK )
request->dir_tab.back()->default_item = defaultid;
}
else
{
log << "Default: skipping the same directory" << logend;
}
}
catch(const Error & e)
{
request->status = e;
}
// !! dodac sprawdzenie czy link_to jest pusty teraz
request->status = db->EditLinkItem(dir.id, dir.link_to, dir.link_redirect);
if( request->status == WINIX_ERR_OK )
system->RedirectTo(*request->dir_tab.back());
else
log << log1 << "Content: PostFunDefaultItem: Error: " << request->status << logend;
}
void Default::MakeGet()
{
if( !system->HasWriteAccess(*request->dir_tab.back()) )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
log << log2 << "Default: changed link_to: " << dir.link_to << ", for dir_id: " << dir.id << logend;
system->RedirectToLastDir();
}
}
} // namespace

View File

@ -23,12 +23,8 @@ class Default : public FunctionBase
public:
Default();
bool HasAccess();
void MakePost();
void MakeGet();
private:
long PostFunDefaultParsePath();
};

View File

@ -127,7 +127,6 @@ void Emacs::MakePost()
if( !PostEmacsCheckAbuse(adding) )
return;
if( adding )
{
request->is_item = true; // !! moze lepiej nie ustawiac is_item? (bo jak wystapi blad np dodania do bazy danych
@ -140,7 +139,6 @@ void Emacs::MakePost()
request->status = system->EditFile(request->item, request->item.url != old_url, NotifyCodeEdit());
}
if( request->status == WINIX_ERR_OK )
{
PostFunEmacsModifyMountPoint(adding);
@ -148,8 +146,7 @@ void Emacs::MakePost()
}
else
{
log << log1 << "Emacs: error: "
<< request->status << logend;
log << log1 << "Emacs: error: " << request->status << logend;
}
}

View File

@ -15,6 +15,7 @@
FunctionBase::FunctionBase()
{
id = -1;
follow_symlinks = true;
fun.user_id = -1;
fun.group_id = -1;
@ -82,12 +83,6 @@ bool FunctionBase::HasAccess()
}
void FunctionBase::Clear()
{
// this method is called at the end of a request
// you can clear your variables
}
void FunctionBase::MakePost()
{

View File

@ -27,6 +27,7 @@ class Templates;
class FunctionBase
{
public:
@ -41,9 +42,11 @@ public:
// user, group, permissions, url (function name)
Item fun;
// auto follow sym links, default: true
bool follow_symlinks;
virtual void Init();
virtual bool HasAccess();
virtual void Clear();
virtual void MakePost();
virtual void MakeGet();

View File

@ -72,7 +72,7 @@ void FunctionParser::ParseItem()
return;
// request->dir_tab has at least one element
long parent_id = request->dir_tab.back()->id;
long parent_id = request->dir_tab.back()->id;
const std::wstring & url = request->get_tab[get_index];
request->status = db->GetItem(parent_id, url, request->item);
@ -171,7 +171,6 @@ void FunctionParser::ParseParams()
void FunctionParser::Parse(Request * prequest, Db * pdb, Functions * pfunctions, System * psystem)
{
request = prequest;
@ -198,7 +197,7 @@ void FunctionParser::Parse(Request * prequest, Db * pdb, Functions * pfunctions,
if( request->status != WINIX_ERR_OK )
return;
ParseFunction();
if( !request->function && get_index != get_tab_len )

View File

@ -123,7 +123,7 @@ Error Functions::CheckSpecialFile(const Item & item)
Error status = system->mounts.ReadMounts(item.content);
templates->ReadNewIndexTemplates();
return status;
}
@ -183,6 +183,7 @@ void Functions::CreateFunctions()
Add(fun_last);
Add(fun_login);
Add(fun_logout);
Add(fun_ln);
Add(fun_ls);
Add(fun_mkdir);
Add(fun_mv);
@ -248,33 +249,26 @@ void Functions::SetDefaultFunctionForFile()
void Functions::SetDefaultFunctionForDir()
{
long default_item = request->dir_tab.back()->default_item;
if( default_item != -1 )
{
log << log3 << "Functions: Default item: id: " << default_item << logend;
system->RedirectTo(default_item);
}
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
request->function = &fun_thread;
else
{
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
request->function = &fun_thread;
else
request->function = &fun_ls;
request->function = &fun_ls;
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
}
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
}
void Functions::SetDefaultFunction()
{
request->function = 0;
plugin.Call(WINIX_SELECT_DEFAULT_FUNCTION);
if( request->function )
{
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
log << log3 << "Functions: default function: " << request->function->fun.url
<< " (set by a plugin)" << logend;
return;
}
@ -287,75 +281,120 @@ void Functions::SetDefaultFunction()
void Functions::MakeGet()
void Functions::CheckFunctionFollowDir(bool was_default_function)
{
if( request->role == Request::authorizer )
// directory with 'default' flag
if( was_default_function )
{
// in authorizer mode only cat function is available
// (and must be default)
if( request->function )
if( request->dir_tab.back()->link_redirect == 1 )
{
request->status = WINIX_ERR_NO_ITEM;
log << log1 << "Functions: in authorizer mode only 'cat' funtion is available and must "
"be default (not in the url)" << logend;
return;
system->RedirectTo(request->dir_tab.back()->link_to);
}
else
{
if( system->FollowAllLinks(request->dir_tab.back()->link_to, true, true) )
SetDefaultFunction();
}
request->function = &fun_cat;
}
}
void Functions::CheckFunctionFollowSymlink(bool was_default_function)
{
if( request->item.link_redirect == 1 )
{
if( was_default_function )
system->RedirectTo(request->item.link_to);
else
system->RedirectWithFunctionAndParamsTo(request->item.link_to);
}
else
if( system->FollowAllLinks(request->item.link_to, true, true) )
{
if( was_default_function )
SetDefaultFunction();
if( request->status == WINIX_ERR_OK && !request->redirect_to.empty() && !was_default_function && request->function )
{
// !! nie jestem pewny dodania tej nowej funkcji do redirecta... (sprawdzic to)
request->redirect_to += '/';
request->redirect_to += request->function->fun.url;
system->AddParams(request->param_tab, request->redirect_to, false);
}
}
}
// making a proper redirection from a directory with 'default' flag
// or from a symlink (or just loading it if there is no redirection flag set)
void Functions::CheckFunctionAndSymlink()
{
bool was_default_function = false;
if( !request->function || request->function == &fun_special_default )
{
was_default_function = true;
SetDefaultFunction();
}
if( !request->redirect_to.empty() )
if( request->status != WINIX_ERR_OK || !request->redirect_to.empty() )
return;
if( !request->function )
if( !request->is_item && !request->dir_tab.back()->link_to.empty() )
CheckFunctionFollowDir(was_default_function);
else
if( request->is_item && request->item.type == Item::symlink && request->function && request->function->follow_symlinks )
CheckFunctionFollowSymlink(was_default_function);
}
void Functions::MakeFunction()
{
if( !request->function )
{
request->status = WINIX_ERR_NO_FUNCTION;
log << log1 << "Functions: no function (neither cat nor ls)" << logend;
return;
}
if( !system->HasReadExecAccess(request->function->fun) || !request->function->HasAccess() )
if( !system->DirsHaveReadExecPerm() ||
!system->HasReadExecAccess(request->function->fun) ||
!request->function->HasAccess() )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
request->function->MakeGet();
if( request->method == Request::get )
{
if( request->redirect_to.empty() )
request->function->MakeGet();
}
else
if( request->method == Request::post )
{
// we don't use post with redirecting (the post variables would be lost)
if( request->redirect_to.empty() )
request->function->MakePost();
else
request->status = WINIX_ERR_PERMISSION_DENIED;
}
else
if( request->method == Request::head )
{
// do nothing
}
else
log << log1 << "Functions: unknown request method (skipping)" << logend;
}
void Functions::MakePost()
{
if( request->role == Request::authorizer )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( !request->function || request->function == &fun_special_default )
SetDefaultFunction();
if( !request->function )
{
request->status = WINIX_ERR_NO_FUNCTION;
log << log1 << "Functions: MakePost: no function" << logend;
return;
}
if( !system->HasReadExecAccess(request->function->fun) || !request->function->HasAccess() )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
request->function->MakePost();
}
void Functions::CheckGetPostTimes(time_t difference)
@ -505,6 +544,7 @@ void Functions::ReadItemContentWithType(Item & item)
// item_type - the type of an item you are expecting to read
// returns true if the url has to be changed
// at the moment this is only checked for Item::file - for Item::dir it returns always true
// !! zmienic nazwe na ReadUrlSubjectContent
void Functions::ReadItem(Item & item, Item::Type item_type)
{
if( item_type == Item::none )

View File

@ -26,6 +26,7 @@
#include "last.h"
#include "login.h"
#include "logout.h"
#include "ln.h"
#include "ls.h"
#include "mkdir.h"
#include "mv.h"
@ -69,6 +70,7 @@ public:
Fun::Last fun_last;
Fun::Login fun_login;
Fun::Logout fun_logout;
Fun::Ln fun_ln;
Fun::Ls fun_ls;
Fun::Mkdir fun_mkdir;
Fun::Mv fun_mv;
@ -99,8 +101,9 @@ public:
Iterator Begin();
Iterator End();
void MakeGet();
void MakePost();
void CheckFunctionAndSymlink();
void MakeFunction();
void SetConfig(Config * pconfig);
void SetRequest(Request * prequest);
@ -145,6 +148,7 @@ private:
std::wstring temp;
HTMLFilter html_filter;
std::wstring link_to_temp;
void CreateFunctions();
void InitFunctions();
@ -158,6 +162,11 @@ private:
Table table;
FunctionParser function_parser;
void CheckFunctionFollowDir(bool was_default_function);
void CheckFunctionFollowSymlink(bool was_default_function);
};
#endif

View File

@ -12,7 +12,7 @@
#include "funthread.h"
namespace Fun
namespace Thread
{
FunThread::FunThread()
@ -31,7 +31,6 @@ bool FunThread::HasAccess()
void FunThread::Clear()
{
is_thread = false;
thread.Clear();
thread_tab.clear();
}
@ -80,6 +79,8 @@ void FunThread::MakeGet()
CreateSortIndexByDate();
std::sort(thread_tab.begin(), thread_tab.end(), FunThreadSort);
Clear();
}

View File

@ -7,14 +7,14 @@
*
*/
#ifndef headerfilecmslucontentthread
#define headerfilecmslucontentthread
#ifndef headerfile_winix_plugins_thread_funthread
#define headerfile_winix_plugins_thread_funthread
#include "functionbase.h"
#include "functions/functionbase.h"
#include "core/thread.h"
namespace Fun
namespace Thread
{
@ -24,7 +24,6 @@ public:
FunThread();
bool HasAccess();
void Clear();
void MakeGet();
// current thread (if exists)
@ -36,6 +35,7 @@ private:
static bool FunThreadSort(const Thread & t1, const Thread & t2);
void CreateSortIndexByDate();
void Clear();
};

111
functions/ln.cpp Executable file
View File

@ -0,0 +1,111 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "ln.h"
#include "core/misc.h"
#include "functions/functions.h"
namespace Fun
{
Ln::Ln()
{
fun.url = L"ln";
}
bool Ln::HasAccess()
{
return system->HasWriteAccess(*request->dir_tab.back());
}
void Ln::CreateSymbolicLink(const std::wstring & link_to)
{
item.Clear(); // setting the date to now
item.type = Item::symlink;
item.parent_id = request->dir_tab.back()->id;
item.url = request->PostVar(L"url");
item.link_to = link_to;
item.link_redirect = request->IsPostVar(L"makeredirect") ? 1 : 0;
item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
functions->SetUser(item);
functions->PrepareUrl(item);
request->status = db->AddItem(item);
if( request->status == WINIX_ERR_OK )
log << log3 << "Ln: created a symbolic link to: " << link_to << logend;
}
void Ln::CreateHardLink(const std::wstring & link_to)
{
int res = system->FollowAllLinks(request->dir_tab, link_to, dir_tab, item, false, false);
if( res == 0 )
{
log << log2 << "Ln: " << link_to << " is a directory (can't create a hard link)" << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
}
else
if( res == 1 )
{
item.SetDateToNow();
item.type = Item::file;
item.parent_id = request->dir_tab.back()->id;
item.url = request->PostVar(L"url");
item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
functions->SetUser(item);
functions->PrepareUrl(item);
request->status = db->AddHardLink(item);
if( request->status == WINIX_ERR_OK )
log << log3 << "Ln: created a hard link to: " << link_to << logend;
}
else
if( res == 5 || res == 6 )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
}
else
{
request->status = WINIX_ERR_NO_ITEM;
}
}
// we do not use notifications for links
void Ln::MakePost()
{
link_to = request->PostVar(L"linkto");
TrimWhite(link_to);
if( link_to.empty() )
return;
int type = Toi(request->PostVar(L"linktype"));
if( type == 0 )
CreateHardLink(link_to);
else
CreateSymbolicLink(link_to);
if( request->status == WINIX_ERR_OK )
system->RedirectTo(item);
}
} // namespace

42
functions/ln.h Executable file
View File

@ -0,0 +1,42 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucontentln
#define headerfilecmslucontentln
#include "functionbase.h"
namespace Fun
{
class Ln : public FunctionBase
{
public:
Ln();
bool HasAccess();
void CreateSymbolicLink(const std::wstring & link_to);
void CreateHardLink(const std::wstring & link_to);
void MakePost();
private:
Item item;
std::wstring link_to;
std::vector<Item*> dir_tab;
};
} // namespace
#endif

View File

@ -30,7 +30,7 @@ void Ls::MakeGet()
iq.sel_content = false;
iq.WhereParentId(request->dir_tab.back()->id);
iq.WhereType(Item::file);
iq.WhereType(Item::dir, false);
if( request->IsParam(L"ckeditor_browse") )
{

View File

@ -18,25 +18,38 @@ namespace Fun
Mv::Mv()
{
fun.url = L"mv";
follow_symlinks = false;
}
bool Mv::MoveCheckAccessFromToDir()
bool Mv::HasAccess()
{
return CheckAccessFrom();
}
bool Mv::CheckAccessFromToDir()
{
Item * last;
Item * last_but_one = 0;
size_t dir_tab_size;
last = request->dir_tab[request->dir_tab.size()-1];
last = request->dir_tab.back();
dir_tab_size = request->dir_tab.size();
if( request->dir_tab.size() >= 2 )
last_but_one = request->dir_tab[request->dir_tab.size()-2];
if( dir_tab_size <= 1 )
return false; // you cannot move the root directory
last_but_one = request->dir_tab[dir_tab_size - 2];
if( request->method != Request::post )
{
// used in GET or HEAD
// we don't now whether we move the last directory or the last but one
// it depends on the 'onlycontent' parameter
if( !system->HasWriteAccess(*last) &&
(!last_but_one || !system->HasWriteAccess(*last_but_one)) )
if( !system->HasWriteAccess(*last) && !system->HasWriteAccess(*last_but_one) )
return false;
}
else
@ -46,10 +59,7 @@ Item * last_but_one = 0;
if( request->IsPostVar(L"onlycontent") )
return system->HasWriteAccess(*last);
else
if( last_but_one )
return system->HasWriteAccess(*last_but_one);
else
return false; // you cannot move the root directory
}
return true;
@ -57,7 +67,8 @@ return true;
bool Mv::MoveCheckAccessFrom()
bool Mv::CheckAccessFrom()
{
if( request->is_item )
{
@ -71,7 +82,7 @@ bool Mv::MoveCheckAccessFrom()
}
else
{
if( !MoveCheckAccessFromToDir() )
if( !CheckAccessFromToDir() )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
@ -82,17 +93,11 @@ return true;
}
bool Mv::MoveCheckAccessTo(long dir_id)
bool Mv::CheckAccessTo()
{
Item * pdir = system->dirs.GetDir(dir_id);
if( !pdir )
{
request->status = WINIX_ERR_INCORRECT_DIR;
return false;
}
if( !system->HasReadExecAccessToPath(dir_id) || !system->HasWriteAccess(*pdir) )
if( dir_tab.empty() ||
!system->HasReadExecAccessToPath(dir_tab) ||
!system->HasWriteAccess(*dir_tab.back()) )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
@ -103,85 +108,222 @@ return true;
bool Mv::MoveCheckMountPoints(long dir_id)
bool Mv::ParseDir()
{
/*
Mount * new_mount = system->mounts.CalcMount(dir_id);
if( !new_mount )
{
if( system->mounts.pmount->type != system->mounts.MountTypeCms() )
{
request->status = WINIX_DIFFERENT_MOUNT_POINTS;
return false;
}
const std::wstring & new_dir = request->PostVar(L"to");
int res = system->dirs.FollowLink(request->dir_tab, new_dir, dir_tab, file);
return true;
}
if( res == 3 )
request->status = WINIX_ERR_NO_ROOT_DIR;
else
if( res != 0 && res != 1 )
request->status = WINIX_ERR_INCORRECT_DIR;
if( new_mount->type != system->mounts.pmount->type )
{
request->status = WINIX_DIFFERENT_MOUNT_POINTS;
return false;
}
*/
return true;
return res == 0 || res == 1;
}
bool Mv::MoveParseDir(long & dir_id, std::wstring & dir, std::wstring & file)
bool Mv::MoveStaticFile(const std::wstring & from, const std::wstring & to)
{
int res = system->dirs.AnalyzePath(request->PostVar(L"to"), dir_id, dir, file);
if( from == to )
{
log << log3 << "Mv: the same path to a static file: " << to << " (skipped)" << logend;
return true;
}
if( res == 1 )
request->status = WINIX_ERR_NO_ROOT_DIR;
if( RenameFile(from, to) )
{
log << log2 << "Mv: moved static file from: " << from << ", to: " << to << logend;
return true;
}
else
if( res != 0 )
request->status = WINIX_ERR_INCORRECT_DIR;
return res == 0;
{
log << log1 << "Mv: can't move a file from: " << from << ", to: " << to << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
}
}
void Mv::MoveStaticFile(Item & item)
{
bool res1 = system->MakeFilePath(item, old_path);
bool res2 = system->CreateNewFile(item);
bool res3 = system->MakeFilePath(item, mv_new_path, false, true, config->upload_dirs_chmod);
bool res1, res2, res3, res4, res5;
res1 = system->MakeFilePath(item, old_path, false);
res2 = !item.has_thumb || system->MakeFilePath(item, old_path_thumb, true);
res3 = system->CreateNewFile(item);
res4 = system->MakeFilePath(item, new_path, false, true, config->upload_dirs_chmod);
res5 = !item.has_thumb || system->MakeFilePath(item, new_path_thumb, true, true, config->upload_dirs_chmod);
if( !res1 || !res2 || !res3 )
if( !res1 || !res2 || !res3 || !res4 || !res5 )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( RenameFile(old_path, mv_new_path) )
{
log << log1 << "Mv: moved static file from: " << old_path << ", to: " << mv_new_path << logend;
request->status = db->EditFileById(item, item.id);
}
else
if( MoveStaticFile(old_path, new_path) )
{
log << log1 << "Mv: can't move a file from: " << old_path << ", to: " << mv_new_path << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
request->status = db->EditFileById(item, item.id);
if( item.has_thumb )
MoveStaticFile(old_path_thumb, new_path_thumb);
}
}
bool Mv::MoveIsTheSameFile(const Item & item)
void Mv::MoveFileOrSymlink(Item & item)
{
if( mv_file.empty() )
old_url = item.url;
if( !file.empty() )
{
if( item.parent_id == mv_dir_id )
item.url = file;
functions->PrepareUrl(item);
file.clear();
}
item.parent_id = dir_tab.back()->id;
request->status = db->EditParentUrlById(item, item.id);
if( request->status == WINIX_ERR_OK )
{
if( item.type == Item::file )
log << log3 << "Mv: file: ";
else
log << log3 << "Mv: symlink: ";
log << old_url << " was moved to: ";
system->dirs.LogDir(dir_tab);
log << item.url << logend;
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
MoveStaticFile(item);
}
}
void Mv::MoveDirContent(const Item & dir)
{
content_dir_iq.WhereParentId(dir.id);
db->GetItems(item_tab, content_dir_iq);
for(size_t i=0 ; i<item_tab.size() ; ++i)
{
if( item_tab[i].type == Item::dir )
MoveDir(item_tab[i]);
else
MoveFileOrSymlink(item_tab[i]);
}
}
void Mv::Prepare()
{
content_dir_iq.SetAll(false, false);
content_dir_iq.sel_parent_id = true;
content_dir_iq.sel_type = true;
content_dir_iq.sel_url = true;
content_dir_iq.sel_file = true;
static_iq.SetAll(false, false);
static_iq.sel_parent_id = true;
static_iq.sel_type = true;
static_iq.sel_url = true;
static_iq.sel_file = true;
static_iq.WhereType(Item::file);
static_iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE, false);
}
void Mv::Clear()
{
dir_tab.clear();
static_item_tab.clear();
item_tab.clear();
}
void Mv::MoveStaticFilesTree(const Item & dir)
{
DirContainer::ParentIterator i = system->dirs.FindFirstChild(dir.id);
// go through all directories
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextChild(i) )
MoveStaticFilesTree(*(i->second));
static_iq.WhereParentId(dir.id);
db->GetItems(static_item_tab, static_iq);
for(size_t i=0 ; i<static_item_tab.size() ; ++i)
MoveStaticFile(static_item_tab[i]);
}
void Mv::MoveDir(Item & dir)
{
long dst_dir_id = dir_tab.back()->id;
old_url = dir.url;
if( dst_dir_id == dir.id || system->dirs.HasParent(dst_dir_id, dir.id) )
{
log << log1 << "Mv: cannot move directory to inside it" << logend;
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
if( !system->dirs.ChangeParent(dir.id, dst_dir_id) )
{
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
dir.parent_id = dst_dir_id;
if( !file.empty() )
{
dir.url = file;
functions->PrepareUrl(dir);
file.clear();
}
request->status = db->EditParentUrlById(dir, dir.id);
if( request->status == WINIX_ERR_OK )
{
log << log3 << "Mv: directory: " << old_url << " was moved to: ";
system->dirs.LogDir(dir_tab);
log << dir.url << logend;
MoveStaticFilesTree(dir);
}
}
bool Mv::IsTheSameFile(const Item & item)
{
if( file.empty() )
{
if( item.parent_id == dir_tab.back()->id )
return true; // nothing to do
}
else
{
if( item.parent_id == mv_dir_id && item.url == mv_file )
if( item.parent_id == dir_tab.back()->id && item.url == file )
return true; // nothing to do
}
@ -190,131 +332,48 @@ return false;
void Mv::MoveFile(Item & item, bool redirect)
void Mv::PostMoveFile()
{
if( MoveIsTheSameFile(item) )
if( IsTheSameFile(request->item) )
return;
if( !mv_file.empty() )
{
item.url = mv_file;
functions->PrepareUrl(item);
}
item.parent_id = mv_dir_id;
request->status = db->EditParentUrlById(item, item.id);
MoveFileOrSymlink(request->item);
if( request->status == WINIX_ERR_OK )
{
log << log2 << "Mv: the file was moved to: " << mv_dir << item.url << logend;
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
MoveStaticFile(item);
if( redirect )
system->RedirectTo(item);
}
system->RedirectTo(request->item);
}
void Mv::MoveContentOfDir()
void Mv::PostMoveDirContent()
{
DbItemQuery iq;
iq.sel_parent_id = true;
iq.sel_type = true;
iq.sel_url = true;
iq.sel_file = true;
iq.WhereParentId(request->dir_tab.back()->id);
db->GetItems(request->item_tab, iq);
for(size_t i=0 ; i<request->item_tab.size() ; ++i)
if( !file.empty() )
{
if( request->item_tab[i].type == Item::dir )
MoveDir(request->item_tab[i], false);
else
MoveFile(request->item_tab[i], false);
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
if( request->dir_tab.back()->id == dir_tab.back()->id )
return; // nothing to do
MoveDirContent(*request->dir_tab.back());
system->RedirectToLastDir();
}
void Mv::MoveAuthPrepareQuery()
void Mv::PostMoveDir()
{
mv_auth_iq.SetAll(false, false);
Item & last_dir = *request->dir_tab.back();
Item & new_dir = *dir_tab.back();
mv_auth_iq.sel_parent_id = true;
mv_auth_iq.sel_type = true;
mv_auth_iq.sel_url = true;
mv_auth_iq.sel_file = true;
mv_auth_iq.WhereType(Item::file);
mv_auth_iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE, false);
}
void Mv::MoveAuthContentOfDir(const Item & item)
{
DirContainer::ParentIterator i = system->dirs.FindFirstParent(item.id);
// go through all directories
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextParent(i) )
MoveAuthContentOfDir(*(i->second));
mv_auth_iq.WhereParentId(item.id);
// don't use request->item here (is used in MoveContentOfDir())
db->GetItems(mv_auth, mv_auth_iq);
for(size_t i=0 ; i<mv_auth.size() ; ++i)
MoveStaticFile(mv_auth[i]);
mv_auth.clear();
}
void Mv::MoveDir(Item & item, bool redirect)
{
if( mv_file.empty() && mv_dir_id == item.id )
if( file.empty() && new_dir.id == last_dir.id )
return; // nothing to do
if( mv_dir_id == item.id || system->dirs.HasParent(mv_dir_id, item.id) )
{
log << log1 << "Mv: cannot move directory to inside it" << logend;
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
if( !system->dirs.ChangeParent(item.id, mv_dir_id) )
{
request->status = WINIX_ERR_INCORRECT_DIR;
return;
}
item.parent_id = mv_dir_id;
if( !mv_file.empty() )
{
item.url = mv_file;
functions->PrepareUrl(item);
}
request->status = db->EditParentUrlById(item, item.id);
MoveDir(last_dir);
if( request->status == WINIX_ERR_OK )
{
log << log2 << "Mv: the directory was moved to: " << mv_dir << item.url << logend;
MoveAuthContentOfDir(item);
if( redirect )
system->RedirectToLastDir();
}
system->RedirectToLastDir();
}
@ -322,41 +381,29 @@ void Mv::MoveDir(Item & item, bool redirect)
void Mv::MakePost()
{
if( MoveCheckAccessFrom() &&
MoveParseDir(mv_dir_id, mv_dir, mv_file) &&
MoveCheckAccessTo(mv_dir_id) &&
MoveCheckMountPoints(mv_dir_id) )
if( CheckAccessFrom() &&
ParseDir() &&
CheckAccessTo() )
{
Prepare();
if( request->is_item )
{
MoveFile(request->item);
PostMoveFile();
}
else
{
MoveAuthPrepareQuery();
if( request->IsPostVar(L"onlycontent") )
{
if( mv_file.empty() )
MoveContentOfDir();
else
request->status = WINIX_ERR_INCORRECT_DIR;
}
PostMoveDirContent();
else
{
MoveDir(*request->dir_tab.back());
}
PostMoveDir();
}
Clear();
}
}
void Mv::MakeGet()
{
MoveCheckAccessFrom();
}
} // namespace

View File

@ -14,40 +14,59 @@
namespace Fun
{
class Mv : public FunctionBase
{
public:
Mv();
bool HasAccess();
void MakePost();
void MakeGet();
private:
std::wstring mv_dir;
std::wstring mv_file;
std::wstring mv_new_path;
std::wstring old_path;
long mv_dir_id;
std::vector<Item> mv_auth;
DbItemQuery mv_auth_iq;
// destination dir
std::vector<Item*> dir_tab;
bool MoveCheckAccessFromToDir();
bool MoveCheckAccessFrom();
bool MoveCheckAccessTo(long dir_id);
bool MoveCheckMountPoints(long dir_id);
bool MoveParseDir(long & dir_id, std::wstring & dir, std::wstring & file);
// destination file (if exists)
std::wstring file;
// for copying static files
std::wstring new_path, new_path_thumb;
std::wstring old_path, old_path_thumb;
// for static files
std::vector<Item> static_item_tab;
DbItemQuery static_iq;
// for moving content of a directory
DbItemQuery content_dir_iq;
std::vector<Item> item_tab;
// for logging
std::wstring old_url;
bool CheckAccessFromToDir();
bool CheckAccessFrom();
bool CheckAccessTo();
bool ParseDir();
bool MoveStaticFile(const std::wstring & from, const std::wstring & to);
void MoveStaticFile(Item & item);
bool MoveIsTheSameFile(const Item & item);
void MoveFile(Item & item, bool redirect = true);
void MoveContentOfDir();
void MoveAuthPrepareQuery();
void MoveAuthContentOfDir(const Item & item);
void MoveDir(Item & item, bool redirect = true);
void MoveFileOrSymlink(Item & item);
void MoveDirContent(const Item & dir);
void Prepare();
void Clear();
void MoveStaticFilesTree(const Item & dir);
void MoveDir(Item & dir);
bool IsTheSameFile(const Item & item);
void PostMoveFile();
void PostMoveDirContent();
void PostMoveDir();
};

View File

@ -172,7 +172,7 @@ void PrivChanger::PrivFilesInDir(long parent_id)
iq.sel_user_id = iq.sel_group_id = iq.sel_guest_name = iq.sel_privileges = true;
iq.WhereParentId(parent_id);
iq.WhereType(Item::file);
iq.WhereType(Item::dir, false);
db->GetItems(request->item_tab, iq);
@ -194,9 +194,9 @@ void PrivChanger::PrivDir(long parent_id)
PrivFilesInDir(parent_id);
DirContainer::ParentIterator i = system->dirs.FindFirstParent(parent_id);
DirContainer::ParentIterator i = system->dirs.FindFirstChild(parent_id);
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextParent(i) )
for( ; i != system->dirs.ParentEnd() ; i = system->dirs.NextChild(i) )
{
PrivLog(L"changed dir: ", -1, i->second->url);
ChangePriv(*(i->second), user_id_dir, group_id_dir, priv_dir);

View File

@ -22,6 +22,7 @@ namespace Fun
Rm::Rm()
{
fun.url = L"rm";
follow_symlinks = false;
}
@ -35,9 +36,10 @@ bool Rm::HasAccess(const Item & item)
if( item.parent_id == -1 )
{
// rm for the root dir
// only the superuser can do it
if( !request->session->puser || !request->session->puser->super_user )
// we can only remove the content of the root directory
// and here we check only access the the root dir
// "onlycontent" parameter should be check in post method
if( !system->HasWriteAccess(item) )
return false;
}
else
@ -72,39 +74,110 @@ return true;
void Rm::RemoveAuthPrepareQuery()
void Rm::Prepare()
{
rm_auth_iq.SetAll(true, false);
content_dir_iq.SetAll(false, false);
content_dir_iq.sel_parent_id = true;
content_dir_iq.sel_type = true;
content_dir_iq.sel_url = true;
content_dir_iq.sel_file = true;
rm_auth_iq.sel_parent_id = true;
rm_auth_iq.sel_type = true;
rm_auth_iq.sel_file = true;
static_iq.SetAll(false, false);
static_iq.sel_parent_id = true;
static_iq.sel_type = true;
static_iq.sel_url = true;
static_iq.sel_file = true;
rm_auth_iq.WhereType(Item::file);
rm_auth_iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE, false);
static_iq.WhereType(Item::file);
static_iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE, false);
}
bool Rm::RemoveStaticFile(const std::wstring & path)
{
if( ::RemoveFile(path) )
{
log << log2 << "Rm: removed static file: " << path << logend;
return true;
}
else
{
log << log1 << "Rm: can't remove a file: " << path << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
return false;
}
}
void Rm::RemoveStaticFile(Item & item)
{
if( system->MakeFilePath(item, path, false) )
{
if( RemoveStaticFile(path) )
{
if( item.has_thumb && system->MakeFilePath(item, path, true) )
{
RemoveStaticFile(path);
item.has_thumb = false;
}
// we don't store it to db (it will be removed or is removed already)
item.file_path.clear();
item.file_type = WINIX_ITEM_FILETYPE_NONE;
}
}
else
{
request->status = WINIX_ERR_PERMISSION_DENIED;
}
}
void Rm::RemoveAllDirs(long dir_id)
void Rm::RemoveFileOrSymlink(Item & item)
{
DirContainer::ParentIterator pnext, p = system->dirs.FindFirstParent(dir_id);
if( db->DelItem(item) == WINIX_ERR_OK )
{
if( item.type == Item::file )
log << log2 << "Rm: deleted file ";
else
log << log2 << "Rm: deleted symlink ";
log << item.url << logend;
TemplatesFunctions::pattern_cacher.DeletePattern(item);
plugin.Call(WINIX_FILE_REMOVED, item.id);
db->EditThreadRemoveItem(item.parent_id);
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
RemoveStaticFile(item);
}
else
{
// request->status = WINIX_ERR_NO_ITEM;
}
}
void Rm::RemoveDirTree(long dir_id)
{
DirContainer::ParentIterator pnext, p = system->dirs.FindFirstChild(dir_id);
for( ; p != system->dirs.ParentEnd() ; p = pnext )
{
// this iterator p will be deleted by the next DeleteDir(p->second->id)
// (the next iterator we must calculate beforehand)
pnext = system->dirs.NextParent(p);
RemoveAllDirs(p->second->id);
pnext = system->dirs.NextChild(p);
RemoveDirTree(p->second->id);
}
plugin.Call(WINIX_DIR_PREPARE_TO_REMOVE, dir_id);
rm_auth_iq.WhereParentId(dir_id);
db->GetItems(request->item_tab, rm_auth_iq);
static_iq.WhereParentId(dir_id);
db->GetItems(static_item_tab, static_iq);
for(size_t i=0 ; i<request->item_tab.size() ; ++i)
RemoveStaticFile(request->item_tab[i]);
for(size_t i=0 ; i<static_item_tab.size() ; ++i)
RemoveStaticFile(static_item_tab[i]);
if( db->DelDirById(dir_id) == WINIX_ERR_OK )
{
@ -117,115 +190,96 @@ void Rm::RemoveAllDirs(long dir_id)
void Rm::RemoveAllDirs()
void Rm::RemoveDir(const Item & dir)
{
RemoveAuthPrepareQuery();
old_url = dir.url;
RemoveDirTree(dir.id);
// this method deletes recursively all directories
RemoveAllDirs(request->dir_tab.back()->id);
request->dir_tab.erase(--request->dir_tab.end());
if( request->dir_tab.empty() )
{
// we have deleted the root directory
system->dirs.CheckRootDir(); // adding a new root dir
Item * proot = system->dirs.GetRootDir();
if( proot )
request->dir_tab.push_back(proot);
else
// there is no a root dir
// CheckRootDir() didn't add the root dir (probably problem with the database)
// make sure that ::Make() will check that the dir_tab is empty and returns
return;
}
system->RedirectToLastDir();
}
void Rm::RemoveDir()
{
if( request->param_tab.empty() )
request->status = WINIX_ERR_PERMISSION_DENIED; // use parameter "r" for removing a directory
else
if( request->IsParam(L"r") )
RemoveAllDirs();
else
request->status = WINIX_ERR_UNKNOWN_PARAM;
}
void Rm::RemoveStaticFile(Item & item)
{
if( item.file_path.empty() )
{
log << log1 << "Rm: can't remove a static file: file_path is empty" << logend;
return;
}
if( !system->MakeFilePath(item, path) )
return;
if( ::RemoveFile(path) )
{
log << log1 << "Rm: removed static file: " << path << logend;
item.file_path.clear();
item.file_type = WINIX_ITEM_FILETYPE_NONE;
// we don't store it to db (will be removed or is removed already)
}
else
{
log << log1 << "Rm: can't remove a file: " << path << logend;
request->status = WINIX_ERR_PERMISSION_DENIED;
}
if( request->status == WINIX_ERR_OK )
log << log3 << "Rm: removed directory " << old_url << logend;
}
void Rm::RemoveFile()
{
// for safety we check if param_tab is empty
// a user can use "confirm" but can make a mistake when typing
if( !request->param_tab.empty() )
{
request->status = WINIX_ERR_UNKNOWN_PARAM;
return;
}
RemoveFileOrSymlink(request->item);
if( db->DelItem( request->item ) )
{
log << log2 << "Rm: deleted item: subject: " << request->item.subject << ", id: " << request->item.id << logend;
TemplatesFunctions::pattern_cacher.DeletePattern(request->item);
plugin.Call(WINIX_FILE_REMOVED, request->item.id);
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
db->EditThreadRemoveItem(request->item.parent_id);
if( request->item.file_type != WINIX_ITEM_FILETYPE_NONE )
RemoveStaticFile(request->item);
}
else
{
request->status = WINIX_ERR_NO_ITEM;
}
system->RedirectToLastDir();
if( request->status == WINIX_ERR_OK )
system->RedirectToLastDir();
}
void Rm::MakeGet()
void Rm::RemoveDirContent()
{
if( request->IsParam(L"confirm") )
return; // show confirmation dialog
if( !request->IsParam(L"r") )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
content_dir_iq.WhereParentId(request->dir_tab.back()->id);
db->GetItems(item_tab, content_dir_iq);
for(size_t i=0 ; i<item_tab.size() ; ++i)
{
if( item_tab[i].type == Item::dir )
RemoveDir(item_tab[i]);
else
RemoveFileOrSymlink(item_tab[i]);
}
if( request->status == WINIX_ERR_OK )
system->RedirectToLastDir();
}
void Rm::RemoveDir()
{
if( !request->IsParam(L"r") || request->dir_tab.size() <= 1 )
{
// we cannot remove the root directory (dir_tab.size()==1)
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
RemoveDir(*request->dir_tab.back());
request->dir_tab.erase(--request->dir_tab.end());
if( request->status == WINIX_ERR_OK )
system->RedirectToLastDir();
}
void Rm::Clear()
{
static_item_tab.clear();
item_tab.clear();
}
void Rm::MakePost()
{
Prepare();
if( request->is_item )
{
RemoveFile();
}
else
RemoveDir();
{
if( request->IsPostVar(L"onlycontent") )
RemoveDirContent();
else
RemoveDir();
}
Clear();
}

View File

@ -24,19 +24,32 @@ public:
Rm();
bool HasAccess();
void MakeGet();
void MakePost();
private:
DbItemQuery rm_auth_iq;
// for static files
DbItemQuery static_iq;
std::vector<Item> static_item_tab;
std::wstring path;
// for directory content
DbItemQuery content_dir_iq;
std::vector<Item> item_tab;
// for logging
std::wstring old_url;
bool HasAccess(const Item & item);
void RemoveAuthPrepareQuery();
void RemoveAllDirs(long dir_id);
void RemoveAllDirs();
void RemoveDir();
void Prepare();
void Clear();
void RemoveFileOrSymlink(Item & item);
void RemoveDir(const Item & dir);
bool RemoveStaticFile(const std::wstring & path);
void RemoveStaticFile(Item & item);
void RemoveDirTree(long dir_id);
void RemoveDirContent();
void RemoveDir();
void RemoveFile();
};

View File

@ -66,15 +66,6 @@ return true;
void Upload::CreateThumbnail(const Item & item)
{
if( !system->MakeFilePath(item, path) ||
!system->MakeFilePath(item, path_thumb, true, true, config->upload_dirs_chmod) )
return;
system->thumb.CreateThumb(item.id, path, path_thumb, config->thumb_cx, config->thumb_cy, config->thumb_mode);
}
bool Upload::UploadSaveStaticFile(const Item & item, const std::wstring & tmp_filename)
{
@ -112,7 +103,7 @@ void Upload::UploadFile(Item & item, const std::wstring & tmp_filename)
request->status = db->EditFileById(item, item.id);
if( item.file_type == WINIX_ITEM_FILETYPE_IMAGE && config->create_thumb )
CreateThumbnail(item);
system->thumb.CreateThumb(item, config->thumb_cx, config->thumb_cy, config->thumb_mode);
}
else
{

View File

@ -25,17 +25,16 @@ public:
Upload();
bool HasAccess();
void MakePost();
void UploadFile(Item & item, const std::wstring & tmp_filename);
private:
std::wstring path, path_thumb;
std::wstring path;
std::string patha, path_thumba;
bool HasAccess(const Item & item);
void CreateThumbnail(const Item & item);
bool UploadSaveStaticFile(const Item & item, const std::wstring & tmp_filename);
bool FunUploadCheckAbuse();
void UploadFile(Item & item, const std::wstring & tmp_filename);
void UploadMulti();
void UploadSingle();
};

View File

@ -20,6 +20,7 @@
[if-no item_is]
<label><input type="checkbox" name="onlycontent">{cp_only_content}</label>
<label><input type="checkbox" name="removedefaults" checked="checked">{cp_remove_defaults}</label>
<label><input type="checkbox" name="followsymlinks" checked="checked">{cp_follow_symlinks}</label>
[end]
</p>

View File

@ -1,23 +1,23 @@
[# this template is used in fun_editticket.html as well]
[if-one ticket_is]<h1>{edit_ticket_header}</h1>[else]<h1>{create_ticket_header}</h1>[end]
[if item_is]<h1>{edit_ticket_header}</h1>[else]<h1>{create_ticket_header}</h1>[end]
[include "error.html"]
<form id="additem" method="post" action="[doc_base_url][dir][if-one ticket_is]editticket[else]createticket[end]">
<form id="additem" method="post" action="[doc_base_url][dir][if item_is][item_url]/editticket[else]createticket[end]" enctype="multipart/form-data">
<fieldset>
[if-one ticket_is]
[if item_is]
<legend>{form_edit_ticket_legend}</legend>
[else]
<legend>{form_create_ticket_legend}</legend>
[end]
<p class="withnext">{title}:</p>
<input class="edit" type="text" name="subject" value="[ticket_item_subject]">
<input class="edit" type="text" name="subject" value="[item_subject]">
[if ticket_tab]
@ -39,10 +39,36 @@
[end]
[if ticket_tab_is_integer]
[if-one ticket_tab_is_integer ticket_tab_is_progress ticket_tab_is_string]
<input type="text" name="ticketparam[ticket_tab_param_index]" value="[ticket_tab_value]">
[end]
[if ticket_tab_is_multistring]
<textarea name="ticketparam[ticket_tab_param_index]">[ticket_tab_value]</textarea>
[end]
[if ticket_tab_is_images]
[for ticket_tab_files_tab]
<img src="[doc_base_url][ticket_tab_value]/-/thumb" alt="[ticket_tab_value]" height="150">
[end]
<input size="30" class="edit" type="file" name="ticketparam[ticket_tab_param_index]">
<input class="filesubmit" type="submit" name="fileuploadsubmit" value="Add">
[end]
[if ticket_tab_is_files]
[for ticket_tab_files_tab]
<a href="[doc_base_url][ticket_tab_value]/download">[ticket_tab_value]</a>
[end]
<input size="30" class="edit" type="file" name="ticketparam[ticket_tab_param_index]">
<input class="filesubmit" type="submit" name="fileuploadsubmit" value="Add">
[end]
</td>
</tr>
@ -55,17 +81,17 @@
[# !! change names form_emacs_content_thread and form_emacs_content_ticket]
<p class="withnext">{form_emacs_content_ticket}</p>
<textarea class="multitext" rows="10" cols="60" name="itemcontent">[ticket_item_content]</textarea>
<textarea class="multitext" rows="10" cols="60" name="itemcontent">[item_content]</textarea>
<p class="withnext">{form_emacs_content_type}</p>
<select name="contenttype" class="contenttype">
<option[if ticket_item_content_type_is "text"] selected[end] value="0">{form_emacs_content_type_text}</option>
<option[if ticket_item_content_type_is "formatted text"] selected[end] value="1">{form_emacs_content_type_formatted_text}</option>
[if-one user_can_use_html]<option[if ticket_item_content_type_is "html"] selected[end] value="2">{form_emacs_content_type_html}</option>[end]
[if-one user_can_use_bbcode]<option[if ticket_item_content_type_is "bbcode"] selected[end] value="3">{form_emacs_content_type_bbcode}</option>[end]
[if-one user_can_use_raw]<option[if ticket_item_content_type_is "raw"] selected[end] value="4">{form_emacs_content_type_raw}</option>[end]
<option[if item_content_type_is "text"] selected[end] value="0">{form_emacs_content_type_text}</option>
<option[if item_content_type_is "formatted text"] selected[end] value="1">{form_emacs_content_type_formatted_text}</option>
[if-one user_can_use_html]<option[if item_content_type_is "html"] selected[end] value="2">{form_emacs_content_type_html}</option>[end]
[if-one user_can_use_bbcode]<option[if item_content_type_is "bbcode"] selected[end] value="3">{form_emacs_content_type_bbcode}</option>[end]
[if-one user_can_use_raw]<option[if item_content_type_is "raw"] selected[end] value="4">{form_emacs_content_type_raw}</option>[end]
</select>
@ -80,6 +106,6 @@
[end]
<input class="submit" type="submit" value="[if-one ticket_is]{form_ticket_edit_submit}[else]{form_ticket_create_submit}[end]">
<input class="submit" type="submit" value="[if item_is]{form_ticket_edit_submit}[else]{form_ticket_create_submit}[end]">
</fieldset>
</form>

View File

@ -6,7 +6,12 @@
<fieldset>
<legend>{form_default_legend}</legend>
{url}:<br>
<input class="edit" type="text" name="defaultitem" value="[dir_last_default_item_dir][dir_last_default_item_url]">
<input class="edit" type="text" name="linkto" value="[dir_last_link_to]">
<p>
<label><input class="" type="checkbox" name="makeredirect"[if dir_last_is_link_redirect] checked="checked"[end]>{default_make_redirect}</label>
</p>
<input class="submit" type="submit" value="{change}">
</fieldset>
</form>

31
html/fun_ln.html Executable file
View File

@ -0,0 +1,31 @@
<h1>{ln_header}</h1>
[include "error.html"]
<form id="additem" method="post" action="[doc_base_url][dir]ln">
<fieldset>
<legend>{form_ln_legend}</legend>
<p>{ln_info}: [dir]</p>
<p class="withnext">{suggested_url}</p>
<input class="edit" type="text" name="url" value="">
<p class="withnext">{ln_to}</p>
<input class="edit" type="text" name="linkto" value="[dir][if item_is][item_url][end]">
<p>
<label><input id="radiohard" type="radio" name="linktype" checked="checked" value="0">{ln_hardlink}</label>
<label><input id="radiosymb" type="radio" name="linktype" value="1">{ln_symlink}</label>
</p>
<p>
<label><input class="" type="checkbox" name="makeredirect">{ln_make_redirect}</label>
</p>
<input class="submit" type="submit" value="{change}">
</fieldset>
</form>

View File

@ -47,11 +47,11 @@
[for item_tab]
<tr>
<td>-</td>
<td>[if item_tab_type_is_symlink]l[else][if item_tab_has_static_file]s[else]-[end][end]</td>
<td>[item_tab_privileges]</td>
<td>[item_tab_user]</td>
<td>[item_tab_group]</td>
<td><a href="[doc_base_url][dir][item_tab_url]">[item_tab_url]</a></td>
<td><a href="[doc_base_url][dir][item_tab_url]">[item_tab_url]</a>[if item_tab_type_is_symlink] -> [item_tab_link_to][end]</td>
</tr>
[end]
</table>

View File

@ -1,30 +1,39 @@
[if-one item_is]
<h1>{rm_header}</h1>
[include "error.html"]
<h1>{rm_file_header}</h1>
<form id="additem" method="post" action="[doc_base_url][dir][if-one item_is][item_url]/[end]rm[if-no item_is]/r[end]">
<fieldset>
<legend>{rm_form_legend}</legend>
<p>
{url}: <a href="[doc_base_url][dir][item_url]">[doc_base_url][dir][item_url]</a><br>
{title}: [item_subject]
[if item_is]
[if item_type_is_symlink]
{rm_symlink}: [dir][item_url]
[else]
{rm_file}: [dir][item_url]
[end]
[else]
[if dir_is_root]
{rm_root}
[else]
{rm_dir}: [dir_without_slash]
[end]
[end]
</p>
<ul>
<li><a href="[doc_base_url][dir][item_url]/rm">{yes}</a></li>
<li><a href="[doc_base_url][dir][item_url]">{no}</a></li>
</ul>
[else]
<h1>{rm_dir_header}</h1>
[if-no item_is]
<p>
{url}: <a href="[doc_base_url][dir]">[doc_base_url][dir]</a>
<label><input type="checkbox" name="onlycontent">{rm_only_content}</label>
</p>
[end]
<ul>
<li><a href="[doc_base_url][dir]rm/r">{yes}</a></li>
<li><a href="[doc_base_url][dir]">{no}</a></li>
</ul>
[end]
<input class="submit" type="submit" value="{rm_submit}">
</fieldset>
</form>

40
html/fun_showtickets.html Executable file
View File

@ -0,0 +1,40 @@
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
[if-one ticket_can_create]
<ul class="itemmenu">
<li><a href="[doc_base_url][dir]createticket">{ticket_create_new}</a></li>
</ul>
[end]
[if tickets_tab]
<table class="tickettab">
<tr>
<th>{tickets_header_name}</th>
[for ticket_tab]
<th>[ticket_tab_param]</th>
[end]
</tr>
[for tickets_tab]
<tr>
<td class="tickettabtitle"><a href="[doc_base_url][dir][tickets_tab_url]">[if-no tickets_tab_subject_empty][tickets_tab_subject][else]&lt;[tickets_tab_url]&gt;[end]</a></td>
[for tickets_tab_conf_tab]
[if tickets_tab_conf_tab_is_progress]
<td><img src="[doc_base_url_common]/{ticket_progress_image_path}/progress_[tickets_tab_conf_tab_progress_image_number].gif" alt="progress [tickets_tab_conf_tab_value]%"></td>
[else]
<td>[tickets_tab_conf_tab_value]</td>
[end]
[end]
</tr>
[end]
</table>
[end]

View File

@ -1,66 +1,52 @@
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[dir_last_subject]</h1>[end]
[if mount_page_arg_is "info"][include "dir_last_info.html"][end]
[if mount_page_arg_is "subject"]<h1[if mount_page_arg_is "info"] class="withinfo"[end]>[item_subject]</h1>[end]
[if mount_page_arg_is "info"][include "item_info.html"][end]
[if-one ticket_can_create]
<div class="ticketinfo">
[if ticket_can_edit]<p class="edit"><a href="[doc_base_url][dir][item_url]/editticket">\[{edit}\]</a></p>[end]
<table>
[for ticket_tab]
<tr>
<th>[ticket_tab_param]:</th>
<td>
[if ticket_tab_is_images]
[for ticket_tab_files_tab]
<img src="[doc_base_url][ticket_tab_value]/-/thumb" alt="[ticket_tab_value]" height="150">
[end]
[end]
[if ticket_tab_is_files]
[for ticket_tab_files_tab]
<a href="[doc_base_url][ticket_tab_value]/download">[ticket_tab_value]</a>
[end]
[end]
[if-any-no ticket_tab_is_images ticket_tab_is_files]
[ticket_tab_value]
[end]
</td>
</th>
</tr>
[end]
</table>
[item_print_content]
</div>
[if-one dir_can_use_emacs]
<ul class="itemmenu">
<li><a href="[doc_base_url][dir]createticket">{ticket_create_new}</a></li>
<li><a href="[doc_base_url][dir]emacs">{ticket_reply_in_this_thread}</a></li>
</ul>
[end]
[if tickets_tab]
<table class="tickettab">
<tr>
<th>{tickets_header_name}</th>
[for ticket_tab]
<th>[ticket_tab_param]</th>
[end]
</tr>
[for tickets_tab]
<tr>
<td class="tickettabtitle"><a href="[doc_base_url][dir][tickets_tab_url]">[if-no tickets_tab_subject_empty][tickets_tab_subject][else]&lt;[tickets_tab_url]&gt;[end]</a></td>
[for tickets_tab_conf_tab]
[if tickets_tab_conf_tab_is_progress]
<td><img src="[doc_base_url_common]/{ticket_progress_image_path}/progress_[tickets_tab_conf_tab_progress_image_number].gif" alt="progress [tickets_tab_conf_tab_value]%"></td>
[else]
<td>[tickets_tab_conf_tab_value]</td>
[end]
[end]
</tr>
[end]
</table>
[end]
[if-one ticket_is]
<div class="ticketinfo">
[if-one ticket_can_edit]<p class="edit"><a href="[doc_base_url][dir]editticket">\[{edit}\]</a></p>[end]
<table>
[for ticket_tab]
<tr><th>[ticket_tab_param]:</th><td>[ticket_tab_value]</td></th></tr>
[end]
</table>
[ticket_item_print_content]
[for item_tab]
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
[if mount_thread_arg_is "info"][include "item_tab_info.html"][end]
[item_tab_print_content]
</div>
[if-one dir_can_use_emacs]
<ul class="itemmenu">
<li><a href="[doc_base_url][dir]emacs">{ticket_reply_in_this_thread}</a></li>
</ul>
[end]
[for item_tab]
<div class="threadbox[if-index item_tab odd] threadboxcolor[end]">
[if mount_thread_arg_is "subject"]<h2[if mount_thread_arg_is "info"] class="withinfo"[end]>[item_tab_subject]</h2>[end]
[if mount_thread_arg_is "info"][include "item_tab_info.html"][end]
[item_tab_print_content]
</div>
[end]
[end]

View File

@ -25,7 +25,7 @@
<li><a href="[doc_base_url][dir]ls">{admin_ls}</a></li>
[if-one dir_can_write]<li><a href="[doc_base_url][dir]mkdir">{admin_mkdir}</a></li>[end]
[if-one dir_can_write]<li><a href="[doc_base_url][dir]upload">{admin_upload}</a></li>[end]
[if-any item_is item_can_remove]<li><a href="[doc_base_url][dir][item_url]/rm/confirm">{admin_rm}</a></li>[end]
[if-any item_is item_can_remove]<li><a href="[doc_base_url][dir][item_url]/rm">{admin_rm}</a></li>[end]
</ul>
</div>
[end]

View File

@ -50,6 +50,7 @@ change = Change
edit = Edit
add = Add
move = Move
copy = Copy
user = User
group = Group
permissions = Permissions
@ -79,9 +80,19 @@ form_ticket_create_submit = Create a new ticket
form_ticket_edit_submit = Edit a ticket
default_header = Default item in a directory
default_make_redirect = Make redirect
form_default_legend = Default item form
ln_header = Link
ln_info = Create a link in directory
ln_to = Link pointing to
ln_hardlink = hardlink
ln_symlink = symbolic link
ln_make_redirect = Make redirect (only for symbolic links)
form_ln_legend = Link form
form_emacs_legend = Edit form
form_emacs_content_cms = Content
@ -124,8 +135,14 @@ reload_templates = html templates
reload_tickets = tickets config files
rm_file_header = Are you sure you want to delete the file?
rm_dir_header = Are you sure you want to delete the directory?
rm_header = Remove
rm_form_legend = Remove form
rm_file = Do you really want to remove file
rm_symlink = Do you really want to remove symlink
rm_dir = Do you really want to remove directory
rm_only_content = Remove only the content of the directory
rm_root = You cannot remove the root directory, you are only allowed to delete the content of the directory
rm_submit = Remove
thread_create_new = Create a new thread
thread_tab_title = Thread title
@ -216,6 +233,9 @@ cp_dir = Copy directory
cp_only_content = Copy only content of the directory
cp_remove_defaults = Remove 'default' attribute from copied directories
cp_preserve_attr = Preserve attributes: user, group, times
cp_follow_symlinks = Follow symlinks
stat_header = Stat
stat_item_type = type

View File

@ -80,9 +80,18 @@ form_ticket_create_submit = Załóż zgłoszenie
form_ticket_edit_submit = Edytuj zgłoszenie
default_header = Domyślna pozycja w katalogu
default_make_redirect = Wykonaj przekierowanie
form_default_legend = Formularz zmiany pozycji domyślnej
ln_header = Link
ln_info = Stwórz link w katalogu
ln_to = Link wskazujący na
ln_hardlink = hard link
ln_symlink = link symboliczny
ln_make_redirect = Wykonaj przekierowanie (jedynie dla linków symbolicznych)
form_ln_legend = Formularz zmiany linku
form_emacs_legend = Formularz edycji.
form_emacs_content_cms = Zawartość:
@ -126,8 +135,14 @@ reload_templates = szablony html
reload_tickets = pliki konfiguracyjne ticketów
rm_file_header = Czy napewno chcesz usunąć podaną pozycję?
rm_dir_header = Czy napewno chcesz usunąć podany katalog?
rm_header = Usuń
rm_form_legend = Formularz usuwania
rm_file = Czy napewno usunąć plik
rm_symlink = Czy napewno usunąć symlink
rm_dir = Czy napewno usunąć katalog
rm_only_content = Usuń jedynie zawartość katalogu
rm_root = Nie możesz skasować katalogu głównego, możesz jedynie usunąć jego zawartość
rm_submit = Usuń
thread_create_new = Załóż nowy wątek
thread_tab_title = Tytuł wątku
@ -220,6 +235,8 @@ cp_dir = Kopiuj katalog
cp_only_content = Kopiuj tylko zawartość katalogu
cp_remove_defaults = Usuń atrybut 'default' z kopiowanych katalogów
cp_preserve_attr = Zachowaj atrybuty: użytkownik, grupa, czas
cp_follow_symlinks = Podążaj za linkami symbolicznymi
stat_header = Stat

View File

@ -29,8 +29,9 @@ main.o: ../core/synchro.h ../functions/functionparser.h
main.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
main.o: ../functions/privchanger.h ../functions/chown.h
main.o: ../functions/ckeditor.h ../functions/cp.h ../functions/createthread.h
main.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
main.o: ../functions/last.h ../functions/login.h ../functions/logout.h
main.o: ../functions/functionbase.h ../functions/default.h
main.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
main.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
main.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
main.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
main.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h

View File

@ -69,13 +69,15 @@ int main(int argv, char ** argc)
app.stdout_is_closed = true;
}
log.Init(app.config.log_level, app.config.log_file, app.config.log_stdout, app.config.log_request);
nlog.Init(app.config.log_level, app.config.log_notify_file, false, 1);
log.Init(app.config.log_level, app.config.log_save_each_line, app.config.log_file,
app.config.log_stdout, app.config.log_request);
log << log3 << "-- preparing to start winix --" << logend << logsavenow;
nlog.Init(app.config.log_level, true, app.config.log_notify_file, false, 1);
log << log3 << "-- preparing to start winix --" << logend;
if( !app.InitFCGI() )
return false; // !! dodac logsave do logow
return false;
if( !app.DropPrivileges() )
return 3;
@ -98,13 +100,7 @@ int main(int argv, char ** argc)
return 1;
log.PutDate(log1);
log << "winix started" << logend << logsavenow;
// !! wywalic to sprawdzanie
//log << log2 << "checking for table consistency:" << logend;
// !! zrobic wyjatek dla root
//app.db.CheckAllUrlSubject();
log << "winix started" << logend << logsave;
app.StartThreads();
// now we have more threads, we should use Lock() and Unlock()
@ -121,7 +117,7 @@ int main(int argv, char ** argc)
// now all others threads are terminated
log.PutDate(log1);
log << "winix stopped" << logend << logsavenow;
log << "winix stopped" << logend << logsave;
return 0;
}

View File

@ -33,13 +33,14 @@ notify.o: ../functions/functionbase.h ../functions/functionparser.h
notify.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
notify.o: ../functions/privchanger.h ../functions/chown.h
notify.o: ../functions/ckeditor.h ../functions/cp.h
notify.o: ../functions/createthread.h ../functions/default.h
notify.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
notify.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
notify.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
notify.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
notify.o: ../functions/run.h ../functions/specialdefault.h
notify.o: ../functions/stat.h ../functions/subject.h ../functions/funthread.h
notify.o: ../functions/createthread.h ../functions/functionbase.h
notify.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
notify.o: ../functions/last.h ../functions/login.h ../functions/logout.h
notify.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
notify.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
notify.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
notify.o: ../functions/specialdefault.h ../functions/stat.h
notify.o: ../functions/subject.h ../functions/funthread.h
notify.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
notify.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
notify.o: ../functions/vim.h ../core/htmlfilter.h
@ -92,13 +93,13 @@ templatesnotify.o: ../functions/functionparser.h ../functions/adduser.h
templatesnotify.o: ../functions/cat.h ../functions/chmod.h
templatesnotify.o: ../functions/privchanger.h ../functions/chown.h
templatesnotify.o: ../functions/ckeditor.h ../functions/cp.h
templatesnotify.o: ../functions/createthread.h ../functions/default.h
templatesnotify.o: ../functions/download.h ../functions/emacs.h
templatesnotify.o: ../functions/last.h ../functions/login.h
templatesnotify.o: ../functions/logout.h ../functions/ls.h
templatesnotify.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
templatesnotify.o: ../functions/priv.h ../functions/reload.h
templatesnotify.o: ../functions/rm.h ../functions/run.h
templatesnotify.o: ../functions/createthread.h ../functions/functionbase.h
templatesnotify.o: ../functions/default.h ../functions/download.h
templatesnotify.o: ../functions/emacs.h ../functions/last.h
templatesnotify.o: ../functions/login.h ../functions/logout.h
templatesnotify.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
templatesnotify.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
templatesnotify.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
templatesnotify.o: ../functions/specialdefault.h ../functions/stat.h
templatesnotify.o: ../functions/subject.h ../functions/funthread.h
templatesnotify.o: ../functions/template.h ../functions/tinymce.h

View File

@ -211,8 +211,7 @@ void NotifyThread::SendMail(const std::wstring & email, const std::wstring & mes
SendMail(sendmail, message);
pclose(sendmail);
nlog << log1 << "NotifyThread: email to: " << email << " has been sent" << logend;
nlog << logsave;
nlog << log1 << "NotifyThread: email to: " << email << " has been sent" << logend << logsave;
}

View File

@ -35,11 +35,12 @@ init.o: ../../functions/functionparser.h ../../functions/adduser.h
init.o: ../../functions/cat.h ../../functions/chmod.h
init.o: ../../functions/privchanger.h ../../functions/chown.h
init.o: ../../functions/ckeditor.h ../../functions/cp.h
init.o: ../../functions/createthread.h ../../functions/default.h
init.o: ../../functions/download.h ../../functions/emacs.h
init.o: ../../functions/last.h ../../functions/login.h
init.o: ../../functions/logout.h ../../functions/ls.h ../../functions/mkdir.h
init.o: ../../functions/mv.h ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/createthread.h ../../functions/functionbase.h
init.o: ../../functions/default.h ../../functions/download.h
init.o: ../../functions/emacs.h ../../functions/last.h
init.o: ../../functions/login.h ../../functions/logout.h ../../functions/ln.h
init.o: ../../functions/ls.h ../../functions/mkdir.h ../../functions/mv.h
init.o: ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/reload.h ../../functions/rm.h ../../functions/run.h
init.o: ../../functions/specialdefault.h ../../functions/stat.h
init.o: ../../functions/subject.h ../../functions/funthread.h
@ -89,10 +90,11 @@ templates.o: ../../functions/functionparser.h ../../functions/adduser.h
templates.o: ../../functions/cat.h ../../functions/chmod.h
templates.o: ../../functions/privchanger.h ../../functions/chown.h
templates.o: ../../functions/ckeditor.h ../../functions/cp.h
templates.o: ../../functions/createthread.h ../../functions/default.h
templates.o: ../../functions/download.h ../../functions/emacs.h
templates.o: ../../functions/last.h ../../functions/login.h
templates.o: ../../functions/logout.h ../../functions/ls.h
templates.o: ../../functions/createthread.h ../../functions/functionbase.h
templates.o: ../../functions/default.h ../../functions/download.h
templates.o: ../../functions/emacs.h ../../functions/last.h
templates.o: ../../functions/login.h ../../functions/logout.h
templates.o: ../../functions/ln.h ../../functions/ls.h
templates.o: ../../functions/mkdir.h ../../functions/mv.h
templates.o: ../../functions/node.h ../../functions/priv.h
templates.o: ../../functions/reload.h ../../functions/rm.h

27
plugins/thread/Makefile Executable file
View File

@ -0,0 +1,27 @@
include Makefile.o.dep
name = thread.so
all: $(o)
$(CXX) -shared -Wl,-soname,$(name).so -o $(name) $(CXXFLAGS) *.o
.SUFFIXES: .cpp .o
.cpp.o:
$(CXX) -c $(CXXFLAGS) $<
depend:
makedepend -Y. -I../.. -I../../../ezc/src -f- *.cpp > Makefile.dep
echo -n "o = " > Makefile.o.dep
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
clean:
rm -f *.o
rm -f $(name)
include Makefile.dep

374
plugins/thread/Makefile.dep Executable file
View File

@ -0,0 +1,374 @@
# DO NOT DELETE
createticket.o: createticket.h tdb.h ticket.h ../../db/dbbase.h
createticket.o: ../../db/dbconn.h ../../db/dbtextstream.h
createticket.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
createticket.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
createticket.o: ../../functions/functionbase.h ../../core/item.h
createticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
createticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
createticket.o: ../../core/thread.h ../../core/dircontainer.h
createticket.o: ../../core/ugcontainer.h ../../core/request.h
createticket.o: ../../core/requesttypes.h ../../core/session.h
createticket.o: ../../core/error.h ../../core/user.h ../../core/plugindata.h
createticket.o: ../../core/rebus.h ../../core/config.h
createticket.o: ../../core/confparser.h ../../core/htmlfilter.h
createticket.o: ../../templates/htmltextstream.h ../../core/config.h
createticket.o: ../../core/system.h ../../core/dirs.h
createticket.o: ../../core/dircontainer.h ../../core/request.h
createticket.o: ../../notify/notify.h ../../notify/notifypool.h
createticket.o: ../../templates/locale.h ../../core/confparser.h
createticket.o: ../../templates/misc.h ../../templates/localefilter.h
createticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
createticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
createticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
createticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
createticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
createticket.o: ../../core/basethread.h ../../core/synchro.h
createticket.o: ../../notify/templatesnotify.h ../../core/users.h
createticket.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
createticket.o: ../../core/mounts.h ../../core/mount.h
createticket.o: ../../core/mountparser.h ../../core/users.h
createticket.o: ../../core/groups.h ../../core/group.h ../../core/loadavg.h
createticket.o: ../../core/thumb.h ../../core/basethread.h
createticket.o: ../../core/synchro.h ticketinfo.h ticketparser.h ticketconf.h
createticket.o: ../../functions/functions.h ../../functions/functionbase.h
createticket.o: ../../functions/functionparser.h ../../functions/adduser.h
createticket.o: ../../functions/cat.h ../../functions/chmod.h
createticket.o: ../../functions/privchanger.h ../../functions/chown.h
createticket.o: ../../functions/ckeditor.h ../../functions/cp.h
createticket.o: ../../functions/createthread.h ../../functions/default.h
createticket.o: ../../functions/download.h ../../functions/emacs.h
createticket.o: ../../functions/last.h ../../functions/login.h
createticket.o: ../../functions/logout.h ../../functions/ln.h
createticket.o: ../../functions/ls.h ../../functions/mkdir.h
createticket.o: ../../functions/mv.h ../../functions/node.h
createticket.o: ../../functions/priv.h ../../functions/reload.h
createticket.o: ../../functions/rm.h ../../functions/run.h
createticket.o: ../../functions/specialdefault.h ../../functions/stat.h
createticket.o: ../../functions/subject.h ../../functions/funthread.h
createticket.o: ../../functions/template.h ../../functions/tinymce.h
createticket.o: ../../functions/uname.h ../../functions/upload.h
createticket.o: ../../functions/uptime.h ../../functions/who.h
createticket.o: ../../functions/vim.h ../../core/htmlfilter.h sessiondata.h
createticket.o: ../../core/plugindata.h
editticket.o: editticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
editticket.o: ../../db/dbtextstream.h ../../core/textstream.h
editticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
editticket.o: ../../core/log.h ../../core/textstream.h ticketinfo.h
editticket.o: ticketparser.h ticketconf.h ../../core/item.h
editticket.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
editticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
editticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
editticket.o: ../../core/thread.h ../../core/dircontainer.h
editticket.o: ../../core/ugcontainer.h ../../core/request.h
editticket.o: ../../notify/notify.h ../../notify/notifypool.h
editticket.o: ../../templates/locale.h ../../core/confparser.h
editticket.o: ../../templates/misc.h ../../templates/localefilter.h
editticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
editticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
editticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
editticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
editticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
editticket.o: ../../core/basethread.h ../../core/synchro.h
editticket.o: ../../notify/templatesnotify.h ../../core/config.h
editticket.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
editticket.o: ../../core/lastcontainer.h ../../core/mounts.h
editticket.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
editticket.o: ../../core/config.h ../../core/confparser.h
editticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
editticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
editticket.o: ../../core/thumb.h ../../core/basethread.h
editticket.o: ../../functions/functions.h ../../functions/functionbase.h
editticket.o: ../../functions/functionparser.h ../../core/request.h
editticket.o: ../../core/requesttypes.h ../../core/session.h
editticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
editticket.o: ../../functions/adduser.h ../../functions/cat.h
editticket.o: ../../functions/chmod.h ../../functions/privchanger.h
editticket.o: ../../functions/chown.h ../../functions/ckeditor.h
editticket.o: ../../functions/cp.h ../../functions/createthread.h
editticket.o: ../../functions/default.h ../../functions/download.h
editticket.o: ../../functions/emacs.h ../../functions/last.h
editticket.o: ../../functions/login.h ../../functions/logout.h
editticket.o: ../../functions/ln.h ../../functions/ls.h
editticket.o: ../../functions/mkdir.h ../../functions/mv.h
editticket.o: ../../functions/node.h ../../functions/priv.h
editticket.o: ../../functions/reload.h ../../functions/rm.h
editticket.o: ../../functions/run.h ../../functions/specialdefault.h
editticket.o: ../../functions/stat.h ../../functions/subject.h
editticket.o: ../../functions/funthread.h ../../functions/template.h
editticket.o: ../../functions/tinymce.h ../../functions/uname.h
editticket.o: ../../functions/upload.h ../../functions/uptime.h
editticket.o: ../../functions/who.h ../../functions/vim.h
editticket.o: ../../core/htmlfilter.h ../../functions/functionbase.h
editticket.o: ../../core/synchro.h sessiondata.h ../../core/plugindata.h
funticket.o: funticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
funticket.o: ../../db/dbtextstream.h ../../core/textstream.h
funticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
funticket.o: ../../core/log.h ../../core/textstream.h ticketinfo.h
funticket.o: ticketparser.h ticketconf.h ../../core/item.h
funticket.o: ../../core/system.h ../../core/dirs.h ../../core/dircontainer.h
funticket.o: ../../db/db.h ../../db/dbbase.h ../../db/dbitemquery.h
funticket.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
funticket.o: ../../core/thread.h ../../core/dircontainer.h
funticket.o: ../../core/ugcontainer.h ../../core/request.h
funticket.o: ../../notify/notify.h ../../notify/notifypool.h
funticket.o: ../../templates/locale.h ../../core/confparser.h
funticket.o: ../../templates/misc.h ../../templates/localefilter.h
funticket.o: ../../templates/locale.h ../../../ezc/src/ezc.h
funticket.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
funticket.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
funticket.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
funticket.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
funticket.o: ../../core/basethread.h ../../core/synchro.h
funticket.o: ../../notify/templatesnotify.h ../../core/config.h
funticket.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
funticket.o: ../../core/lastcontainer.h ../../core/mounts.h
funticket.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
funticket.o: ../../core/config.h ../../core/confparser.h
funticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
funticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
funticket.o: ../../core/thumb.h ../../core/basethread.h
funticket.o: ../../functions/functions.h ../../functions/functionbase.h
funticket.o: ../../functions/functionparser.h ../../core/request.h
funticket.o: ../../core/requesttypes.h ../../core/session.h
funticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
funticket.o: ../../functions/adduser.h ../../functions/cat.h
funticket.o: ../../functions/chmod.h ../../functions/privchanger.h
funticket.o: ../../functions/chown.h ../../functions/ckeditor.h
funticket.o: ../../functions/cp.h ../../functions/createthread.h
funticket.o: ../../functions/default.h ../../functions/download.h
funticket.o: ../../functions/emacs.h ../../functions/last.h
funticket.o: ../../functions/login.h ../../functions/logout.h
funticket.o: ../../functions/ln.h ../../functions/ls.h
funticket.o: ../../functions/mkdir.h ../../functions/mv.h
funticket.o: ../../functions/node.h ../../functions/priv.h
funticket.o: ../../functions/reload.h ../../functions/rm.h
funticket.o: ../../functions/run.h ../../functions/specialdefault.h
funticket.o: ../../functions/stat.h ../../functions/subject.h
funticket.o: ../../functions/funthread.h ../../functions/template.h
funticket.o: ../../functions/tinymce.h ../../functions/uname.h
funticket.o: ../../functions/upload.h ../../functions/uptime.h
funticket.o: ../../functions/who.h ../../functions/vim.h
funticket.o: ../../core/htmlfilter.h ../../functions/functionbase.h
funticket.o: ../../core/synchro.h
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
init.o: ../../core/item.h ../../core/error.h ../../core/log.h
init.o: ../../core/textstream.h funticket.h ticketinfo.h ticketparser.h
init.o: ticketconf.h ../../core/item.h ../../core/system.h ../../core/dirs.h
init.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
init.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h ../../core/user.h
init.o: ../../core/group.h ../../core/thread.h ../../core/dircontainer.h
init.o: ../../core/ugcontainer.h ../../core/request.h ../../notify/notify.h
init.o: ../../notify/notifypool.h ../../templates/locale.h
init.o: ../../core/confparser.h ../../templates/misc.h
init.o: ../../templates/localefilter.h ../../templates/locale.h
init.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
init.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
init.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
init.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
init.o: ../../notify/notifythread.h ../../core/basethread.h
init.o: ../../core/synchro.h ../../notify/templatesnotify.h
init.o: ../../core/config.h ../../core/users.h ../../core/user.h
init.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
init.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
init.o: ../../core/mountparser.h ../../core/config.h ../../core/confparser.h
init.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
init.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
init.o: ../../core/thumb.h ../../core/basethread.h
init.o: ../../functions/functions.h ../../functions/functionbase.h
init.o: ../../functions/functionparser.h ../../core/request.h
init.o: ../../core/requesttypes.h ../../core/session.h
init.o: ../../core/plugindata.h ../../templates/htmltextstream.h
init.o: ../../functions/adduser.h ../../functions/cat.h
init.o: ../../functions/chmod.h ../../functions/privchanger.h
init.o: ../../functions/chown.h ../../functions/ckeditor.h
init.o: ../../functions/cp.h ../../functions/createthread.h
init.o: ../../functions/default.h ../../functions/download.h
init.o: ../../functions/emacs.h ../../functions/last.h
init.o: ../../functions/login.h ../../functions/logout.h ../../functions/ln.h
init.o: ../../functions/ls.h ../../functions/mkdir.h ../../functions/mv.h
init.o: ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/reload.h ../../functions/rm.h ../../functions/run.h
init.o: ../../functions/specialdefault.h ../../functions/stat.h
init.o: ../../functions/subject.h ../../functions/funthread.h
init.o: ../../functions/template.h ../../functions/tinymce.h
init.o: ../../functions/uname.h ../../functions/upload.h
init.o: ../../functions/uptime.h ../../functions/who.h ../../functions/vim.h
init.o: ../../core/htmlfilter.h ../../functions/functionbase.h
init.o: ../../core/synchro.h editticket.h createticket.h showtickets.h
init.o: ../../core/log.h ../../core/plugin.h ../../core/pluginmsg.h
init.o: ../../core/system.h ../../core/sessionmanager.h
init.o: ../../core/sessioncontainer.h ../../templates/templates.h
init.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
init.o: ../../core/httpsimpleparser.h ../../core/log.h
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
init.o: sessiondata.h ../../core/plugindata.h
sessiondata.o: sessiondata.h ../../core/plugindata.h ticket.h
showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
showtickets.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
showtickets.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
showtickets.o: ticketinfo.h ticketparser.h ticketconf.h ../../core/item.h
showtickets.o: ../../core/system.h ../../core/dirs.h
showtickets.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
showtickets.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
showtickets.o: ../../core/user.h ../../core/group.h ../../core/thread.h
showtickets.o: ../../core/dircontainer.h ../../core/ugcontainer.h
showtickets.o: ../../core/request.h ../../notify/notify.h
showtickets.o: ../../notify/notifypool.h ../../templates/locale.h
showtickets.o: ../../core/confparser.h ../../templates/misc.h
showtickets.o: ../../templates/localefilter.h ../../templates/locale.h
showtickets.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
showtickets.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
showtickets.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
showtickets.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
showtickets.o: ../../notify/notifythread.h ../../core/basethread.h
showtickets.o: ../../core/synchro.h ../../notify/templatesnotify.h
showtickets.o: ../../core/config.h ../../core/users.h ../../core/user.h
showtickets.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
showtickets.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
showtickets.o: ../../core/mountparser.h ../../core/config.h
showtickets.o: ../../core/confparser.h ../../core/htmlfilter.h
showtickets.o: ../../core/users.h ../../core/groups.h ../../core/group.h
showtickets.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
showtickets.o: ../../core/basethread.h ../../functions/functions.h
showtickets.o: ../../functions/functionbase.h
showtickets.o: ../../functions/functionparser.h ../../core/request.h
showtickets.o: ../../core/requesttypes.h ../../core/session.h
showtickets.o: ../../core/plugindata.h ../../templates/htmltextstream.h
showtickets.o: ../../functions/adduser.h ../../functions/cat.h
showtickets.o: ../../functions/chmod.h ../../functions/privchanger.h
showtickets.o: ../../functions/chown.h ../../functions/ckeditor.h
showtickets.o: ../../functions/cp.h ../../functions/createthread.h
showtickets.o: ../../functions/default.h ../../functions/download.h
showtickets.o: ../../functions/emacs.h ../../functions/last.h
showtickets.o: ../../functions/login.h ../../functions/logout.h
showtickets.o: ../../functions/ln.h ../../functions/ls.h
showtickets.o: ../../functions/mkdir.h ../../functions/mv.h
showtickets.o: ../../functions/node.h ../../functions/priv.h
showtickets.o: ../../functions/reload.h ../../functions/rm.h
showtickets.o: ../../functions/run.h ../../functions/specialdefault.h
showtickets.o: ../../functions/stat.h ../../functions/subject.h
showtickets.o: ../../functions/funthread.h ../../functions/template.h
showtickets.o: ../../functions/tinymce.h ../../functions/uname.h
showtickets.o: ../../functions/upload.h ../../functions/uptime.h
showtickets.o: ../../functions/who.h ../../functions/vim.h
showtickets.o: ../../core/htmlfilter.h ../../functions/functionbase.h
showtickets.o: ../../core/synchro.h
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
tdb.o: ../../core/item.h ../../core/error.h ../../core/log.h
tdb.o: ../../core/textstream.h ../../core/log.h
templates.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
templates.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
templates.o: ../../core/item.h ../../../ezc/src/functions.h
templates.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
templates.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
templates.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
templates.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
templates.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
templates.o: ../../core/user.h ../../core/group.h ../../core/thread.h
templates.o: ../../core/dircontainer.h ../../core/ugcontainer.h
templates.o: ../../core/log.h ../../core/textstream.h ../../core/request.h
templates.o: ../../notify/notify.h ../../notify/notifypool.h
templates.o: ../../templates/locale.h ../../core/confparser.h
templates.o: ../../templates/misc.h ../../templates/localefilter.h
templates.o: ../../templates/locale.h ../../templates/htmltextstream.h
templates.o: ../../notify/notifythread.h ../../core/basethread.h
templates.o: ../../core/synchro.h ../../notify/templatesnotify.h
templates.o: ../../core/textstream.h ../../core/misc.h ../../core/config.h
templates.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
templates.o: ../../core/lastcontainer.h ../../core/mounts.h
templates.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
templates.o: ../../core/config.h ../../core/confparser.h
templates.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
templates.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
templates.o: ../../core/thumb.h ../../core/basethread.h
templates.o: ../../functions/functions.h ../../functions/functionbase.h
templates.o: ../../functions/functionparser.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../core/session.h
templates.o: ../../core/plugindata.h ../../templates/htmltextstream.h
templates.o: ../../functions/adduser.h ../../functions/cat.h
templates.o: ../../functions/chmod.h ../../functions/privchanger.h
templates.o: ../../functions/chown.h ../../functions/ckeditor.h
templates.o: ../../functions/cp.h ../../functions/createthread.h
templates.o: ../../functions/default.h ../../functions/download.h
templates.o: ../../functions/emacs.h ../../functions/last.h
templates.o: ../../functions/login.h ../../functions/logout.h
templates.o: ../../functions/ln.h ../../functions/ls.h
templates.o: ../../functions/mkdir.h ../../functions/mv.h
templates.o: ../../functions/node.h ../../functions/priv.h
templates.o: ../../functions/reload.h ../../functions/rm.h
templates.o: ../../functions/run.h ../../functions/specialdefault.h
templates.o: ../../functions/stat.h ../../functions/subject.h
templates.o: ../../functions/funthread.h ../../functions/template.h
templates.o: ../../functions/tinymce.h ../../functions/uname.h
templates.o: ../../functions/upload.h ../../functions/uptime.h
templates.o: ../../functions/who.h ../../functions/vim.h
templates.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
templates.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
templates.o: editticket.h ../../functions/functionbase.h ../../core/synchro.h
templates.o: createticket.h ../../core/misc.h ../../core/plugin.h
templates.o: ../../core/pluginmsg.h ../../core/system.h
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
templates.o: ../../templates/templates.h ../../templates/patterncacher.h
templates.o: ../../templates/ckeditorgetparser.h
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
templates.o: sessiondata.h ../../core/plugindata.h
ticketconf.o: ticketconf.h
ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
ticketinfo.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h
ticketinfo.o: ../../db/dbbase.h ../../db/dbitemquery.h
ticketinfo.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
ticketinfo.o: ../../core/thread.h ../../core/dircontainer.h
ticketinfo.o: ../../core/ugcontainer.h ../../core/log.h
ticketinfo.o: ../../core/textstream.h ../../core/request.h
ticketinfo.o: ../../notify/notify.h ../../notify/notifypool.h
ticketinfo.o: ../../templates/locale.h ../../core/confparser.h
ticketinfo.o: ../../templates/misc.h ../../templates/localefilter.h
ticketinfo.o: ../../templates/locale.h ../../../ezc/src/ezc.h
ticketinfo.o: ../../../ezc/src/utf8.h ../../../ezc/src/generator.h
ticketinfo.o: ../../../ezc/src/pattern.h ../../../ezc/src/functions.h
ticketinfo.o: ../../../ezc/src/funinfo.h ../../../ezc/src/stringconv.h
ticketinfo.o: ../../templates/htmltextstream.h ../../notify/notifythread.h
ticketinfo.o: ../../core/basethread.h ../../core/synchro.h
ticketinfo.o: ../../notify/templatesnotify.h ../../core/textstream.h
ticketinfo.o: ../../core/misc.h ../../core/config.h ../../core/users.h
ticketinfo.o: ../../core/user.h ../../core/ugcontainer.h
ticketinfo.o: ../../core/lastcontainer.h ../../core/mounts.h
ticketinfo.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
ticketinfo.o: ../../core/config.h ../../core/confparser.h
ticketinfo.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
ticketinfo.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
ticketinfo.o: ../../core/thumb.h ../../core/basethread.h
ticketinfo.o: ../../functions/functions.h ../../functions/functionbase.h
ticketinfo.o: ../../functions/functionparser.h ../../core/request.h
ticketinfo.o: ../../core/requesttypes.h ../../core/session.h
ticketinfo.o: ../../core/plugindata.h ../../templates/htmltextstream.h
ticketinfo.o: ../../functions/adduser.h ../../functions/cat.h
ticketinfo.o: ../../functions/chmod.h ../../functions/privchanger.h
ticketinfo.o: ../../functions/chown.h ../../functions/ckeditor.h
ticketinfo.o: ../../functions/cp.h ../../functions/createthread.h
ticketinfo.o: ../../functions/default.h ../../functions/download.h
ticketinfo.o: ../../functions/emacs.h ../../functions/last.h
ticketinfo.o: ../../functions/login.h ../../functions/logout.h
ticketinfo.o: ../../functions/ln.h ../../functions/ls.h
ticketinfo.o: ../../functions/mkdir.h ../../functions/mv.h
ticketinfo.o: ../../functions/node.h ../../functions/priv.h
ticketinfo.o: ../../functions/reload.h ../../functions/rm.h
ticketinfo.o: ../../functions/run.h ../../functions/specialdefault.h
ticketinfo.o: ../../functions/stat.h ../../functions/subject.h
ticketinfo.o: ../../functions/funthread.h ../../functions/template.h
ticketinfo.o: ../../functions/tinymce.h ../../functions/uname.h
ticketinfo.o: ../../functions/upload.h ../../functions/uptime.h
ticketinfo.o: ../../functions/who.h ../../functions/vim.h
ticketinfo.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
ticketinfo.o: ../../core/log.h ../../core/misc.h sessiondata.h
ticketinfo.o: ../../core/plugindata.h
ticketparser.o: ticketparser.h ticketconf.h ../../core/log.h
ticketparser.o: ../../core/misc.h

1
plugins/thread/Makefile.o.dep Executable file
View File

@ -0,0 +1 @@
o = createticket.o editticket.o funticket.o init.o sessiondata.o showtickets.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o

141
plugins/thread/init.cpp Executable file
View File

@ -0,0 +1,141 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "tdb.h"
#include "funthread.h"
#include "createthread.h"
#include "showthreads.h"
#include "core/log.h"
#include "core/plugin.h"
extern "C" void Init(PluginInfo &);
namespace Thread
{
const wchar_t plugin_name[] = L"thread";
TDb tdb;
ThreadInfo thread_info;
FunThread fun_thread;
CreateThread fun_create_thread;
ShowThreads fun_show_threads;
void AddFunctions(PluginInfo & info)
{
info.functions->Add(fun_thread);
info.functions->Add(fun_create_thread);
}
void SelectDefaultFunction(PluginInfo & info)
{
if( info.system->mounts.pmount->type == thread_info.mount_type_thread )
{
if( info.request->is_item )
info.request->function = &fun_thread;
else
info.request->function = &fun_show_threads;
}
}
void AddMounts(PluginInfo & info)
{
Mounts & m = info.system->mounts;
ticket_info.mount_type_thread = m.AddMountType(L"thread");
ticket_info.mount_par_thread_enable = m.AddMountPar(L"thread_enable");
}
void ProcessRequest(PluginInfo & info)
{
if( info.request->function == &info.functions->fun_reload )
{
if( info.request->IsParam(L"tickets") )
ticket_info.ReadTicketConf();
}
}
void RemoveThread(PluginInfo & i)
{
}
void InitTicket(PluginInfo & info)
{
}
void AddNotifyTemplate(PluginInfo & info)
{
ticket_info.template_index = info.system->notify.AddTemplate(L"notify_email_thread.txt");
}
void AddEzcFunctions(PluginInfo & info);
} // namespace Thread
void Init(PluginInfo & info)
{
using namespace Ticket;
plugin.Assign(WINIX_CREATE_FUNCTIONS, AddFunctions);
plugin.Assign(WINIX_SELECT_DEFAULT_FUNCTION, SelectDefaultFunction);
plugin.Assign(WINIX_ADD_MOUNTS, AddMounts);
plugin.Assign(WINIX_FILE_REMOVED, RemoveThread);
plugin.Assign(WINIX_PLUGIN_INIT, InitTicket);
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
tdb.SetConn(info.db->GetConn());
tdb.LogQueries(info.config->log_db_query);
ticket_info.SetDb(info.db);
ticket_info.SetTDb(&tdb);
ticket_info.SetConfig(info.config);
ticket_info.SetSystem(info.system);
ticket_info.SetRequest(info.request);
ticket_info.SetFunctions(info.functions);
ticket_info.plugin_id = info.plugin_id;
fun_ticket.SetTDb(&tdb);
fun_ticket.SetTicketInfo(&ticket_info);
fun_edit_ticket.SetTDb(&tdb);
fun_edit_ticket.SetTicketInfo(&ticket_info);
fun_create_ticket.SetTDb(&tdb);
fun_create_ticket.SetTicketInfo(&ticket_info);
fun_show_tickets.SetTDb(&tdb);
fun_show_tickets.SetTicketInfo(&ticket_info);
info.p1 = (void*)(plugin_name);
}

23
plugins/thread/showthreads.cpp Executable file
View File

@ -0,0 +1,23 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "showthreads.h"
#include "functions.h"
namespace Thread
{
} // namespace

35
plugins/thread/showthreads.h Executable file
View File

@ -0,0 +1,35 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_thread_showthreads
#define headerfile_winix_plugins_thread_showthreads
#include "functions/functionbase.h"
namespace Thread
{
class ShowThreads : public FunctionBase
{
public:
bool HasAccess();
void MakePost();
private:
};
} // namespace
#endif

277
plugins/thread/tdb.cpp Executable file
View File

@ -0,0 +1,277 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "tdb.h"
#include "core/log.h"
namespace Thread
{
Error Db::GetThreadByDirId(long dir_id, Thread & thread)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
query.Clear();
query << R("select thread.id, thread.parent_id, thread.dir_id, thread.closed, thread.items, "
"thread.last_item, item.date_modification, item.user_id "
"from core.thread left join core.item on thread.last_item = item.id "
"where thread.dir_id = ") << dir_id << R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
int rows = Rows(r);
if( rows > 1 )
log << log1 << "Db: there is more than one thread with dir_id: " << dir_id << logend;
else
if( rows == 0 )
throw Error(WINIX_ERR_NO_THREAD);
int cid = AssertColumn(r, "id");
int cparent_id = AssertColumn(r, "parent_id");
int cdir_id = AssertColumn(r, "dir_id");
int cclosed = AssertColumn(r, "closed");
int citems = AssertColumn(r, "items");
int clast_item = AssertColumn(r, "last_item");
int cdate_modification = PQfnumber(r, "date_modification"); // !! tych kolumn mo¿e nie byæ? czemu PQfnumber a nie AssertColumn?
int cuser_id = PQfnumber(r, "user_id");
thread.id = AssertValueLong(r, 0, cid);
thread.parent_id = AssertValueLong(r, 0, cparent_id);
thread.dir_id = AssertValueLong(r, 0, cdir_id);
thread.closed = AssertValueLong(r, 0, cclosed) == 0 ? false : true;
thread.items = AssertValueLong(r, 0, citems);
thread.last_item.id = AssertValueLong(r, 0, clast_item);
thread.last_item.date_modification = AssertValueTm(r, 0, cdate_modification);
thread.last_item.user_id = AssertValueLong(r, 0, cuser_id);
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error Db::GetThreads(long parent_id, std::vector<Thread> & thread_tab)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
query.Clear();
query << R("select thread.id, thread.parent_id, thread.dir_id, thread.closed, "
"thread.items, thread.last_item, item.date_modification, item.user_id, item.guest_name "
"from core.thread left join core.item on thread.last_item = item.id "
"where thread.parent_id = ") << parent_id << R(" order by date_modification asc;");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
int rows = Rows(r);
Thread thread;
int cid = AssertColumn(r, "id");
int cparent_id = AssertColumn(r, "parent_id");
int cdir_id = AssertColumn(r, "dir_id");
int cclosed = AssertColumn(r, "closed");
int citems = AssertColumn(r, "items");
int clast_item = AssertColumn(r, "last_item");
int cdate_modification = PQfnumber(r, "date_modification"); // !! czemu tutaj jest pqfnumber zamiast assertcolumn?
int cuser_id = PQfnumber(r, "user_id");
int cguest_name = PQfnumber(r, "guest_name");
for(int i=0 ; i<rows ; ++i)
{
thread.id = AssertValueLong(r, i, cid);
thread.parent_id = AssertValueLong(r, i, cparent_id);
thread.dir_id = AssertValueLong(r, i, cdir_id);
thread.closed = AssertValueLong(r, i, cclosed) == 0 ? false : true;
thread.items = AssertValueLong(r, i, citems);
thread.last_item.id = AssertValueLong(r, i, clast_item);
thread.last_item.date_modification = AssertValueTm(r, i, cdate_modification);
thread.last_item.user_id = AssertValueLong(r, i, cuser_id);
thread.last_item.guest_name = AssertValueWide(r, i, cguest_name);
thread_tab.push_back(thread);
}
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error Db::AddThread(Thread & thread)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
query.Clear();
query << R("insert into core.thread (parent_id, dir_id, closed, items, last_item) values (")
<< thread.parent_id
<< thread.dir_id
<< (thread.closed ? 1 : 0 )
<< thread.items
<< thread.last_item.id
<< R(");");
r = AssertQuery(query);
AssertResult(r, PGRES_COMMAND_OK);
thread.id = AssertCurrval("core.thread_id_seq");
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error Db::EditThreadAddItem(long dir_id, long item_id)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
query.Clear();
query << R("update core.thread set (last_item, items) = (")
<< item_id
<< R(", items+1) where dir_id=")
<< dir_id
<< R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_COMMAND_OK);
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error Db::EditThreadRemoveItem(long dir_id)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
long last_item_id = -1;
query.Clear();
query << R("select id from core.item where parent_id=")
<< dir_id
<< R(" order by date_creation desc limit 1;");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
if( Rows(r) == 1 )
last_item_id = AssertValueLong(r, 0, 0);
ClearResult(r);
query.Clear();
query << R("update core.thread set (items, last_item) = (items-1,")
<< last_item_id
<< R(") where dir_id=")
<< dir_id
<< R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_COMMAND_OK);
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
Error Db::RemoveThread(long dir_id)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
try
{
query.Clear();
query << R("delete from core.thread where dir_id=") << dir_id << R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_COMMAND_OK);
long rows = AffectedRows(r);
if( rows > 0 )
log << log2 << "Db: deleted " << rows << " rows from core.thread" << logend;
}
catch(const Error & e)
{
status = e;
}
ClearResult(r);
return status;
}
} // namespace

47
plugins/thread/tdb.h Executable file
View File

@ -0,0 +1,47 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_thread_tdb
#define headerfile_winix_plugins_thread_tdb
#include <vector>
#include "ticket.h"
#include "db/dbbase.h"
#include "core/error.h"
namespace Thread
{
class TDb : public DbBase
{
public:
Error AddThread(Thread & thread);
Error GetThreadByDirId(long dir_id, Thread & thread);
Error GetThreads(long parent_id, std::vector<Thread> & thread_tab);
Error EditThreadAddItem(long dir_id, long item_id);
Error EditThreadRemoveItem(long dir_id);
Error RemoveThread(long dir_id);
private:
DbTextStream query;
};
} // namespace
#endif

36
plugins/thread/threadinfo.h Executable file
View File

@ -0,0 +1,36 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_thread_threadinfo
#define headerfile_winix_plugins_thread_threadinfo
namespace Thread
{
// id of a mount type
int mount_type_thread;
// enable a thread in a specific directory
int mount_par_thread_enable;
} // namespace
#endif

View File

@ -40,17 +40,18 @@ createticket.o: ../../functions/ckeditor.h ../../functions/cp.h
createticket.o: ../../functions/createthread.h ../../functions/default.h
createticket.o: ../../functions/download.h ../../functions/emacs.h
createticket.o: ../../functions/last.h ../../functions/login.h
createticket.o: ../../functions/logout.h ../../functions/ls.h
createticket.o: ../../functions/mkdir.h ../../functions/mv.h
createticket.o: ../../functions/node.h ../../functions/priv.h
createticket.o: ../../functions/reload.h ../../functions/rm.h
createticket.o: ../../functions/run.h ../../functions/specialdefault.h
createticket.o: ../../functions/stat.h ../../functions/subject.h
createticket.o: ../../functions/funthread.h ../../functions/template.h
createticket.o: ../../functions/tinymce.h ../../functions/uname.h
createticket.o: ../../functions/upload.h ../../functions/uptime.h
createticket.o: ../../functions/who.h ../../functions/vim.h
createticket.o: ../../core/htmlfilter.h
createticket.o: ../../functions/logout.h ../../functions/ln.h
createticket.o: ../../functions/ls.h ../../functions/mkdir.h
createticket.o: ../../functions/mv.h ../../functions/node.h
createticket.o: ../../functions/priv.h ../../functions/reload.h
createticket.o: ../../functions/rm.h ../../functions/run.h
createticket.o: ../../functions/specialdefault.h ../../functions/stat.h
createticket.o: ../../functions/subject.h ../../functions/funthread.h
createticket.o: ../../functions/template.h ../../functions/tinymce.h
createticket.o: ../../functions/uname.h ../../functions/upload.h
createticket.o: ../../functions/uptime.h ../../functions/who.h
createticket.o: ../../functions/vim.h ../../core/htmlfilter.h sessiondata.h
createticket.o: ../../core/plugindata.h
editticket.o: editticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
editticket.o: ../../db/dbtextstream.h ../../core/textstream.h
editticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
@ -78,28 +79,29 @@ editticket.o: ../../core/config.h ../../core/confparser.h
editticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
editticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
editticket.o: ../../core/thumb.h ../../core/basethread.h
editticket.o: ../../functions/functionbase.h ../../core/request.h
editticket.o: ../../functions/functions.h ../../functions/functionbase.h
editticket.o: ../../functions/functionparser.h ../../core/request.h
editticket.o: ../../core/requesttypes.h ../../core/session.h
editticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
editticket.o: ../../core/synchro.h ../../functions/functions.h
editticket.o: ../../functions/functionbase.h ../../functions/functionparser.h
editticket.o: ../../functions/adduser.h ../../functions/cat.h
editticket.o: ../../functions/chmod.h ../../functions/privchanger.h
editticket.o: ../../functions/chown.h ../../functions/ckeditor.h
editticket.o: ../../functions/cp.h ../../functions/createthread.h
editticket.o: ../../functions/functionbase.h ../../core/synchro.h
editticket.o: ../../functions/default.h ../../functions/download.h
editticket.o: ../../functions/emacs.h ../../functions/last.h
editticket.o: ../../functions/login.h ../../functions/logout.h
editticket.o: ../../functions/ls.h ../../functions/mkdir.h
editticket.o: ../../functions/mv.h ../../functions/node.h
editticket.o: ../../functions/priv.h ../../functions/reload.h
editticket.o: ../../functions/rm.h ../../functions/run.h
editticket.o: ../../functions/specialdefault.h ../../functions/stat.h
editticket.o: ../../functions/subject.h ../../functions/funthread.h
editticket.o: ../../functions/template.h ../../functions/tinymce.h
editticket.o: ../../functions/uname.h ../../functions/upload.h
editticket.o: ../../functions/uptime.h ../../functions/who.h
editticket.o: ../../functions/vim.h ../../core/htmlfilter.h
editticket.o: ../../functions/ln.h ../../functions/ls.h
editticket.o: ../../functions/mkdir.h ../../functions/mv.h
editticket.o: ../../functions/node.h ../../functions/priv.h
editticket.o: ../../functions/reload.h ../../functions/rm.h
editticket.o: ../../functions/run.h ../../functions/specialdefault.h
editticket.o: ../../functions/stat.h ../../functions/subject.h
editticket.o: ../../functions/funthread.h ../../functions/template.h
editticket.o: ../../functions/tinymce.h ../../functions/uname.h
editticket.o: ../../functions/upload.h ../../functions/uptime.h
editticket.o: ../../functions/who.h ../../functions/vim.h
editticket.o: ../../core/htmlfilter.h sessiondata.h ../../core/plugindata.h
funticket.o: funticket.h tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
funticket.o: ../../db/dbtextstream.h ../../core/textstream.h
funticket.o: ../../core/misc.h ../../core/item.h ../../core/error.h
@ -127,10 +129,29 @@ funticket.o: ../../core/config.h ../../core/confparser.h
funticket.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
funticket.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
funticket.o: ../../core/thumb.h ../../core/basethread.h
funticket.o: ../../functions/functionbase.h ../../core/request.h
funticket.o: ../../functions/functions.h ../../functions/functionbase.h
funticket.o: ../../functions/functionparser.h ../../core/request.h
funticket.o: ../../core/requesttypes.h ../../core/session.h
funticket.o: ../../core/plugindata.h ../../templates/htmltextstream.h
funticket.o: ../../core/synchro.h ../../core/misc.h
funticket.o: ../../functions/adduser.h ../../functions/cat.h
funticket.o: ../../functions/chmod.h ../../functions/privchanger.h
funticket.o: ../../functions/chown.h ../../functions/ckeditor.h
funticket.o: ../../functions/cp.h ../../functions/createthread.h
funticket.o: ../../functions/functionbase.h ../../core/synchro.h
funticket.o: ../../functions/default.h ../../functions/download.h
funticket.o: ../../functions/emacs.h ../../functions/last.h
funticket.o: ../../functions/login.h ../../functions/logout.h
funticket.o: ../../functions/ln.h ../../functions/ls.h
funticket.o: ../../functions/mkdir.h ../../functions/mv.h
funticket.o: ../../functions/node.h ../../functions/priv.h
funticket.o: ../../functions/reload.h ../../functions/rm.h
funticket.o: ../../functions/run.h ../../functions/specialdefault.h
funticket.o: ../../functions/stat.h ../../functions/subject.h
funticket.o: ../../functions/funthread.h ../../functions/template.h
funticket.o: ../../functions/tinymce.h ../../functions/uname.h
funticket.o: ../../functions/upload.h ../../functions/uptime.h
funticket.o: ../../functions/who.h ../../functions/vim.h
funticket.o: ../../core/htmlfilter.h
init.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
init.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
init.o: ../../core/item.h ../../core/error.h ../../core/log.h
@ -156,32 +177,86 @@ init.o: ../../core/mountparser.h ../../core/config.h ../../core/confparser.h
init.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
init.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
init.o: ../../core/thumb.h ../../core/basethread.h
init.o: ../../functions/functionbase.h ../../core/request.h
init.o: ../../functions/functions.h ../../functions/functionbase.h
init.o: ../../functions/functionparser.h ../../core/request.h
init.o: ../../core/requesttypes.h ../../core/session.h
init.o: ../../core/plugindata.h ../../templates/htmltextstream.h
init.o: ../../core/synchro.h editticket.h createticket.h ../../core/log.h
init.o: ../../core/plugin.h ../../core/pluginmsg.h ../../core/system.h
init.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
init.o: ../../functions/functions.h ../../functions/functionbase.h
init.o: ../../functions/functionparser.h ../../functions/adduser.h
init.o: ../../functions/cat.h ../../functions/chmod.h
init.o: ../../functions/privchanger.h ../../functions/chown.h
init.o: ../../functions/ckeditor.h ../../functions/cp.h
init.o: ../../functions/createthread.h ../../functions/default.h
init.o: ../../functions/download.h ../../functions/emacs.h
init.o: ../../functions/last.h ../../functions/login.h
init.o: ../../functions/logout.h ../../functions/ls.h ../../functions/mkdir.h
init.o: ../../functions/mv.h ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/adduser.h ../../functions/cat.h
init.o: ../../functions/chmod.h ../../functions/privchanger.h
init.o: ../../functions/chown.h ../../functions/ckeditor.h
init.o: ../../functions/cp.h ../../functions/createthread.h
init.o: ../../functions/functionbase.h ../../core/synchro.h
init.o: ../../functions/default.h ../../functions/download.h
init.o: ../../functions/emacs.h ../../functions/last.h
init.o: ../../functions/login.h ../../functions/logout.h ../../functions/ln.h
init.o: ../../functions/ls.h ../../functions/mkdir.h ../../functions/mv.h
init.o: ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/reload.h ../../functions/rm.h ../../functions/run.h
init.o: ../../functions/specialdefault.h ../../functions/stat.h
init.o: ../../functions/subject.h ../../functions/funthread.h
init.o: ../../functions/template.h ../../functions/tinymce.h
init.o: ../../functions/uname.h ../../functions/upload.h
init.o: ../../functions/uptime.h ../../functions/who.h ../../functions/vim.h
init.o: ../../core/htmlfilter.h ../../templates/templates.h
init.o: ../../core/htmlfilter.h editticket.h createticket.h showtickets.h
init.o: ../../core/log.h ../../core/plugin.h ../../core/pluginmsg.h
init.o: ../../core/system.h ../../core/sessionmanager.h
init.o: ../../core/sessioncontainer.h ../../templates/templates.h
init.o: ../../templates/patterncacher.h ../../templates/ckeditorgetparser.h
init.o: ../../core/httpsimpleparser.h ../../core/log.h
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
init.o: sessiondata.h ../../core/plugindata.h
sessiondata.o: sessiondata.h ../../core/plugindata.h ticket.h
showtickets.o: showtickets.h tdb.h ticket.h ../../db/dbbase.h
showtickets.o: ../../db/dbconn.h ../../db/dbtextstream.h
showtickets.o: ../../core/textstream.h ../../core/misc.h ../../core/item.h
showtickets.o: ../../core/error.h ../../core/log.h ../../core/textstream.h
showtickets.o: ticketinfo.h ticketparser.h ticketconf.h ../../core/item.h
showtickets.o: ../../core/system.h ../../core/dirs.h
showtickets.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
showtickets.o: ../../db/dbitemquery.h ../../db/dbitemcolumns.h
showtickets.o: ../../core/user.h ../../core/group.h ../../core/thread.h
showtickets.o: ../../core/dircontainer.h ../../core/ugcontainer.h
showtickets.o: ../../core/request.h ../../notify/notify.h
showtickets.o: ../../notify/notifypool.h ../../templates/locale.h
showtickets.o: ../../core/confparser.h ../../templates/misc.h
showtickets.o: ../../templates/localefilter.h ../../templates/locale.h
showtickets.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
showtickets.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
showtickets.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
showtickets.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
showtickets.o: ../../notify/notifythread.h ../../core/basethread.h
showtickets.o: ../../core/synchro.h ../../notify/templatesnotify.h
showtickets.o: ../../core/config.h ../../core/users.h ../../core/user.h
showtickets.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
showtickets.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
showtickets.o: ../../core/mountparser.h ../../core/config.h
showtickets.o: ../../core/confparser.h ../../core/htmlfilter.h
showtickets.o: ../../core/users.h ../../core/groups.h ../../core/group.h
showtickets.o: ../../core/rebus.h ../../core/loadavg.h ../../core/thumb.h
showtickets.o: ../../core/basethread.h ../../functions/functions.h
showtickets.o: ../../functions/functionbase.h
showtickets.o: ../../functions/functionparser.h ../../core/request.h
showtickets.o: ../../core/requesttypes.h ../../core/session.h
showtickets.o: ../../core/plugindata.h ../../templates/htmltextstream.h
showtickets.o: ../../functions/adduser.h ../../functions/cat.h
showtickets.o: ../../functions/chmod.h ../../functions/privchanger.h
showtickets.o: ../../functions/chown.h ../../functions/ckeditor.h
showtickets.o: ../../functions/cp.h ../../functions/createthread.h
showtickets.o: ../../functions/functionbase.h ../../core/synchro.h
showtickets.o: ../../functions/default.h ../../functions/download.h
showtickets.o: ../../functions/emacs.h ../../functions/last.h
showtickets.o: ../../functions/login.h ../../functions/logout.h
showtickets.o: ../../functions/ln.h ../../functions/ls.h
showtickets.o: ../../functions/mkdir.h ../../functions/mv.h
showtickets.o: ../../functions/node.h ../../functions/priv.h
showtickets.o: ../../functions/reload.h ../../functions/rm.h
showtickets.o: ../../functions/run.h ../../functions/specialdefault.h
showtickets.o: ../../functions/stat.h ../../functions/subject.h
showtickets.o: ../../functions/funthread.h ../../functions/template.h
showtickets.o: ../../functions/tinymce.h ../../functions/uname.h
showtickets.o: ../../functions/upload.h ../../functions/uptime.h
showtickets.o: ../../functions/who.h ../../functions/vim.h
showtickets.o: ../../core/htmlfilter.h
tdb.o: tdb.h ticket.h ../../db/dbbase.h ../../db/dbconn.h
tdb.o: ../../db/dbtextstream.h ../../core/textstream.h ../../core/misc.h
tdb.o: ../../core/item.h ../../core/error.h ../../core/log.h
@ -210,24 +285,20 @@ templates.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
templates.o: ../../core/config.h ../../core/confparser.h
templates.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
templates.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
templates.o: ../../core/thumb.h ../../core/basethread.h tdb.h
templates.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
templates.o: ../../core/error.h editticket.h ../../functions/functionbase.h
templates.o: ../../core/request.h ../../core/requesttypes.h
templates.o: ../../core/session.h ../../core/plugindata.h
templates.o: ../../templates/htmltextstream.h ../../core/synchro.h
templates.o: createticket.h ../../core/misc.h ../../core/plugin.h
templates.o: ../../core/pluginmsg.h ../../core/system.h
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
templates.o: ../../core/thumb.h ../../core/basethread.h
templates.o: ../../functions/functions.h ../../functions/functionbase.h
templates.o: ../../functions/functionparser.h ../../functions/adduser.h
templates.o: ../../functions/cat.h ../../functions/chmod.h
templates.o: ../../functions/privchanger.h ../../functions/chown.h
templates.o: ../../functions/ckeditor.h ../../functions/cp.h
templates.o: ../../functions/createthread.h ../../functions/default.h
templates.o: ../../functions/download.h ../../functions/emacs.h
templates.o: ../../functions/last.h ../../functions/login.h
templates.o: ../../functions/logout.h ../../functions/ls.h
templates.o: ../../functions/functionparser.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../core/session.h
templates.o: ../../core/plugindata.h ../../templates/htmltextstream.h
templates.o: ../../functions/adduser.h ../../functions/cat.h
templates.o: ../../functions/chmod.h ../../functions/privchanger.h
templates.o: ../../functions/chown.h ../../functions/ckeditor.h
templates.o: ../../functions/cp.h ../../functions/createthread.h
templates.o: ../../functions/functionbase.h ../../core/synchro.h
templates.o: ../../functions/default.h ../../functions/download.h
templates.o: ../../functions/emacs.h ../../functions/last.h
templates.o: ../../functions/login.h ../../functions/logout.h
templates.o: ../../functions/ln.h ../../functions/ls.h
templates.o: ../../functions/mkdir.h ../../functions/mv.h
templates.o: ../../functions/node.h ../../functions/priv.h
templates.o: ../../functions/reload.h ../../functions/rm.h
@ -237,11 +308,16 @@ templates.o: ../../functions/funthread.h ../../functions/template.h
templates.o: ../../functions/tinymce.h ../../functions/uname.h
templates.o: ../../functions/upload.h ../../functions/uptime.h
templates.o: ../../functions/who.h ../../functions/vim.h
templates.o: ../../core/htmlfilter.h ../../templates/templates.h
templates.o: ../../templates/patterncacher.h
templates.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
templates.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
templates.o: editticket.h createticket.h ../../core/misc.h
templates.o: ../../core/plugin.h ../../core/pluginmsg.h ../../core/system.h
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
templates.o: ../../templates/templates.h ../../templates/patterncacher.h
templates.o: ../../templates/ckeditorgetparser.h
templates.o: ../../core/httpsimpleparser.h ../../core/log.h
templates.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
templates.o: sessiondata.h ../../core/plugindata.h
ticketconf.o: ticketconf.h
ticketinfo.o: ticketinfo.h ticket.h ticketparser.h ticketconf.h
ticketinfo.o: ../../core/item.h ../../core/system.h ../../core/dirs.h
@ -268,7 +344,32 @@ ticketinfo.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
ticketinfo.o: ../../core/config.h ../../core/confparser.h
ticketinfo.o: ../../core/htmlfilter.h ../../core/users.h ../../core/groups.h
ticketinfo.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
ticketinfo.o: ../../core/thumb.h ../../core/basethread.h tdb.h
ticketinfo.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
ticketinfo.o: ../../core/error.h ../../core/log.h ../../core/misc.h
ticketinfo.o: ../../core/thumb.h ../../core/basethread.h
ticketinfo.o: ../../functions/functions.h ../../functions/functionbase.h
ticketinfo.o: ../../functions/functionparser.h ../../core/request.h
ticketinfo.o: ../../core/requesttypes.h ../../core/session.h
ticketinfo.o: ../../core/plugindata.h ../../templates/htmltextstream.h
ticketinfo.o: ../../functions/adduser.h ../../functions/cat.h
ticketinfo.o: ../../functions/chmod.h ../../functions/privchanger.h
ticketinfo.o: ../../functions/chown.h ../../functions/ckeditor.h
ticketinfo.o: ../../functions/cp.h ../../functions/createthread.h
ticketinfo.o: ../../functions/functionbase.h ../../core/synchro.h
ticketinfo.o: ../../functions/default.h ../../functions/download.h
ticketinfo.o: ../../functions/emacs.h ../../functions/last.h
ticketinfo.o: ../../functions/login.h ../../functions/logout.h
ticketinfo.o: ../../functions/ln.h ../../functions/ls.h
ticketinfo.o: ../../functions/mkdir.h ../../functions/mv.h
ticketinfo.o: ../../functions/node.h ../../functions/priv.h
ticketinfo.o: ../../functions/reload.h ../../functions/rm.h
ticketinfo.o: ../../functions/run.h ../../functions/specialdefault.h
ticketinfo.o: ../../functions/stat.h ../../functions/subject.h
ticketinfo.o: ../../functions/funthread.h ../../functions/template.h
ticketinfo.o: ../../functions/tinymce.h ../../functions/uname.h
ticketinfo.o: ../../functions/upload.h ../../functions/uptime.h
ticketinfo.o: ../../functions/who.h ../../functions/vim.h
ticketinfo.o: ../../core/htmlfilter.h tdb.h ../../db/dbbase.h
ticketinfo.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
ticketinfo.o: ../../core/log.h ../../core/misc.h sessiondata.h
ticketinfo.o: ../../core/plugindata.h
ticketparser.o: ticketparser.h ticketconf.h ../../core/log.h
ticketparser.o: ../../core/misc.h

View File

@ -1 +1 @@
o = createticket.o editticket.o funticket.o init.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o
o = createticket.o editticket.o funticket.o init.o sessiondata.o showtickets.o tdb.o templates.o ticketconf.o ticketinfo.o ticketparser.o

View File

@ -9,6 +9,8 @@
#include "createticket.h"
#include "functions/functions.h"
#include "sessiondata.h"
namespace Ticket
@ -36,76 +38,61 @@ void CreateTicket::SetTicketInfo(TicketInfo * pinfo)
void CreateTicket::Clear()
bool CreateTicket::HasAccess()
{
ticket_info->Clear();
}
// returning true if we can create a ticket in the current directory
bool CreateTicket::HasAccess(bool check_root)
{
if( request->dir_tab.empty() )
return false;
if( request->is_item )
return false;
if( !system->HasWriteAccess(*request->dir_tab.back()) )
if( request->is_item || !system->HasWriteAccess(*request->dir_tab.back()) )
return false;
if( !system->mounts.pmount || system->mounts.pmount->type != ticket_info->mount_type_ticket )
return false;
return true;
}
void CreateTicket::AddTicket(Ticket & ticket, Item & item)
{
ticket.file_id = item.id;
request->status = tdb->AddTicket(ticket);
if( request->status == WINIX_ERR_OK )
{
// sending notification
notify_msg.code = WINIX_NOTIFY_CODE_USER1;
notify_msg.template_index = ticket_info->template_index;
notify_msg.dir_link = config->base_url;
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
notify_msg.item_link = notify_msg.dir_link;
notify_msg.item_link += item.url;
system->notify.ItemChanged(notify_msg);
}
}
void CreateTicket::Submit(Ticket & ticket, Item & item)
{
if( functions->CheckAbuse() )
return;
functions->SetUser(item);
item.privileges = 0644; // !! tymczasowo
item.parent_id = request->dir_tab.back()->id;
// adding without notificating
request->status = system->AddFile(item, false);
if( request->status == WINIX_ERR_OK )
AddTicket(ticket, item);
// checking for par_createticket_on mount option
if( !check_root && request->session && request->session->puser && request->session->puser->super_user )
// super can create tickets regardless of the createticket_on option
return true;
if( !system->mounts.pmount->IsPar(ticket_info->mount_par_createticket_on) )
return true;
if( system->mounts.pmount->IsArg(ticket_info->mount_par_createticket_on, request->dir_tab.size()) )
return true;
return false;
}
bool CreateTicket::HasAccess()
{
return HasAccess(false);
}
void CreateTicket::AddTicket()
{
// a new directory created by system->AddDir()
ticket_info->ticket.dir_id = request->dir_tab.back()->id;
request->status = tdb->AddTicket(ticket_info->ticket);
// sending notification
notify_msg.code = WINIX_NOTIFY_CODE_USER1;
notify_msg.template_index = ticket_info->template_index;
system->dirs.MakePath(ticket_info->item.parent_id, tmp_path);
notify_msg.item_link = config->base_url;
notify_msg.item_link += tmp_path;
notify_msg.dir_link = notify_msg.item_link;
system->notify.ItemChanged(notify_msg);
}
void CreateTicket::LogAndRedirect()
{
if( request->status == WINIX_ERR_OK )
{
log << log2 << "CreateTicket: added a new ticket" << logend;
system->RedirectToLastDir();
RemoveTicket();
system->RedirectTo(item);
}
else
{
@ -116,41 +103,55 @@ void CreateTicket::LogAndRedirect()
void CreateTicket::RemoveTicket()
{
SessionData * session_data = reinterpret_cast<SessionData*>(
request->session->plugin_data.Get(ticket_info->plugin_id) );
long dir_id = request->dir_tab.back()->id;
session_data->create_ticket_map.erase(dir_id);
}
Ticket & CreateTicket::PrepareTicket()
{
SessionData * session_data = reinterpret_cast<SessionData*>(
request->session->plugin_data.Get(ticket_info->plugin_id) );
long dir_id = request->dir_tab.back()->id;
Ticket & ticket = session_data->GetTicket(dir_id, session_data->create_ticket_map);
return ticket;
}
void CreateTicket::MakePost()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
functions->ReadItem(ticket_info->item, Item::file);
functions->SetUser(ticket_info->item);
ticket_info->item.privileges = request->dir_tab.back()->privileges; // !! tymczasowo takie same jak z katalogu nadrzednego
ticket_info->ReadTicketParams();
Ticket & ticket = PrepareTicket();
Item & item = request->item;
ticket_info->ticket = &ticket;
if( functions->CheckAbuse() )
return;
ticket_info->ReadTicketParams(ticket, false);
functions->ReadItem(item, Item::file);
ticket_info->item.type = Item::dir;
request->status = system->dirs.AddDirectory(ticket_info->item, true);
if( request->status == WINIX_ERR_OK )
{
ticket_info->item.type = Item::file;
ticket_info->item.privileges = 0644; // !! tymczasowo
ticket_info->item.parent_id = request->dir_tab.back()->id;
// adding without notificating
request->status = system->AddFile(ticket_info->item, false);
if( request->status == WINIX_ERR_OK )
AddTicket();
}
LogAndRedirect();
if( !request->IsPostVar(L"fileuploadsubmit") )
Submit(ticket, item);
}
void CreateTicket::MakeGet()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
Ticket & ticket = PrepareTicket();
ticket_info->ticket = &ticket;
}

View File

@ -28,21 +28,20 @@ public:
void SetTDb(TDb * ptdb);
void SetTicketInfo(TicketInfo * pinfo);
void Clear();
bool HasAccess(bool check_root);
bool HasAccess();
void MakePost();
void MakeGet();
private:
void AddTicket();
void LogAndRedirect();
void AddTicket(Ticket & ticket, Item & item);
void Submit(Ticket & ticket, Item & item);
void RemoveTicket();
Ticket & PrepareTicket();
TDb * tdb;
TicketInfo * ticket_info;
NotifyMsg notify_msg;
std::wstring tmp_path;
};

View File

@ -9,13 +9,15 @@
#include "editticket.h"
#include "functions/functions.h"
#include "sessiondata.h"
namespace Ticket
{
EditTicket::EditTicket()
{
fun.url = L"editticket";
@ -34,27 +36,15 @@ void EditTicket::SetTicketInfo(TicketInfo * pinfo)
}
void EditTicket::Clear()
{
ticket_info->Clear();
}
bool EditTicket::HasAccess()
{
// not logged users cannot edit tickets
// !! we are waiting for the sticky bit
if( !request->session->puser )
return false;
if( request->dir_tab.empty() )
return false;
ticket_info->ReadTicket(request->dir_tab.back()->id);
if( request->is_item || !ticket_info->is_ticket )
return false;
if( !system->HasWriteAccess(*request->dir_tab.back()) )
if( !request->is_item || !system->HasWriteAccess(request->item) )
return false;
if( !system->mounts.pmount || system->mounts.pmount->type != ticket_info->mount_type_ticket )
@ -66,89 +56,43 @@ return true;
void EditTicket::GetFirstItem(Item & item)
void EditTicket::ChangeTicket(Ticket & ticket, Item & item)
{
if( request->status != WINIX_ERR_OK )
return;
request->status = tdb->RemoveAddTicket(ticket);
DbItemQuery iq;
iq.Limit(1);
iq.WhereParentId(request->dir_tab.back()->id);
db->GetItems(item_tab, iq); // !! chwilowo GetItems() nie zwraca zadnych kodow bledow
if( request->status != WINIX_ERR_OK )
return;
if( item_tab.empty() )
{
// creating a new item (the item was deleted by a user)
item.parent_id = request->dir_tab.back()->id;
item.subject = request->dir_tab.back()->subject;
item.type = Item::file;
item.privileges = 0644; // !! tymczasowo
functions->SetUser(item);
functions->PrepareUrl(item);
request->status = system->AddFile(item);
if( request->status == WINIX_ERR_OK )
log << log2 << "EditTicket: added the first item with content for the ticket, item.id: "
<< item.id << logend;
}
else
{
item = item_tab[0];
}
}
void EditTicket::ModifyTicket()
{
if( request->status != WINIX_ERR_OK )
return;
ticket_info->ReadTicketParams();
request->status = tdb->RemoveAddTicket(ticket_info->ticket);
}
void EditTicket::ModifyLastDir()
{
if( request->status != WINIX_ERR_OK )
return;
// we don't modify the url
Item & dir = *request->dir_tab.back();
if( dir.subject != ticket_info->item.subject )
{
dir.subject = ticket_info->item.subject;
request->status = db->EditItemById(dir, false);
}
}
void EditTicket::ModifyFirstItem()
{
if( request->status != WINIX_ERR_OK )
return;
// we don't modify the url and don't use notifications
system->EditFile(ticket_info->item, false, false);
}
void EditTicket::LogAndRedirect()
{
if( request->status == WINIX_ERR_OK )
{
log << log2 << "EditTicket: edited a ticket" << logend;
system->RedirectToLastDir();
// sending notification
/*
notify_msg.code = WINIX_NOTIFY_CODE_USER1;
notify_msg.template_index = ticket_info->template_index;
notify_msg.dir_link = config->base_url;
system->dirs.MakePath(item.parent_id, notify_msg.dir_link, false);
notify_msg.item_link = notify_msg.dir_link;
notify_msg.item_link += item.url;
system->notify.ItemChanged(notify_msg);
*/
}
}
void EditTicket::Submit(Ticket & ticket, Item & item)
{
if( functions->CheckAbuse() )
return;
// adding without notificating
request->status = system->EditFile(item, old_url != item.url);
if( request->status == WINIX_ERR_OK )
ChangeTicket(ticket, item);
if( request->status == WINIX_ERR_OK )
{
log << log2 << "EditTicket: ticket modified" << logend;
RemoveTicket();
system->RedirectTo(item);
}
else
{
@ -159,29 +103,65 @@ void EditTicket::LogAndRedirect()
void EditTicket::RemoveTicket()
{
SessionData * session_data = reinterpret_cast<SessionData*>(
request->session->plugin_data.Get(ticket_info->plugin_id) );
long file_id = request->item.id;
session_data->create_ticket_map.erase(file_id);
session_data->new_file_map.erase(file_id);
}
Ticket & EditTicket::PrepareTicket()
{
SessionData * session_data = reinterpret_cast<SessionData*>(
request->session->plugin_data.Get(ticket_info->plugin_id) );
bool is_new;
long file_id = request->item.id;
Ticket & ticket = session_data->GetTicket(file_id, session_data->edit_ticket_map, &is_new);
if( is_new )
tdb->GetTicket(file_id, ticket);
else
ticket.file_id = file_id;
return ticket;
}
std::vector<long> & EditTicket::PrepareFileMap()
{
SessionData * session_data = reinterpret_cast<SessionData*>(
request->session->plugin_data.Get(ticket_info->plugin_id) );
long file_id = request->item.id;
std::vector<long> & file_map = session_data->GetFileTab(file_id, session_data->new_file_map);
return file_map;
}
void EditTicket::MakePost()
{
ticket_info->FindCurrentConf();
// reading the first item from the db or creating it if not exists
GetFirstItem(ticket_info->item);
Ticket & ticket = PrepareTicket();
Item & item = request->item;
old_url = item.url;
std::vector<long> & file_map = PrepareFileMap();
ticket_info->ticket = &ticket;
// reading information from POST
functions->ReadItem(ticket_info->item, Item::file);
ticket_info->ReadTicketParams(ticket, false, &file_map);
functions->ReadItem(item, Item::file);
if( functions->CheckAbuse() )
return;
if( tdb->GetTicket(request->dir_tab.back()->id, ticket_info->ticket) != WINIX_ERR_OK )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
ModifyTicket();
ModifyLastDir();
ModifyFirstItem();
LogAndRedirect();
if( !request->IsPostVar(L"fileuploadsubmit") )
Submit(ticket, item);
}
@ -190,19 +170,8 @@ void EditTicket::MakeGet()
{
ticket_info->FindCurrentConf();
DbItemQuery iq;
iq.Limit(1);
iq.WhereParentId(request->dir_tab.back()->id);
db->GetItems(item_tab, iq); // !! chwilowo GetItems() nie zwraca kodow bledow
if( request->status != WINIX_ERR_OK )
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( !item_tab.empty() )
ticket_info->item = item_tab[0];
Ticket & ticket = PrepareTicket();
ticket_info->ticket = &ticket;
}

View File

@ -28,22 +28,22 @@ public:
void SetTDb(TDb * ptdb);
void SetTicketInfo(TicketInfo * pinfo);
void Clear();
bool HasAccess();
void MakePost();
void MakeGet();
private:
void GetFirstItem(Item & item);
void ModifyTicket();
void ModifyLastDir();
void ModifyFirstItem();
void LogAndRedirect();
void RemoveTicket();
Ticket & PrepareTicket();
std::vector<long> & PrepareFileMap();
std::wstring old_url;
void ChangeTicket(Ticket & ticket, Item & item);
void Submit(Ticket & ticket, Item & item);
TDb * tdb;
TicketInfo * ticket_info;
std::vector<Item> item_tab;
};

View File

@ -7,10 +7,7 @@
*
*/
#include <ctime>
#include <algorithm>
#include "funticket.h"
#include "core/misc.h"
@ -37,102 +34,21 @@ void FunTicket::SetTicketInfo(TicketInfo * pinfo)
}
void FunTicket::Clear()
{
ticket_info->Clear();
}
bool FunTicket::HasAccess()
{
return !request->is_item;
return request->is_item && system->HasReadAccess(request->item);
}
void FunTicket::MakeGet()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
ticket_info->ReadTicket(request->dir_tab.back()->id);
ticket_info->ticket = &ticket;
DbItemQuery iq;
iq.WhereParentId(request->dir_tab.back()->id);
iq.WhereType(Item::file);
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
db->GetItems(request->item_tab, iq);
if( !request->item_tab.empty() )
{
if( system->HasReadAccess(request->item_tab[0]) )
{
ticket_info->item = request->item_tab[0];
request->item_tab.erase(request->item_tab.begin());
}
else
{
request->status = WINIX_ERR_PERMISSION_DENIED;
return;
}
}
system->CheckAccessToItems(request->item_tab);
SelectTickets();
tdb->GetTicket(request->item.id, ticket);
}
void FunTicket::SelectTickets()
{
child_tab.clear();
system->dirs.GetDirChilds(request->dir_tab.back()->id, child_tab);
SortDirs();
PageDirs();
CreateIdTab();
tdb->GetTickets(id_tab, ticket_info->ticket_tab);
ticket_info->SortTickets();
}
bool FunTicket::SortByDate::operator()(const Item * item1, const Item * item2)
{
tm tm1 = item1->date_creation;
tm tm2 = item2->date_creation;
time_t time1 = Time(tm1);
time_t time2 = Time(tm2);
return time1 < time2;
}
void FunTicket::SortDirs()
{
// temporarily sorting by date
SortByDate sort(this);
std::sort(child_tab.begin(), child_tab.end(), sort);
}
void FunTicket::PageDirs()
{
// temporarily show every tickets
}
void FunTicket::CreateIdTab()
{
id_tab.clear();
for(size_t i=0 ; i<child_tab.size() ; ++i)
id_tab.push_back(child_tab[i]->id);
}
} // namespace

View File

@ -12,7 +12,6 @@
#include "tdb.h"
#include "ticketinfo.h"
#include "core/item.h"
#include "functions/functionbase.h"
@ -28,7 +27,6 @@ public:
void SetTDb(TDb * ptdb);
void SetTicketInfo(TicketInfo * pinfo);
void Clear();
bool HasAccess();
void MakeGet();
@ -36,20 +34,7 @@ private:
TDb * tdb;
TicketInfo * ticket_info;
std::vector<Item*> child_tab;
std::vector<long> id_tab;
struct SortByDate
{
FunTicket * fun_ticket;
SortByDate(FunTicket * f) : fun_ticket(f) {}
bool operator()(const Item * item1, const Item * item2);
};
void SelectTickets();
void SortDirs();
void PageDirs();
void CreateIdTab();
Ticket ticket;
};

View File

@ -11,8 +11,10 @@
#include "funticket.h"
#include "editticket.h"
#include "createticket.h"
#include "showtickets.h"
#include "core/log.h"
#include "core/plugin.h"
#include "sessiondata.h"
extern "C" void Init(PluginInfo &);
@ -28,7 +30,7 @@ TicketInfo ticket_info;
FunTicket fun_ticket;
CreateTicket fun_create_ticket;
EditTicket fun_edit_ticket;
ShowTickets fun_show_tickets;
void AddFunctions(PluginInfo & info)
@ -36,16 +38,19 @@ void AddFunctions(PluginInfo & info)
info.functions->Add(fun_ticket);
info.functions->Add(fun_create_ticket);
info.functions->Add(fun_edit_ticket);
info.functions->Add(fun_show_tickets);
}
void SelectDefaultFunction(PluginInfo & info)
{
if( info.request->is_item )
return;
if( info.system->mounts.pmount->type == ticket_info.mount_type_ticket )
info.request->function = &fun_ticket;
{
if( info.request->is_item )
info.request->function = &fun_ticket;
else
info.request->function = &fun_show_tickets;
}
}
@ -53,22 +58,8 @@ void AddMounts(PluginInfo & info)
{
Mounts & m = info.system->mounts;
ticket_info.mount_type_ticket = m.AddMountType(L"ticket");
ticket_info.mount_par_ticket = m.AddMountPar(L"ticket");
ticket_info.mount_par_ticket_conf = m.AddMountPar(L"ticket_conf");
// !! bedzie do usuniecia
ticket_info.mount_par_ticket_type = m.AddMountPar(L"ticket_type");
ticket_info.mount_par_ticket_type_default = m.AddMountPar(L"ticket_type_default");
ticket_info.mount_par_ticket_status = m.AddMountPar(L"ticket_status");
ticket_info.mount_par_ticket_status_default = m.AddMountPar(L"ticket_status_default");
ticket_info.mount_par_ticket_priority = m.AddMountPar(L"ticket_priority");
ticket_info.mount_par_ticket_priority_default = m.AddMountPar(L"ticket_priority_default");
ticket_info.mount_par_ticket_category = m.AddMountPar(L"ticket_category");
ticket_info.mount_par_ticket_category_default = m.AddMountPar(L"ticket_category_default");
ticket_info.mount_par_ticket_expected = m.AddMountPar(L"ticket_expected");
ticket_info.mount_par_ticket_expected_default = m.AddMountPar(L"ticket_expected_default");
ticket_info.mount_par_createticket_on = m.AddMountPar(L"createticket_on");
ticket_info.mount_type_ticket = m.AddMountType(L"ticket");
ticket_info.mount_par_ticket_conf = m.AddMountPar(L"ticket_conf");
}
@ -90,6 +81,8 @@ void ProcessRequest(PluginInfo & info)
}
void RemoveTicket(PluginInfo & i)
{
tdb.RemoveTicket(i.l1);
@ -104,7 +97,22 @@ void InitTicket(PluginInfo & info)
void AddNotifyTemplate(PluginInfo & info)
{
ticket_info.template_index = info.system->notify.AddTemplate(L"notify_email_ticket.txt");
ticket_info.template_index = info.system->notify.AddTemplate(L"notify_email_ticket.txt");
}
void CreateSession(PluginInfo & info)
{
SessionData * p = new SessionData();
info.request->session->plugin_data.Assign(p);
log << log4 << "Ticket: created ticket plugin data: " << (void*)p << logend;
}
void RemoveSession(PluginInfo & info)
{
delete info.plugin_data_base;
log << log4 << "Ticket: removed ticket plugin date: " << (void*)info.plugin_data_base << logend;
}
@ -125,16 +133,21 @@ using namespace Ticket;
plugin.Assign(WINIX_ADD_MOUNTS, AddMounts);
plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged);
plugin.Assign(WINIX_PROCESS_REQUEST, ProcessRequest);
plugin.Assign(WINIX_DIR_REMOVED, RemoveTicket);
plugin.Assign(WINIX_FILE_REMOVED, RemoveTicket);
plugin.Assign(WINIX_NOTIFY_ADD_TEMPLATE, AddNotifyTemplate);
plugin.Assign(WINIX_SESSION_CREATED, CreateSession);
plugin.Assign(WINIX_SESSION_REMOVE, RemoveSession);
tdb.SetConn(info.db->GetConn());
tdb.LogQueries(info.config->log_db_query);
ticket_info.SetDb(info.db);
ticket_info.SetTDb(&tdb);
ticket_info.SetConfig(info.config);
ticket_info.SetSystem(info.system);
ticket_info.SetRequest(info.request);
ticket_info.SetFunctions(info.functions);
ticket_info.plugin_id = info.plugin_id;
fun_ticket.SetTDb(&tdb);
fun_ticket.SetTicketInfo(&ticket_info);
@ -145,6 +158,9 @@ using namespace Ticket;
fun_create_ticket.SetTDb(&tdb);
fun_create_ticket.SetTicketInfo(&ticket_info);
fun_show_tickets.SetTDb(&tdb);
fun_show_tickets.SetTicketInfo(&ticket_info);
info.p1 = (void*)(plugin_name);
}

42
plugins/ticket/sessiondata.cpp Executable file
View File

@ -0,0 +1,42 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "sessiondata.h"
namespace Ticket
{
Ticket & SessionData::GetTicket(long id, SessionData::TicketMap & ticket_map, bool * is_new)
{
std::pair<TicketMap::iterator, bool> res = ticket_map.insert( std::make_pair(id, Ticket()) );
if( is_new )
*is_new = res.second;
return res.first->second;
}
std::vector<long> & SessionData::GetFileTab(long id, FileMap & file_map)
{
std::pair<FileMap::iterator, bool> res = file_map.insert( std::make_pair(id, std::vector<long>()) );
return res.first->second;
}
} // namespace

53
plugins/ticket/sessiondata.h Executable file
View File

@ -0,0 +1,53 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_ticket_sessiondata
#define headerfile_winix_plugins_ticket_sessiondata
#include <vector>
#include <string>
#include <map>
#include "core/plugindata.h"
#include "ticket.h"
namespace Ticket
{
struct SessionData : public PluginDataBase
{
typedef std::map<long, Ticket> TicketMap;
typedef std::map<long, std::vector<long> > FileMap;
// temporary tickets for 'createticket' function
// <parent_dir_id, Ticket>
TicketMap create_ticket_map;
// temporary tickets for 'editticket' function
// <file_id, Ticket>
TicketMap edit_ticket_map;
// temporary files for 'editticket' function
// these files should be deleted if a user will not click on the submit button
FileMap new_file_map;
// inserting and returning a new ticket or just returning the ticket if it exists
Ticket & GetTicket(long id, TicketMap & ticket_map, bool * is_new = 0);
std::vector<long> & GetFileTab(long id, FileMap & file_map);
};
} // namespace
#endif

138
plugins/ticket/showtickets.cpp Executable file
View File

@ -0,0 +1,138 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include <ctime>
#include <algorithm>
#include "showtickets.h"
namespace Ticket
{
ShowTickets::ShowTickets()
{
fun.url = L"showtickets";
}
void ShowTickets::SetTDb(TDb * ptdb)
{
tdb = ptdb;
}
void ShowTickets::SetTicketInfo(TicketInfo * pinfo)
{
ticket_info = pinfo;
}
bool ShowTickets::HasAccess()
{
return !request->is_item;
}
bool ShowTickets::Sort::operator()(const Item * item1, const Item * item2)
{
if( sort_type == 0 )
{
// sorting by url
return item1->url < item2->url;
}
else
{
// sorting by date
tm tm1 = item1->date_creation;
tm tm2 = item2->date_creation;
time_t time1 = Time(tm1);
time_t time2 = Time(tm2);
return time1 < time2;
}
}
void ShowTickets::ReadFiles()
{
// reading files
DbItemQuery iq;
iq.SetAll(false, false);
iq.sel_url = true;
iq.sel_subject = true;
iq.sel_date = true;
iq.WhereParentId(request->dir_tab.back()->id);
iq.WhereType(Item::file);
iq.WhereFileType(WINIX_ITEM_FILETYPE_NONE);
db->GetItems(ticket_info->item_tab, iq);
system->CheckAccessToItems(ticket_info->item_tab);
}
void ShowTickets::ReadTickets()
{
// reading tickets for the files
file_id_tab.resize(ticket_info->item_tab.size());
for(size_t i=0 ; i<ticket_info->item_tab.size() ; ++i)
file_id_tab[i] = ticket_info->item_tab[i].id;
tdb->GetTickets(file_id_tab, ticket_info->ticket_tab);
}
void ShowTickets::CreatePointers()
{
// creating a pointers table
ticket_info->item_sort_tab.resize(ticket_info->item_tab.size());
for(size_t i=0 ; i<ticket_info->item_tab.size() ; ++i)
ticket_info->item_sort_tab[i] = &ticket_info->item_tab[i];
}
void ShowTickets::SortPointers()
{
int sort_type = 1;
if( request->PostVar(L"sort") == L"url" )
sort_type = 0;
std::vector<Item*> & table = ticket_info->item_sort_tab;
std::sort(table.begin(), table.end(), Sort(this, sort_type));
}
void ShowTickets::MakeGet()
{
ticket_info->Clear();
ticket_info->FindCurrentConf();
ReadFiles();
ReadTickets();
CreatePointers();
SortPointers();
}
} // namespace

58
plugins/ticket/showtickets.h Executable file
View File

@ -0,0 +1,58 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_plugins_ticket_showtickets
#define headerfile_winix_plugins_ticket_showtickets
#include "tdb.h"
#include "ticketinfo.h"
#include "core/item.h"
#include "functions/functionbase.h"
namespace Ticket
{
class ShowTickets : public FunctionBase
{
public:
ShowTickets();
void SetTDb(TDb * ptdb);
void SetTicketInfo(TicketInfo * pinfo);
bool HasAccess();
void MakeGet();
private:
TDb * tdb;
TicketInfo * ticket_info;
std::vector<long> file_id_tab;
void ReadFiles();
void ReadTickets();
void CreatePointers();
void SortPointers();
struct Sort
{
ShowTickets * show_tickets;
int sort_type;
Sort(ShowTickets * show, int type) : show_tickets(show), sort_type(type) {}
bool operator()(const Item * item1, const Item * item2);
};
};
} // namespace
#endif

View File

@ -16,8 +16,34 @@ namespace Ticket
{
bool TDb::IsTicket(long file_id)
{
PGresult * r = 0;
bool is = false;
try
{
query.Clear();
query << R("select count(*) from plugins.ticket "
"where ticket.file_id=") << file_id << R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
Error TDb::GetTicket(long dir_id, Ticket & ticket)
if( Rows(r)==1 && Cols(r)==1 )
is = AssertValueInt(r, 0, 0) != 0;
}
catch(const Error &)
{
}
ClearResult(r);
return is;
}
Error TDb::GetTicket(long file_id, Ticket & ticket)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
@ -26,8 +52,8 @@ Error TDb::GetTicket(long dir_id, Ticket & ticket)
try
{
query.Clear();
query << R("select dir_id, param, value from plugins.ticket "
"where ticket.dir_id=") << dir_id << R(";");
query << R("select file_id, param, int_value, str_value from plugins.ticket "
"where ticket.file_id=") << file_id << R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_TUPLES_OK);
@ -38,15 +64,18 @@ Error TDb::GetTicket(long dir_id, Ticket & ticket)
throw Error(WINIX_ERR_NO_TICKET);
Ticket::TicketParam par;
ticket.dir_id = dir_id;
ticket.file_id = file_id;
int cparam = AssertColumn(r, "param");
int cvalue = AssertColumn(r, "value");
int cparam = AssertColumn(r, "param");
int cintvalue = AssertColumn(r, "int_value");
int cstrvalue = AssertColumn(r, "str_value");
for(int i=0 ; i<rows ; ++i)
{
par.param = AssertValueInt(r, i, cparam);
par.value = AssertValueInt(r, i, cvalue);
par.param = AssertValueInt(r, i, cparam);
par.int_value = AssertValueLong(r, i, cintvalue);
AssertValueWide(r, i, cstrvalue, par.str_value);
ticket.par_tab.push_back(par);
}
}
@ -65,21 +94,21 @@ return status;
Error TDb::GetTickets(const std::vector<long> & dir_id_tab, std::vector<Ticket> & ticket_tab)
Error TDb::GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
ticket_tab.clear();
if( dir_id_tab.empty() )
if( file_id_tab.empty() )
return status;
try
{
query.Clear();
CreateIdList(dir_id_tab, dir_list);
query << R("select dir_id, param, value from plugins.ticket "
"where ticket.dir_id in ") << R(dir_list) << R(" order by dir_id;");
CreateIdList(file_id_tab, file_list);
query << R("select file_id, param, int_value, str_value from plugins.ticket "
"where ticket.file_id in ") << R(file_list) << R(" order by file_id;");
// !! moze dodac operator <<(std::vector(long)) do query?
@ -89,24 +118,27 @@ Error TDb::GetTickets(const std::vector<long> & dir_id_tab, std::vector<Ticket>
int rows = Rows(r);
Ticket::TicketParam par;
int cdir_id = AssertColumn(r, "dir_id");
int cparam = AssertColumn(r, "param");
int cvalue = AssertColumn(r, "value");
long last_dir_id = -1;
int cfile_id = AssertColumn(r, "file_id");
int cparam = AssertColumn(r, "param");
int cintvalue = AssertColumn(r, "int_value");
int cstrvalue = AssertColumn(r, "str_value");
long last_file_id = -1;
for(int i=0 ; i<rows ; ++i)
{
long dir_id = AssertValueLong(r, i, cdir_id);
long file_id = AssertValueLong(r, i, cfile_id);
if( i==0 || last_dir_id != dir_id )
if( i==0 || last_file_id != file_id )
{
ticket_tab.push_back(Ticket());
ticket_tab.back().dir_id = dir_id;
last_dir_id = dir_id;
ticket_tab.back().file_id = file_id;
last_file_id = file_id;
}
par.param = AssertValueInt(r, i, cparam);
par.value = AssertValueInt(r, i, cvalue);
par.int_value = AssertValueLong(r, i, cintvalue);
AssertValueWide(r, i, cstrvalue, par.str_value);
ticket_tab.back().par_tab.push_back(par);
}
}
@ -116,7 +148,7 @@ Error TDb::GetTickets(const std::vector<long> & dir_id_tab, std::vector<Ticket>
}
ClearResult(r);
dir_list.clear();
file_list.clear();
return status;
}
@ -134,10 +166,11 @@ Error TDb::AddTicket(const Ticket & ticket)
for(size_t i=0 ; i<ticket.par_tab.size() ; ++i)
{
query.Clear();
query << R("insert into plugins.ticket (dir_id, param, value) values (")
<< ticket.dir_id
query << R("insert into plugins.ticket (file_id, param, int_value, str_value) values (")
<< ticket.file_id
<< ticket.par_tab[i].param
<< ticket.par_tab[i].value
<< ticket.par_tab[i].int_value
<< ticket.par_tab[i].str_value
<< R(");");
r = AssertQuery(query);
@ -164,7 +197,7 @@ Error TDb::RemoveAddTicket(const Ticket & ticket)
if( status != WINIX_ERR_OK )
return status;
status = RemoveTicket(ticket.dir_id);
status = RemoveTicket(ticket.file_id);
if( status == WINIX_ERR_OK )
status = AddTicket(ticket);
@ -181,7 +214,7 @@ return status;
Error TDb::RemoveTicket(long dir_id)
Error TDb::RemoveTicket(long file_id)
{
PGresult * r = 0;
Error status = WINIX_ERR_OK;
@ -189,7 +222,7 @@ Error TDb::RemoveTicket(long dir_id)
try
{
query.Clear();
query << R("delete from plugins.ticket where dir_id=") << dir_id << R(";");
query << R("delete from plugins.ticket where file_id=") << file_id << R(";");
r = AssertQuery(query);
AssertResult(r, PGRES_COMMAND_OK);

View File

@ -25,17 +25,18 @@ class TDb : public DbBase
{
public:
Error GetTicket(long dir_id, Ticket & ticket);
Error GetTickets(const std::vector<long> & dir_id_tab, std::vector<Ticket> & ticket_tab);
bool IsTicket(long file_id);
Error GetTicket(long file_id, Ticket & ticket);
Error GetTickets(const std::vector<long> & file_id_tab, std::vector<Ticket> & ticket_tab);
Error AddTicket(const Ticket & ticket);
Error RemoveAddTicket(const Ticket & ticket); // first removing and then adding a ticket
Error RemoveTicket(long dir_id);
Error RemoveTicket(long file_id);
private:
DbTextStream query;
std::wstring dir_list;
std::wstring file_list;
};

View File

@ -16,6 +16,8 @@
#include "core/plugin.h"
#include "functions/functions.h"
#include "templates/templates.h"
#include "sessiondata.h"
namespace Ticket
@ -45,38 +47,49 @@ return percent;
void find_ticket_value(const TicketConf::TicketItem & conf_item, const Ticket & ticket, bool * has_value, int * value)
bool find_ticket_value(const TicketConf::TicketItem & conf_item, const Ticket & ticket, size_t * ticket_par_index)
{
*has_value = false;
*value = 0;
for(size_t a=0 ; a < ticket.par_tab.size() ; a++)
{
int par = ticket.par_tab[a].param;
int val = ticket.par_tab[a].value;
if( par == conf_item.id )
if( ticket.par_tab[a].param == conf_item.id )
{
*has_value = true;
*value = val;
*ticket_par_index = a;
return true;
}
}
return false;
}
void ticket_print_value(Info & i, size_t conf_index, int value)
void ticket_print_value(Info & i, size_t conf_index, const Ticket::TicketParam & ticket_param)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
if( conf_item.type == TicketConf::TicketItem::TypeInteger )
i.out << value;
if( conf_item.type == TicketConf::TicketItem::TypeInteger ||
conf_item.type == TicketConf::TicketItem::TypeProgress )
{
i.out << ticket_param.int_value;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeSelect )
{
if( value < (int)conf_item.select.size() )
i.out << conf_item.select[value].name;
if( ticket_param.int_value < (int)conf_item.select.size() )
i.out << conf_item.select[ticket_param.int_value].name;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeString ||
conf_item.type == TicketConf::TicketItem::TypeMultistring )
{
i.out << ticket_param.str_value;
}
else
if( conf_item.type == TicketConf::TicketItem::TypeImages ||
conf_item.type == TicketConf::TicketItem::TypeFiles )
{
i.out << ticket_param.str_value;
}
}
}
@ -84,41 +97,9 @@ void ticket_print_value(Info & i, size_t conf_index, int value)
void ticket_is(Info & i)
{
i.res = ticket_info.is_ticket;
}
void ticket_item_subject(Info & i)
{
i.out << ticket_info.item.subject;
}
void ticket_item_content(Info & i)
{
i.out << ticket_info.item.content;
}
void ticket_item_content_type_is(Info & i)
{
item_content_type_is(ticket_info.item, i);
}
void ticket_item_print_content(Info & i)
{
item_print_content(i.out, ticket_info.item.content, ticket_info.item.content_type);
}
void ticket_can_create(Info & i)
{
i.res = fun_create_ticket.HasAccess(true);
i.res = fun_create_ticket.HasAccess();
}
@ -133,65 +114,63 @@ void ticket_can_edit(Info & i)
namespace ns_tickets_tab
{
static size_t tickets_tab_index;
static size_t conf_tab_index;
static size_t item_sort_index; // index for: ticket_info.item_sort_tab
static size_t ticket_index; // index for: ticket_info.ticket_tab
static size_t par_index; // index for: ticket_info.ticket_tab[ticket_index].par_tab
static size_t conf_tab_index; // index for: ticket_info.cur_conf->tab
static bool has_ticket;
static bool has_value;
static int value;
void tickets_tab(Info & i)
{
tickets_tab_index = i.iter;
i.res = tickets_tab_index < ticket_info.ticket_tab.size();
}
has_ticket = false;
item_sort_index = i.iter;
i.res = item_sort_index < ticket_info.item_sort_tab.size();
Item * tickets_tab_find_index_dir()
{
Item * dir = 0;
if( tickets_tab_index < ticket_info.ticket_tab.size() )
if( i.res )
{
long dir_id = ticket_info.ticket_tab[tickets_tab_index].dir_id;
dir = system->dirs.GetDir(dir_id);
for(size_t a=0 ; a<ticket_info.ticket_tab.size() ; ++a)
{
if( ticket_info.ticket_tab[a].file_id == ticket_info.item_sort_tab[item_sort_index]->id )
{
has_ticket = true;
ticket_index = a;
}
}
}
return dir;
}
void tickets_tab_url(Info & i)
{
Item * dir = tickets_tab_find_index_dir();
if( dir )
i.out << dir->url;
if( item_sort_index < ticket_info.item_sort_tab.size() )
i.out << ticket_info.item_sort_tab[item_sort_index]->url;
}
void tickets_tab_subject_empty(Info & i)
{
Item * dir = tickets_tab_find_index_dir();
if( dir )
i.res = dir->subject.empty();
if( item_sort_index < ticket_info.item_sort_tab.size() )
i.res = ticket_info.item_sort_tab[item_sort_index]->subject.empty();
}
void tickets_tab_subject(Info & i)
{
Item * dir = tickets_tab_find_index_dir();
if( dir )
i.out << dir->subject;
if( item_sort_index < ticket_info.item_sort_tab.size() )
i.out << ticket_info.item_sort_tab[item_sort_index]->subject;
}
void tickets_tab_conf_tab(Info & i)
{
if( tickets_tab_index < ticket_info.ticket_tab.size() )
has_value = false;
if( has_ticket &&
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() )
{
conf_tab_index = i.iter;
i.res = conf_tab_index < ticket_info.cur_conf->tab.size();
@ -199,37 +178,105 @@ void tickets_tab_conf_tab(Info & i)
if( i.res )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
const Ticket & ticket = ticket_info.ticket_tab[tickets_tab_index];
find_ticket_value(conf_item, ticket, &has_value, &value);
const Ticket & ticket = ticket_info.ticket_tab[ticket_index];
has_value = find_ticket_value(conf_item, ticket, &par_index);
}
}
}
void tickets_tab_conf_tab_value(Info & i)
{
if( has_value )
ticket_print_value(i, conf_tab_index, value);
}
void tickets_tab_conf_tab_is_progress(Info & i)
{
if( has_value &&
conf_tab_index < ticket_info.cur_conf->tab.size() )
item_sort_index < ticket_info.item_sort_tab.size() &&
ticket_index < ticket_info.ticket_tab.size() &&
par_index < ticket_info.ticket_tab[ticket_index].par_tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = IsSubString(ticket_info.progress_prefix, conf_item.name);
ticket_print_value(i, conf_tab_index, ticket_info.ticket_tab[ticket_index].par_tab[par_index]);
}
}
void tickets_tab_conf_tab_is_integer(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeInteger;
}
}
void tickets_tab_conf_tab_is_progress(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeProgress;
}
}
void tickets_tab_conf_tab_is_select(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeSelect;
}
}
void tickets_tab_conf_tab_is_string(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeString;
}
}
void tickets_tab_conf_tab_is_multistring(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeMultistring;
}
}
void tickets_tab_conf_tab_is_images(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeImages;
}
}
void tickets_tab_conf_tab_is_files(Info & i)
{
if( has_value && conf_tab_index < ticket_info.cur_conf->tab.size() )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_tab_index];
i.res = conf_item.type == TicketConf::TicketItem::TypeFiles;
}
}
void tickets_tab_conf_tab_progress_image_number(Info & i)
{
if( has_value )
i.out << ticket_calc_progress_image_number(value);
if( has_value &&
ticket_index < ticket_info.ticket_tab.size() &&
par_index < ticket_info.ticket_tab[ticket_index].par_tab.size() )
{
int progress = ticket_info.ticket_tab[ticket_index].par_tab[par_index].int_value;
i.out << ticket_calc_progress_image_number(progress);
}
}
@ -237,12 +284,17 @@ void tickets_tab_conf_tab_progress_image_number(Info & i)
namespace ns_ticket_tab
{
static size_t conf_index;
static size_t select_index;
static size_t conf_index; // index for: ticket_info.cur_conf->tab
static size_t select_index; // index for: ticket_info.cur_conf->tab[conf_index].select
static size_t par_index; // index for: ticket_info.ticket->par_tab
static size_t files_number;
static bool has_value;
static int value;
void ticket_tab(Info & i)
@ -253,11 +305,12 @@ void ticket_tab(Info & i)
if( i.res )
{
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
find_ticket_value(conf_item, ticket_info.ticket, &has_value, &value);
has_value = find_ticket_value(conf_item, *ticket_info.ticket, &par_index);
}
}
void ticket_tab_param(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
@ -267,8 +320,8 @@ void ticket_tab_param(Info & i)
void ticket_tab_value(Info & i)
{
if( has_value )
ticket_print_value(i, conf_index, value);
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
ticket_print_value(i, conf_index, ticket_info.ticket->par_tab[par_index]);
}
@ -280,13 +333,33 @@ void ticket_tab_param_index(Info & i)
}
void ticket_tab_value_index(Info & i)
void ticket_tab_int_value_index(Info & i)
{
if( has_value )
i.out << value;
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
i.out << ticket_info.ticket->par_tab[par_index].int_value;
}
void ticket_tab_str_value_index(Info & i)
{
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
i.out << ticket_info.ticket->par_tab[par_index].str_value;
}
void ticket_tab_is_integer(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeInteger;
}
void ticket_tab_is_progress(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeProgress;
}
void ticket_tab_is_select(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
@ -294,10 +367,31 @@ void ticket_tab_is_select(Info & i)
}
void ticket_tab_is_integer(Info & i)
void ticket_tab_is_string(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeInteger;
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeString;
}
void ticket_tab_is_multistring(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeMultistring;
}
void ticket_tab_is_images(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeImages;
}
void ticket_tab_is_files(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() )
i.res = ticket_info.cur_conf->tab[conf_index].type == TicketConf::TicketItem::TypeFiles;
}
@ -311,15 +405,17 @@ void ticket_tab_select_tab(Info & i)
}
// !! zmienic nazwe na cos w stylu should_be_selected
// bo to nie tylko odczytuje nazwe z konfiga
void ticket_tab_select_tab_is_default(Info & i)
{
if( has_value )
if( has_value && par_index < ticket_info.ticket->par_tab.size() )
{
i.res = select_index == (size_t)value;
i.res = select_index == (size_t)ticket_info.ticket->par_tab[par_index].int_value;
}
else
{
if( conf_index < ticket_info.cur_conf->tab.size() &&
if( conf_index < ticket_info.cur_conf->tab.size() &&
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
{
i.res = select_index == ticket_info.cur_conf->tab[conf_index].select_default;
@ -330,7 +426,7 @@ void ticket_tab_select_tab_is_default(Info & i)
void ticket_tab_select_tab_name(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() &&
if( conf_index < ticket_info.cur_conf->tab.size() &&
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
{
i.out << ticket_info.cur_conf->tab[conf_index].select[select_index].name;
@ -340,7 +436,7 @@ void ticket_tab_select_tab_name(Info & i)
void ticket_tab_select_tab_id(Info & i)
{
if( conf_index < ticket_info.cur_conf->tab.size() &&
if( conf_index < ticket_info.cur_conf->tab.size() &&
select_index < ticket_info.cur_conf->tab[conf_index].select.size() )
{
i.out << ticket_info.cur_conf->tab[conf_index].select[select_index].id;
@ -348,6 +444,49 @@ void ticket_tab_select_tab_id(Info & i)
}
void ticket_tab_files_tab(Info & i)
{
files_number = i.iter;
if( has_value && conf_index < ticket_info.cur_conf->tab.size() )
{
if( i.iter == 0 )
{
// first iteration, we are using the par_index found by previous call to ticket_tab
i.res = true;
return;
}
else
{
// next iteration, we are looking for the next par_index
const TicketConf::TicketItem & conf_item = ticket_info.cur_conf->tab[conf_index];
for(++par_index ; par_index < ticket_info.ticket->par_tab.size() ; ++par_index)
{
if( ticket_info.ticket->par_tab[par_index].param == conf_item.id )
{
i.res = true;
return;
}
}
// there are no more such items
has_value = false;
i.res = false;
}
}
}
void ticket_tab_files_tab_index(Info & i)
{
i.out << files_number;
}
} // namespace ns_ticket_tab
@ -362,94 +501,52 @@ using namespace ns_ticket_tab;
using TemplatesFunctions::EzcFun;
EzcFun * fun = reinterpret_cast<EzcFun*>(info.p1);
fun->Insert("ticket_is", ticket_is);
fun->Insert("ticket_item_subject", ticket_item_subject);
fun->Insert("ticket_item_content", ticket_item_content);
fun->Insert("ticket_item_content_type_is", ticket_item_content_type_is);
fun->Insert("ticket_item_print_content", ticket_item_print_content);
fun->Insert("ticket_can_create", ticket_can_create);
fun->Insert("ticket_can_edit", ticket_can_edit);
fun->Insert("tickets_tab", tickets_tab);
fun->Insert("tickets_tab_url", tickets_tab_url);
fun->Insert("tickets_tab_subject_empty", tickets_tab_subject_empty);
fun->Insert("tickets_tab_subject", tickets_tab_subject);
fun->Insert("tickets_tab_url", tickets_tab_url);
fun->Insert("ticket_can_create", ticket_can_create);
fun->Insert("ticket_can_edit", ticket_can_edit);
fun->Insert("tickets_tab", tickets_tab);
fun->Insert("tickets_tab_url", tickets_tab_url);
fun->Insert("tickets_tab_subject_empty", tickets_tab_subject_empty);
fun->Insert("tickets_tab_subject", tickets_tab_subject);
fun->Insert("tickets_tab_url", tickets_tab_url);
fun->Insert("tickets_tab_conf_tab", tickets_tab_conf_tab);
fun->Insert("tickets_tab_conf_tab", tickets_tab_conf_tab);
fun->Insert("tickets_tab_conf_tab_value", tickets_tab_conf_tab_value);
fun->Insert("tickets_tab_conf_tab_is_progress", tickets_tab_conf_tab_is_progress);
fun->Insert("tickets_tab_conf_tab_progress_image_number", tickets_tab_conf_tab_progress_image_number);
fun->Insert("tickets_tab_conf_tab_is_integer", tickets_tab_conf_tab_is_integer);
fun->Insert("tickets_tab_conf_tab_is_progress", tickets_tab_conf_tab_is_progress);
fun->Insert("tickets_tab_conf_tab_is_select", tickets_tab_conf_tab_is_select);
fun->Insert("tickets_tab_conf_tab_is_string", tickets_tab_conf_tab_is_string);
fun->Insert("tickets_tab_conf_tab_is_multistring", tickets_tab_conf_tab_is_multistring);
fun->Insert("tickets_tab_conf_tab_is_images", tickets_tab_conf_tab_is_images);
fun->Insert("tickets_tab_conf_tab_is_files", tickets_tab_conf_tab_is_files);
fun->Insert("tickets_tab_conf_tab_progress_image_number", tickets_tab_conf_tab_progress_image_number);
fun->Insert("ticket_tab", ticket_tab);
fun->Insert("ticket_tab_param", ticket_tab_param);
fun->Insert("ticket_tab_value", ticket_tab_value);
fun->Insert("ticket_tab_param_index", ticket_tab_param_index);
fun->Insert("ticket_tab_value_index", ticket_tab_value_index);
fun->Insert("ticket_tab_is_select", ticket_tab_is_select);
fun->Insert("ticket_tab_is_integer", ticket_tab_is_integer);
fun->Insert("ticket_tab", ticket_tab);
fun->Insert("ticket_tab_select_tab", ticket_tab_select_tab);
fun->Insert("ticket_tab_param", ticket_tab_param);
fun->Insert("ticket_tab_value", ticket_tab_value);
fun->Insert("ticket_tab_param_index", ticket_tab_param_index);
fun->Insert("ticket_tab_int_value_index", ticket_tab_int_value_index);
fun->Insert("ticket_tab_str_value_index", ticket_tab_str_value_index);
fun->Insert("ticket_tab_is_integer", ticket_tab_is_integer);
fun->Insert("ticket_tab_is_progress", ticket_tab_is_progress);
fun->Insert("ticket_tab_is_select", ticket_tab_is_select);
fun->Insert("ticket_tab_is_string", ticket_tab_is_string);
fun->Insert("ticket_tab_is_multistring", ticket_tab_is_multistring);
fun->Insert("ticket_tab_is_images", ticket_tab_is_images);
fun->Insert("ticket_tab_is_files", ticket_tab_is_files);
fun->Insert("ticket_tab_select_tab", ticket_tab_select_tab);
fun->Insert("ticket_tab_select_tab_is_default", ticket_tab_select_tab_is_default);
fun->Insert("ticket_tab_select_tab_id", ticket_tab_select_tab_id);
fun->Insert("ticket_tab_select_tab_name", ticket_tab_select_tab_name);
fun->Insert("ticket_tab_select_tab_id", ticket_tab_select_tab_id);
fun->Insert("ticket_tab_select_tab_name", ticket_tab_select_tab_name);
/*
fun->Insert("ticket_type", ticket_type);
fun->Insert("ticket_status", ticket_status);
fun->Insert("ticket_priority", ticket_priority);
fun->Insert("ticket_category", ticket_category);
fun->Insert("ticket_expected", ticket_expected);
fun->Insert("ticket_progress", ticket_progress);
fun->Insert("ticket_progress_image_number", ticket_progress_image_number);
fun->Insert("ticket_tab", ticket_tab);
fun->Insert("ticket_tab_url", ticket_tab_url);
fun->Insert("ticket_tab_subject", ticket_tab_subject);
fun->Insert("ticket_tab_subject_empty", ticket_tab_subject_empty);
fun->Insert("ticket_tab_author", ticket_tab_author);
fun->Insert("ticket_tab_type", ticket_tab_type);
fun->Insert("ticket_tab_status", ticket_tab_status);
fun->Insert("ticket_tab_priority", ticket_tab_priority);
fun->Insert("ticket_tab_category", ticket_tab_category);
fun->Insert("ticket_tab_expected", ticket_tab_expected);
fun->Insert("ticket_tab_progress", ticket_tab_progress);
fun->Insert("ticket_tab_progress_image_number",ticket_tab_progress_image_number);
fun->Insert("ticket_type_tab", ticket_type_tab);
fun->Insert("ticket_type_tab_defined", ticket_type_tab_defined);
fun->Insert("ticket_type_tab_isdefault", ticket_type_tab_isdefault);
fun->Insert("ticket_type_tab_index", ticket_type_tab_index);
fun->Insert("ticket_type_tab_name", ticket_type_tab_name);
fun->Insert("ticket_status_tab", ticket_status_tab);
fun->Insert("ticket_status_tab_defined", ticket_status_tab_defined);
fun->Insert("ticket_status_tab_isdefault", ticket_status_tab_isdefault);
fun->Insert("ticket_status_tab_index", ticket_status_tab_index);
fun->Insert("ticket_status_tab_name", ticket_status_tab_name);
fun->Insert("ticket_priority_tab", ticket_priority_tab);
fun->Insert("ticket_priority_tab_defined", ticket_priority_tab_defined);
fun->Insert("ticket_priority_tab_isdefault", ticket_priority_tab_isdefault);
fun->Insert("ticket_priority_tab_index", ticket_priority_tab_index);
fun->Insert("ticket_priority_tab_name", ticket_priority_tab_name);
fun->Insert("ticket_category_tab", ticket_category_tab);
fun->Insert("ticket_category_tab_defined", ticket_category_tab_defined);
fun->Insert("ticket_category_tab_isdefault", ticket_category_tab_isdefault);
fun->Insert("ticket_category_tab_index", ticket_category_tab_index);
fun->Insert("ticket_category_tab_name", ticket_category_tab_name);
fun->Insert("ticket_expected_tab", ticket_expected_tab);
fun->Insert("ticket_expected_tab_defined", ticket_expected_tab_defined);
fun->Insert("ticket_expected_tab_isdefault", ticket_expected_tab_isdefault);
fun->Insert("ticket_expected_tab_index", ticket_expected_tab_index);
fun->Insert("ticket_expected_tab_name", ticket_expected_tab_name);
*/
fun->Insert("ticket_tab_files_tab", ticket_tab_files_tab);
fun->Insert("ticket_tab_files_tab_index", ticket_tab_files_tab_index);
}

Some files were not shown because too many files have changed in this diff Show More