changed: mount points
mount type and mount fs are of type 'int' now they can be added by plugins git-svn-id: svn://ttmath.org/publicrep/winix/trunk@652 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -4,8 +4,8 @@ acceptbaseparser.o: acceptbaseparser.h
|
||||
app.o: app.h config.h confparser.h htmlfilter.h system.h dirs.h item.h
|
||||
app.o: dircontainer.h db.h user.h group.h thread.h error.h log.h
|
||||
app.o: ugcontainer.h ticket.h request.h requesttypes.h session.h plugindata.h
|
||||
app.o: rebus.h mounts.h mount.h users.h lastcontainer.h groups.h loadavg.h
|
||||
app.o: sessionmanager.h sessioncontainer.h notify.h
|
||||
app.o: rebus.h mounts.h mount.h mountparser.h users.h lastcontainer.h
|
||||
app.o: groups.h loadavg.h sessionmanager.h sessioncontainer.h notify.h
|
||||
app.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
|
||||
app.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
|
||||
app.o: ../templates/localefilter.h ../core/locale.h ../functions/functions.h
|
||||
@@ -36,10 +36,11 @@ compress.o: compress.h log.h
|
||||
config.o: config.h confparser.h htmlfilter.h log.h plugin.h pluginmsg.h
|
||||
config.o: plugindata.h request.h requesttypes.h session.h item.h error.h
|
||||
config.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h thread.h
|
||||
config.o: ugcontainer.h ticket.h mounts.h mount.h users.h lastcontainer.h
|
||||
config.o: groups.h loadavg.h sessionmanager.h sessioncontainer.h
|
||||
config.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
|
||||
config.o: ../core/db.h ../core/request.h ../core/config.h ../core/system.h
|
||||
config.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
|
||||
config.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
config.o: sessioncontainer.h ../functions/functions.h
|
||||
config.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
config.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
config.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
|
||||
config.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
config.o: ../functions/privchanger.h ../functions/chown.h
|
||||
@@ -72,7 +73,7 @@ dirs.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h notify.h
|
||||
dirs.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
|
||||
dirs.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
|
||||
dirs.o: ../templates/localefilter.h ../core/locale.h system.h mounts.h
|
||||
dirs.o: mount.h users.h lastcontainer.h groups.h loadavg.h
|
||||
dirs.o: mount.h mountparser.h users.h lastcontainer.h groups.h loadavg.h
|
||||
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
|
||||
groups.o: error.h dircontainer.h ticket.h
|
||||
htmlfilter.o: htmlfilter.h
|
||||
@@ -90,21 +91,47 @@ mountparser.o: rebus.h config.h confparser.h htmlfilter.h misc.h
|
||||
mounts.o: mounts.h mount.h error.h log.h dirs.h item.h dircontainer.h db.h
|
||||
mounts.o: user.h group.h thread.h ugcontainer.h ticket.h request.h
|
||||
mounts.o: requesttypes.h session.h plugindata.h rebus.h config.h confparser.h
|
||||
mounts.o: htmlfilter.h mountparser.h
|
||||
mounts.o: htmlfilter.h mountparser.h plugin.h pluginmsg.h system.h users.h
|
||||
mounts.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
mounts.o: sessioncontainer.h ../functions/functions.h
|
||||
mounts.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
mounts.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
mounts.o: ../core/notify.h ../../ezc/src/ezc.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/createticket.h
|
||||
mounts.o: ../functions/default.h ../functions/download.h
|
||||
mounts.o: ../functions/editticket.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/subject.h ../functions/funthread.h
|
||||
mounts.o: ../core/thread.h ../functions/funticket.h ../core/ticket.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: ../core/htmlfilter.h ../templates/templates.h
|
||||
mounts.o: ../templates/patterncacher.h ../core/item.h misc.h
|
||||
mounts.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
|
||||
mounts.o: ../core/log.h ../templates/indexpatterns.h
|
||||
mounts.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
|
||||
mounts.o: ../core/sessionmanager.h
|
||||
notify.o: log.h notify.h ../templatesnotify/templatesnotify.h
|
||||
notify.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h confparser.h
|
||||
notify.o: ../core/config.h ../templates/misc.h ../templates/localefilter.h
|
||||
notify.o: ../core/locale.h request.h requesttypes.h session.h item.h error.h
|
||||
notify.o: user.h plugindata.h rebus.h config.h htmlfilter.h system.h dirs.h
|
||||
notify.o: dircontainer.h db.h group.h thread.h ugcontainer.h ticket.h
|
||||
notify.o: mounts.h mount.h users.h lastcontainer.h groups.h loadavg.h misc.h
|
||||
notify.o: mounts.h mount.h mountparser.h users.h lastcontainer.h groups.h
|
||||
notify.o: loadavg.h misc.h
|
||||
plugin.o: plugin.h pluginmsg.h log.h plugindata.h config.h confparser.h
|
||||
plugin.o: htmlfilter.h request.h requesttypes.h session.h item.h error.h
|
||||
plugin.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h thread.h
|
||||
plugin.o: ugcontainer.h ticket.h mounts.h mount.h users.h lastcontainer.h
|
||||
plugin.o: groups.h loadavg.h sessionmanager.h sessioncontainer.h
|
||||
plugin.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
|
||||
plugin.o: ../core/db.h ../core/request.h ../core/config.h ../core/system.h
|
||||
plugin.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
|
||||
plugin.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
plugin.o: sessioncontainer.h ../functions/functions.h
|
||||
plugin.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
plugin.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
plugin.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
|
||||
plugin.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
plugin.o: ../functions/privchanger.h ../functions/chown.h
|
||||
@@ -128,8 +155,8 @@ plugin.o: ../core/sessionmanager.h
|
||||
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h config.h confparser.h
|
||||
plugindata.o: htmlfilter.h request.h requesttypes.h session.h item.h error.h
|
||||
plugindata.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h
|
||||
plugindata.o: thread.h ugcontainer.h ticket.h mounts.h mount.h users.h
|
||||
plugindata.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
plugindata.o: thread.h ugcontainer.h ticket.h mounts.h mount.h mountparser.h
|
||||
plugindata.o: users.h lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
plugindata.o: sessioncontainer.h ../functions/functions.h
|
||||
plugindata.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
plugindata.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
@@ -162,14 +189,15 @@ rebus.o: error.h user.h plugindata.h config.h confparser.h htmlfilter.h
|
||||
request.o: request.h requesttypes.h session.h item.h error.h log.h user.h
|
||||
request.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h plugin.h
|
||||
request.o: pluginmsg.h system.h dirs.h dircontainer.h db.h group.h thread.h
|
||||
request.o: ugcontainer.h ticket.h mounts.h mount.h users.h lastcontainer.h
|
||||
request.o: groups.h loadavg.h sessionmanager.h sessioncontainer.h
|
||||
request.o: ../functions/functions.h ../functions/functionbase.h
|
||||
request.o: ../core/item.h ../core/db.h ../core/request.h ../core/config.h
|
||||
request.o: ../core/system.h ../core/notify.h ../../ezc/src/ezc.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: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
|
||||
request.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
|
||||
request.o: sessioncontainer.h ../functions/functions.h
|
||||
request.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
request.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
request.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
|
||||
request.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
request.o: ../functions/privchanger.h ../functions/chown.h
|
||||
request.o: ../functions/ckeditor.h ../functions/cp.h
|
||||
request.o: ../functions/createthread.h ../functions/createticket.h
|
||||
request.o: ../functions/default.h ../functions/download.h
|
||||
request.o: ../functions/editticket.h ../functions/emacs.h ../functions/last.h
|
||||
@@ -193,25 +221,26 @@ sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
|
||||
sessionmanager.o: error.h log.h user.h plugindata.h rebus.h lastcontainer.h
|
||||
sessionmanager.o: config.h confparser.h htmlfilter.h request.h requesttypes.h
|
||||
sessionmanager.o: system.h dirs.h dircontainer.h db.h group.h thread.h
|
||||
sessionmanager.o: ugcontainer.h ticket.h mounts.h mount.h users.h groups.h
|
||||
sessionmanager.o: loadavg.h sessionparser.h plugin.h pluginmsg.h
|
||||
sessionmanager.o: ../functions/functions.h ../functions/functionbase.h
|
||||
sessionmanager.o: ../core/item.h ../core/db.h ../core/request.h
|
||||
sessionmanager.o: ../core/config.h ../core/system.h ../core/notify.h
|
||||
sessionmanager.o: ../../ezc/src/ezc.h ../functions/functionparser.h
|
||||
sessionmanager.o: ../functions/adduser.h ../functions/cat.h
|
||||
sessionmanager.o: ../functions/chmod.h ../functions/privchanger.h
|
||||
sessionmanager.o: ../functions/chown.h ../functions/ckeditor.h
|
||||
sessionmanager.o: ../functions/cp.h ../functions/createthread.h
|
||||
sessionmanager.o: ../functions/createticket.h ../functions/default.h
|
||||
sessionmanager.o: ../functions/download.h ../functions/editticket.h
|
||||
sessionmanager.o: ../functions/emacs.h ../functions/last.h
|
||||
sessionmanager.o: ../functions/login.h ../functions/logout.h
|
||||
sessionmanager.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
sessionmanager.o: ../functions/node.h ../functions/priv.h
|
||||
sessionmanager.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
|
||||
sessionmanager.o: ../functions/subject.h ../functions/funthread.h
|
||||
sessionmanager.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
|
||||
sessionmanager.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h
|
||||
sessionmanager.o: users.h groups.h loadavg.h sessionparser.h plugin.h
|
||||
sessionmanager.o: pluginmsg.h ../functions/functions.h
|
||||
sessionmanager.o: ../functions/functionbase.h ../core/item.h ../core/db.h
|
||||
sessionmanager.o: ../core/request.h ../core/config.h ../core/system.h
|
||||
sessionmanager.o: ../core/notify.h ../../ezc/src/ezc.h
|
||||
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/createticket.h
|
||||
sessionmanager.o: ../functions/default.h ../functions/download.h
|
||||
sessionmanager.o: ../functions/editticket.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/subject.h
|
||||
sessionmanager.o: ../functions/funthread.h ../core/thread.h
|
||||
sessionmanager.o: ../functions/funticket.h ../core/ticket.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
|
||||
@@ -229,10 +258,11 @@ sessionparser.o: dircontainer.h ticket.h
|
||||
system.o: system.h dirs.h item.h dircontainer.h db.h user.h group.h thread.h
|
||||
system.o: error.h log.h ugcontainer.h ticket.h request.h requesttypes.h
|
||||
system.o: session.h plugindata.h rebus.h config.h confparser.h htmlfilter.h
|
||||
system.o: mounts.h mount.h users.h lastcontainer.h groups.h loadavg.h misc.h
|
||||
system.o: notify.h ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
|
||||
system.o: ../core/mount.h ../core/locale.h ../core/config.h
|
||||
system.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
|
||||
system.o: mounts.h mount.h mountparser.h users.h lastcontainer.h groups.h
|
||||
system.o: loadavg.h misc.h notify.h ../templatesnotify/templatesnotify.h
|
||||
system.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h
|
||||
system.o: ../core/config.h ../templates/misc.h ../templates/localefilter.h
|
||||
system.o: ../core/locale.h
|
||||
users.o: users.h user.h ugcontainer.h log.h lastcontainer.h request.h
|
||||
users.o: requesttypes.h session.h item.h error.h plugindata.h rebus.h
|
||||
users.o: config.h confparser.h htmlfilter.h db.h group.h thread.h
|
||||
|
@@ -147,6 +147,11 @@ bool App::Init()
|
||||
if( !notify.Init() )
|
||||
return false;
|
||||
|
||||
// call this after system.Init() (mount points identificators should be created)
|
||||
templates_notify.SetMountTypes( system.mounts.MountTypeCms(),
|
||||
system.mounts.MountTypeThread(),
|
||||
system.mounts.MountTypeTicket() );
|
||||
|
||||
// init templates after functions are created
|
||||
templates.ReadIndexFileNames();
|
||||
templates.ReadTemplates();
|
||||
|
144
core/mount.cpp
144
core/mount.cpp
@@ -14,106 +14,9 @@
|
||||
|
||||
Mount::Mount()
|
||||
{
|
||||
type = cms;
|
||||
dir_id = -1;
|
||||
fs = simplefs;
|
||||
|
||||
param.resize(par_none);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char * Mount::TypeToStr()
|
||||
{
|
||||
static char buffer[30];
|
||||
|
||||
switch( type )
|
||||
{
|
||||
case cms:
|
||||
sprintf(buffer, "cms");
|
||||
break;
|
||||
|
||||
case thread:
|
||||
sprintf(buffer, "thread");
|
||||
break;
|
||||
|
||||
case ticket:
|
||||
sprintf(buffer, "ticket");
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
const char * Mount::FsToStr()
|
||||
{
|
||||
static char buffer[30];
|
||||
|
||||
switch( fs )
|
||||
{
|
||||
case simplefs:
|
||||
sprintf(buffer, "simplefs");
|
||||
break;
|
||||
|
||||
case hashfs:
|
||||
sprintf(buffer, "hashfs");
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(buffer, "unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Mount::ParamCode Mount::ParseParam(const char * param_name)
|
||||
{
|
||||
struct ParName
|
||||
{
|
||||
ParamCode param_code;
|
||||
const char * name;
|
||||
};
|
||||
|
||||
static ParName par_name_tab[] = {
|
||||
{ par_page, "page" },
|
||||
{ par_thread, "thread" },
|
||||
{ par_ticket, "ticket" },
|
||||
{ par_ticket_type, "ticket_type" },
|
||||
{ par_ticket_type_default, "ticket_type_default" },
|
||||
{ par_ticket_status, "ticket_status" },
|
||||
{ par_ticket_status_default, "ticket_status_default" },
|
||||
{ par_ticket_priority, "ticket_priority" },
|
||||
{ par_ticket_priority_default, "ticket_priority_default" },
|
||||
{ par_ticket_category, "ticket_category" },
|
||||
{ par_ticket_category_default, "ticket_category_default" },
|
||||
{ par_ticket_expected, "ticket_expected" },
|
||||
{ par_ticket_expected_default, "ticket_expected_default" },
|
||||
{ par_createthread_on, "createthread_on" },
|
||||
{ par_createticket_on, "createticket_on" },
|
||||
{ par_only_root_remove, "only_root_remove" },
|
||||
{ par_emacs_on, "emacs_on" },
|
||||
{ par_mkdir_on, "mkdir_on" },
|
||||
{ par_app, "app" },
|
||||
{ par_html_template, "html_template" },
|
||||
};
|
||||
|
||||
size_t i, len = sizeof(par_name_tab) / sizeof(ParName);
|
||||
|
||||
for(i=0 ; i<len ; ++i)
|
||||
{
|
||||
if( strcmp(par_name_tab[i].name, param_name) == 0 )
|
||||
return par_name_tab[i].param_code;
|
||||
}
|
||||
|
||||
return par_none;
|
||||
type = -1;
|
||||
fs = -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,8 +30,11 @@ size_t i;
|
||||
}
|
||||
|
||||
|
||||
bool Mount::IsPar(Mount::ParamCode code)
|
||||
bool Mount::IsPar(int code)
|
||||
{
|
||||
if( code < 0 || code >= (int)param.size() )
|
||||
return false;
|
||||
|
||||
if( !param[code].defined )
|
||||
return false;
|
||||
|
||||
@@ -137,9 +43,12 @@ return true;
|
||||
|
||||
|
||||
|
||||
bool Mount::IsArg(Mount::ParamCode code, const char * arg)
|
||||
bool Mount::IsArg(int code, const char * arg)
|
||||
{
|
||||
ParamArg::iterator i;
|
||||
ParamRow::ParamArg::iterator i;
|
||||
|
||||
if( code < 0 || code >= (int)param.size() )
|
||||
return false;
|
||||
|
||||
if( !param[code].defined )
|
||||
return false;
|
||||
@@ -154,15 +63,18 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
bool Mount::IsArg(Mount::ParamCode code, const std::string & arg)
|
||||
bool Mount::IsArg(int code, const std::string & arg)
|
||||
{
|
||||
return IsArg(code, arg.c_str());
|
||||
}
|
||||
|
||||
|
||||
bool Mount::IsArg(Mount::ParamCode code, int arg)
|
||||
bool Mount::IsArg(int code, int arg)
|
||||
{
|
||||
ParamArg::iterator i;
|
||||
ParamRow::ParamArg::iterator i;
|
||||
|
||||
if( code < 0 || code >= (int)param.size() )
|
||||
return false;
|
||||
|
||||
if( !param[code].defined )
|
||||
return false;
|
||||
@@ -177,15 +89,23 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const std::string * Mount::FirstHtmlTemplate() const
|
||||
const std::string & Mount::Arg(int code, int arg) const
|
||||
{
|
||||
if( !param[par_html_template].defined )
|
||||
return 0;
|
||||
if( code < 0 || code >= (int)param.size() )
|
||||
return empty_str;
|
||||
|
||||
if( param[par_html_template].arg.empty() )
|
||||
return 0;
|
||||
if( !param[code].defined )
|
||||
return empty_str;
|
||||
|
||||
return & param[par_html_template].arg[0];
|
||||
if( arg >= (int)param[code].arg.size() )
|
||||
return empty_str;
|
||||
|
||||
return param[code].arg[arg];
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mount::FirstArg(int code) const
|
||||
{
|
||||
return Arg(code, 0);
|
||||
}
|
||||
|
||||
|
82
core/mount.h
82
core/mount.h
@@ -17,59 +17,14 @@
|
||||
|
||||
|
||||
|
||||
|
||||
class Mount
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
enum Type
|
||||
{
|
||||
cms = 0,
|
||||
thread,
|
||||
ticket
|
||||
};
|
||||
|
||||
enum Fs
|
||||
{
|
||||
simplefs = 0,
|
||||
hashfs
|
||||
};
|
||||
|
||||
|
||||
// the first should be with 0 index
|
||||
// the last should be 'none'
|
||||
enum ParamCode
|
||||
{
|
||||
par_page = 0,
|
||||
par_thread,
|
||||
par_ticket,
|
||||
par_ticket_type,
|
||||
par_ticket_type_default,
|
||||
par_ticket_status,
|
||||
par_ticket_status_default,
|
||||
par_ticket_priority,
|
||||
par_ticket_priority_default,
|
||||
par_ticket_category,
|
||||
par_ticket_category_default,
|
||||
par_ticket_expected,
|
||||
par_ticket_expected_default,
|
||||
par_createthread_on,
|
||||
par_createticket_on,
|
||||
par_only_root_remove,
|
||||
par_emacs_on,
|
||||
par_mkdir_on,
|
||||
par_app,
|
||||
par_html_template,
|
||||
|
||||
par_none
|
||||
};
|
||||
|
||||
typedef std::vector<std::string> ParamArg;
|
||||
|
||||
|
||||
struct ParamRow
|
||||
{
|
||||
typedef std::vector<std::string> ParamArg;
|
||||
|
||||
bool defined;
|
||||
ParamArg arg;
|
||||
|
||||
@@ -78,31 +33,36 @@ public:
|
||||
};
|
||||
|
||||
typedef std::vector<ParamRow> Param;
|
||||
|
||||
|
||||
long dir_id;
|
||||
int type;
|
||||
int fs;
|
||||
Param param;
|
||||
|
||||
long dir_id;
|
||||
Type type;
|
||||
Fs fs;
|
||||
|
||||
|
||||
|
||||
Mount();
|
||||
const char * TypeToStr();
|
||||
const char * FsToStr();
|
||||
static ParamCode ParseParam(const char * param);
|
||||
|
||||
|
||||
void ClearParams();
|
||||
|
||||
bool IsPar(int code);
|
||||
|
||||
bool IsPar(Mount::ParamCode code);
|
||||
bool IsArg(int code, const char * arg);
|
||||
bool IsArg(int code, const std::string & arg);
|
||||
bool IsArg(int code, int arg);
|
||||
|
||||
bool IsArg(Mount::ParamCode code, const char * arg);
|
||||
bool IsArg(Mount::ParamCode code, const std::string & arg);
|
||||
bool IsArg(Mount::ParamCode code, int arg);
|
||||
// returning the arg argument if defined (or an empty string)
|
||||
const std::string & Arg(int code, int arg) const;
|
||||
|
||||
// returning a name to html template (can be null if not defined)
|
||||
const std::string * FirstHtmlTemplate() const;
|
||||
// returning the first argument (arg=0) if defined (or an empty string)
|
||||
const std::string & FirstArg(int code) const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// for Arg() methods when the argument is not defined
|
||||
const std::string empty_str;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -12,12 +12,40 @@
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
MountParser::MountParser()
|
||||
{
|
||||
dirs = 0;
|
||||
mount_type_tab = 0;
|
||||
mount_fs_tab = 0;
|
||||
mount_par_tab = 0;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetDirs(Dirs * pdirs)
|
||||
{
|
||||
dirs = pdirs;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountTypeTab(const std::vector<std::string> & tab)
|
||||
{
|
||||
mount_type_tab = &tab;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountFsTab(const std::vector<std::string> & tab)
|
||||
{
|
||||
mount_fs_tab = &tab;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::SetMountParTab(const std::vector<std::string> & tab)
|
||||
{
|
||||
mount_par_tab = &tab;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MountParser::IsWhite(int c)
|
||||
{
|
||||
if( c==' ' || c=='\t' || c==13 || c==160 )
|
||||
@@ -122,7 +150,7 @@ void MountParser::ReadWord(std::string & res, bool comma_bracket_separator)
|
||||
|
||||
|
||||
|
||||
void MountParser::ReadParamArgsLoop(Mount::ParamArg & args)
|
||||
void MountParser::ReadParamArgsLoop(Mount::ParamRow::ParamArg & args)
|
||||
{
|
||||
SkipWhite();
|
||||
|
||||
@@ -139,7 +167,7 @@ void MountParser::ReadParamArgsLoop(Mount::ParamArg & args)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParamArgs(Mount::ParamArg & args)
|
||||
void MountParser::ReadParamArgs(Mount::ParamRow::ParamArg & args)
|
||||
{
|
||||
SkipWhite();
|
||||
args.clear();
|
||||
@@ -177,7 +205,7 @@ void MountParser::ReadParamName(std::string & res)
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadParam(std::string & res, Mount::ParamArg & args)
|
||||
void MountParser::ReadParam(std::string & res, Mount::ParamRow::ParamArg & args)
|
||||
{
|
||||
ReadParamName(res);
|
||||
|
||||
@@ -193,6 +221,17 @@ void MountParser::ReadParam(std::string & res, Mount::ParamArg & args)
|
||||
}
|
||||
|
||||
|
||||
int MountParser::FindIndex(const std::vector<std::string> * tab, const std::string & value)
|
||||
{
|
||||
for(size_t i=0 ; i < tab->size() ; ++i)
|
||||
{
|
||||
if( (*tab)[i] == value )
|
||||
return static_cast<int>(i);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void MountParser::ReadMountType()
|
||||
{
|
||||
@@ -202,24 +241,14 @@ void MountParser::ReadMountType()
|
||||
{
|
||||
// an empty line (some white characters only)
|
||||
err = WINIX_ERR_EMPTY;
|
||||
return;
|
||||
}
|
||||
else
|
||||
if( temp == "cms" )
|
||||
|
||||
mount.type = FindIndex(mount_type_tab, temp);
|
||||
|
||||
if( mount.type != -1 )
|
||||
{
|
||||
mount.type = Mount::cms;
|
||||
log << log3 << "MP: mount type: cms" << logend;
|
||||
}
|
||||
else
|
||||
if( temp == "thread" )
|
||||
{
|
||||
mount.type = Mount::thread;
|
||||
log << log3 << "MP: mount type: thread" << logend;
|
||||
}
|
||||
else
|
||||
if( temp == "ticket" )
|
||||
{
|
||||
mount.type = Mount::ticket;
|
||||
log << log3 << "MP: mount type: ticket" << logend;
|
||||
log << log3 << "MP: mount type: " << (*mount_type_tab)[mount.type] << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -239,12 +268,12 @@ void MountParser::ReadMountPoint()
|
||||
if( pdir )
|
||||
{
|
||||
mount.dir_id = pdir->id;
|
||||
log << log3 << "MP: mount point: " << temp << logend;
|
||||
log << log3 << "MP: mount point (directory): " << temp << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
err = WINIX_ERR_NO_MOUNTPOINT;
|
||||
log << log1 << "MP: there is no such a mount point: " << temp << logend;
|
||||
log << log1 << "MP: there is no such a mount point (directory): " << temp << logend;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,17 +282,11 @@ void MountParser::ReadMountPoint()
|
||||
void MountParser::ReadFs()
|
||||
{
|
||||
ReadWord(temp);
|
||||
mount.fs = FindIndex(mount_fs_tab, temp);
|
||||
|
||||
if( temp == "simplefs" )
|
||||
if( mount.fs != -1 )
|
||||
{
|
||||
mount.fs = Mount::simplefs;
|
||||
log << log1 << "MP: file system: simplefs" << logend;
|
||||
}
|
||||
else
|
||||
if( temp == "hashfs" )
|
||||
{
|
||||
mount.fs = Mount::hashfs;
|
||||
log << log1 << "MP: file system: hashfs" << logend;
|
||||
log << log1 << "MP: file system: " << (*mount_fs_tab)[mount.fs] << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -299,12 +322,12 @@ void MountParser::ReadMountParams()
|
||||
|
||||
for( ReadParam(temp, param_args) ; !temp.empty() ; ReadParam(temp, param_args) )
|
||||
{
|
||||
Mount::ParamCode p = Mount::ParseParam(temp.c_str());
|
||||
int code = FindIndex(mount_par_tab, temp);
|
||||
|
||||
if( p != Mount::par_none )
|
||||
if( code != -1 )
|
||||
{
|
||||
mount.param[p].defined = true;
|
||||
mount.param[p].arg = param_args;
|
||||
mount.param[code].defined = true;
|
||||
mount.param[code].arg = param_args;
|
||||
LogMountParams();
|
||||
}
|
||||
else
|
||||
@@ -352,8 +375,23 @@ void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||
|
||||
Error MountParser::Parse(const std::string & input, std::map<long, Mount> & output)
|
||||
{
|
||||
if( !dirs || !mount_type_tab || !mount_fs_tab || !mount_par_tab )
|
||||
{
|
||||
log << log1 << "pdir: " << pdir << logend;
|
||||
log << log1 << "type: " << mount_type_tab << logend;
|
||||
log << log1 << "fs: " << mount_fs_tab << logend;
|
||||
log << log1 << "par: " << mount_par_tab << logend;
|
||||
|
||||
log << log1 << "MP: input tables not set" << logend;
|
||||
return WINIX_NOTHING_TO_DO; // !! may a better code?
|
||||
}
|
||||
|
||||
pinput = input.c_str();
|
||||
err = WINIX_ERR_OK;
|
||||
|
||||
mount.param.resize(mount_par_tab->size());
|
||||
mount.ClearParams();
|
||||
|
||||
output.clear();
|
||||
|
||||
while( *pinput && err == WINIX_ERR_OK )
|
||||
|
@@ -27,13 +27,21 @@ class MountParser
|
||||
{
|
||||
public:
|
||||
|
||||
MountParser();
|
||||
Error Parse(const std::string & input, std::map<long, Mount> & output);
|
||||
void SetDirs(Dirs * pdirs);
|
||||
void SetMountTypeTab(const std::vector<std::string> & tab);
|
||||
void SetMountFsTab(const std::vector<std::string> & tab);
|
||||
void SetMountParTab(const std::vector<std::string> & tab);
|
||||
|
||||
private:
|
||||
|
||||
Dirs * dirs;
|
||||
|
||||
const std::vector<std::string> * mount_type_tab;
|
||||
const std::vector<std::string> * mount_fs_tab;
|
||||
const std::vector<std::string> * mount_par_tab;
|
||||
|
||||
bool IsWhite(int c);
|
||||
void SkipWhite();
|
||||
void SkipLine();
|
||||
@@ -41,10 +49,11 @@ private:
|
||||
void ReadWordWhite(std::string & res);
|
||||
void ReadWordComma(std::string & res);
|
||||
void ReadWord(std::string & res, bool comma_bracket_separator = false);
|
||||
void ReadParamArgsLoop(Mount::ParamArg & args);
|
||||
void ReadParamArgs(Mount::ParamArg & args);
|
||||
void ReadParamArgsLoop(Mount::ParamRow::ParamArg & args);
|
||||
void ReadParamArgs(Mount::ParamRow::ParamArg & args);
|
||||
void ReadParamName(std::string & res);
|
||||
void ReadParam(std::string & res, Mount::ParamArg & args);
|
||||
void ReadParam(std::string & res, Mount::ParamRow::ParamArg & args);
|
||||
int FindIndex(const std::vector<std::string> * tab, const std::string & value);
|
||||
void ReadMountType();
|
||||
void ReadMountPoint();
|
||||
void ReadFs();
|
||||
@@ -55,7 +64,7 @@ private:
|
||||
const char * pinput;
|
||||
std::string temp;
|
||||
std::string temp_arg;
|
||||
Mount::ParamArg param_args;
|
||||
Mount::ParamRow::ParamArg param_args;
|
||||
|
||||
|
||||
Mount mount;
|
||||
|
147
core/mounts.cpp
147
core/mounts.cpp
@@ -2,7 +2,7 @@
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
@@ -10,8 +10,8 @@
|
||||
#include "mounts.h"
|
||||
#include "request.h"
|
||||
#include "log.h"
|
||||
#include "mountparser.h"
|
||||
#include "db.h"
|
||||
#include "plugin.h"
|
||||
|
||||
|
||||
|
||||
@@ -22,6 +22,57 @@ Mounts::Mounts()
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMountType()
|
||||
{
|
||||
mount_type_cms = AddMountType("cms");
|
||||
mount_type_thread = AddMountType("thread");
|
||||
mount_type_ticket = AddMountType("ticket");
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMountFs()
|
||||
{
|
||||
mount_fs_simplefs = AddMountFs("simplefs");
|
||||
mount_fs_hashfs = AddMountFs("hashfs");
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMountPar()
|
||||
{
|
||||
mount_par_page = AddMountPar("page");
|
||||
mount_par_thread = AddMountPar("thread");
|
||||
mount_par_ticket = AddMountPar("ticket");
|
||||
mount_par_ticket_type = AddMountPar("ticket_type");
|
||||
mount_par_ticket_type_default = AddMountPar("ticket_type_default");
|
||||
mount_par_ticket_status = AddMountPar("ticket_status");
|
||||
mount_par_ticket_status_default = AddMountPar("ticket_status_default");
|
||||
mount_par_ticket_priority = AddMountPar("ticket_priority");
|
||||
mount_par_ticket_priority_default = AddMountPar("ticket_priority_default");
|
||||
mount_par_ticket_category = AddMountPar("ticket_category");
|
||||
mount_par_ticket_category_default = AddMountPar("ticket_category_default");
|
||||
mount_par_ticket_expected = AddMountPar("ticket_expected");
|
||||
mount_par_ticket_expected_default = AddMountPar("ticket_expected_default");
|
||||
mount_par_createthread_on = AddMountPar("createthread_on");
|
||||
mount_par_createticket_on = AddMountPar("createticket_on");
|
||||
mount_par_only_root_remove = AddMountPar("only_root_remove");
|
||||
mount_par_emacs_on = AddMountPar("emacs_on");
|
||||
mount_par_mkdir_on = AddMountPar("mkdir_on");
|
||||
mount_par_app = AddMountPar("app");
|
||||
mount_par_html_template = AddMountPar("html_template");
|
||||
}
|
||||
|
||||
|
||||
void Mounts::CreateMounts()
|
||||
{
|
||||
CreateMountType();
|
||||
CreateMountFs();
|
||||
CreateMountPar();
|
||||
|
||||
plugin.Call(WINIX_ADD_MOUNTS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Mounts::SetDirs(Dirs * pdirs)
|
||||
{
|
||||
dirs = pdirs;
|
||||
@@ -40,12 +91,86 @@ void Mounts::SetRequest(Request * prequest)
|
||||
|
||||
|
||||
|
||||
int Mounts::AddMountType(const char * type)
|
||||
{
|
||||
mount_type_tab.push_back(type);
|
||||
|
||||
return static_cast<int>(mount_type_tab.size()) - 1;
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountType(const std::string & type)
|
||||
{
|
||||
return AddMountType(type.c_str());
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountFs(const char * fs)
|
||||
{
|
||||
mount_fs_tab.push_back(fs);
|
||||
|
||||
return static_cast<int>(mount_fs_tab.size()) - 1;
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountType(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_type_tab.size() )
|
||||
return empty_str;
|
||||
|
||||
return mount_type_tab[id];
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountFs(const std::string & fs)
|
||||
{
|
||||
return AddMountFs(fs.c_str());
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountFs(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_fs_tab.size() )
|
||||
return empty_str;
|
||||
|
||||
return mount_fs_tab[id];
|
||||
}
|
||||
|
||||
|
||||
int Mounts::AddMountPar(const char * par)
|
||||
{
|
||||
mount_par_tab.push_back(par);
|
||||
|
||||
return static_cast<int>(mount_par_tab.size()) - 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int Mounts::AddMountPar(const std::string & par)
|
||||
{
|
||||
return AddMountPar(par.c_str());
|
||||
}
|
||||
|
||||
|
||||
const std::string & Mounts::GetMountPar(int id)
|
||||
{
|
||||
if( id < 0 || id >= (int)mount_par_tab.size() )
|
||||
return empty_str;
|
||||
|
||||
return mount_par_tab[id];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// reading from 'mounts'
|
||||
Error Mounts::ReadMounts(const std::string & mounts)
|
||||
{
|
||||
MountParser mp;
|
||||
mp.SetDirs(dirs);
|
||||
Error err = mp.Parse(mounts, mount_tab);
|
||||
mount_parser.SetDirs(dirs);
|
||||
mount_parser.SetMountTypeTab(mount_type_tab);
|
||||
mount_parser.SetMountFsTab(mount_fs_tab);
|
||||
mount_parser.SetMountParTab(mount_par_tab);
|
||||
|
||||
Error err = mount_parser.Parse(mounts, mount_tab);
|
||||
|
||||
if( err != WINIX_ERR_OK )
|
||||
{
|
||||
@@ -95,8 +220,8 @@ Error Mounts::ReadMounts()
|
||||
void Mounts::MountCmsForRoot()
|
||||
{
|
||||
Mount mount;
|
||||
mount.type = Mount::cms;
|
||||
mount.fs = Mount::simplefs;
|
||||
mount.type = MountTypeCms();
|
||||
mount.fs = MountFsSimplefs();
|
||||
|
||||
Item * proot = dirs->GetRootDir();
|
||||
|
||||
@@ -131,8 +256,8 @@ std::vector<Item*>::reverse_iterator i;
|
||||
if( m != mount_tab.end() )
|
||||
{
|
||||
pmount = &(m->second);
|
||||
log << log2 << "M: current mount point is: " << pmount->TypeToStr()
|
||||
<< ", fs: " << pmount->FsToStr() << logend;
|
||||
log << log2 << "M: current mount point is: " << GetMountType(pmount->type)
|
||||
<< ", fs: " << GetMountFs(pmount->fs) << logend;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -140,8 +265,8 @@ std::vector<Item*>::reverse_iterator i;
|
||||
// if nothing was found
|
||||
// we assume that 'cms' mount point is used
|
||||
MountCmsForRoot();
|
||||
log << log2 << "M: current mount point is: " << pmount->TypeToStr() << " (default)"
|
||||
<< ", fs: " << pmount->FsToStr() << logend;
|
||||
log << log2 << "M: current mount point is: " << GetMountType(pmount->type) << " (default)"
|
||||
<< ", fs: " << GetMountFs(pmount->fs) << logend;
|
||||
}
|
||||
|
||||
|
||||
|
114
core/mounts.h
114
core/mounts.h
@@ -2,7 +2,7 @@
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
@@ -14,11 +14,13 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "mount.h"
|
||||
#include "error.h"
|
||||
#include "dirs.h"
|
||||
#include "db.h"
|
||||
#include "request.h"
|
||||
#include "mountparser.h"
|
||||
|
||||
|
||||
|
||||
@@ -26,6 +28,60 @@ class Mounts
|
||||
{
|
||||
public:
|
||||
|
||||
/*
|
||||
mount point's types
|
||||
*/
|
||||
int AddMountType(const char * type);
|
||||
int AddMountType(const std::string & type);
|
||||
const std::string & GetMountType(int id);
|
||||
|
||||
// id of a specific mount type (the id is always valid)
|
||||
int MountTypeCms() { return mount_type_cms; }
|
||||
int MountTypeThread() { return mount_type_thread; }
|
||||
int MountTypeTicket() { return mount_type_ticket; }
|
||||
|
||||
|
||||
/*
|
||||
file systems
|
||||
*/
|
||||
int AddMountFs(const char * fs);
|
||||
int AddMountFs(const std::string & fs);
|
||||
const std::string & GetMountFs(int id);
|
||||
|
||||
// id of a specific file system (the id is always valid)
|
||||
int MountFsSimplefs() { return mount_fs_simplefs; }
|
||||
int MountFsHashfs() { return mount_fs_hashfs; }
|
||||
|
||||
|
||||
/*
|
||||
mount point's parameters
|
||||
*/
|
||||
int AddMountPar(const char * par);
|
||||
int AddMountPar(const std::string & par);
|
||||
const std::string & GetMountPar(int id);
|
||||
|
||||
int MountParPage() { return mount_par_page; }
|
||||
int MountParThread() { return mount_par_thread; }
|
||||
int MountParTicket() { return mount_par_ticket; }
|
||||
int MountParTicketType() { return mount_par_ticket_type; }
|
||||
int MountParTicketTypeDefault() { return mount_par_ticket_type_default; }
|
||||
int MountParTicketStatus() { return mount_par_ticket_status; }
|
||||
int MountParTicketStatusDefault() { return mount_par_ticket_status_default; }
|
||||
int MountParTicketPriority() { return mount_par_ticket_priority; }
|
||||
int MountParTicketPriorityDefault() { return mount_par_ticket_priority_default; }
|
||||
int MountParTicketCategory() { return mount_par_ticket_category; }
|
||||
int MountParTicketCategoryDefault() { return mount_par_ticket_category_default; }
|
||||
int MountParTicketExpected() { return mount_par_ticket_expected; }
|
||||
int MountParTicketExpectedDefault() { return mount_par_ticket_expected_default; }
|
||||
int MountParCreatethreadOn() { return mount_par_createthread_on; }
|
||||
int MountParCreateticketOn() { return mount_par_createticket_on; }
|
||||
int MountParOnlyRootRemove() { return mount_par_only_root_remove; }
|
||||
int MountParEmacsOn() { return mount_par_emacs_on; }
|
||||
int MountParMkdirOn() { return mount_par_mkdir_on; }
|
||||
int MountParApp() { return mount_par_app; }
|
||||
int MountParHtmlTemplate() { return mount_par_html_template; }
|
||||
|
||||
|
||||
void SetDirs(Dirs * pdirs);
|
||||
void SetDb(Db * pdb);
|
||||
void SetRequest(Request * prequest);
|
||||
@@ -34,6 +90,8 @@ public:
|
||||
typedef std::map<long, Mount> MountTab;
|
||||
|
||||
Mounts();
|
||||
void CreateMounts();
|
||||
|
||||
Error ReadMounts(const std::string & mounts);
|
||||
Error ReadMounts();
|
||||
|
||||
@@ -53,8 +111,62 @@ private:
|
||||
Db * db;
|
||||
Request * request;
|
||||
|
||||
const std::string empty_str;
|
||||
|
||||
MountParser mount_parser;
|
||||
|
||||
// cms
|
||||
// thread
|
||||
// ticket
|
||||
std::vector<std::string> mount_type_tab;
|
||||
|
||||
int mount_type_cms;
|
||||
int mount_type_thread;
|
||||
int mount_type_ticket;
|
||||
|
||||
// simplefs
|
||||
// hashfs
|
||||
std::vector<std::string> mount_fs_tab;
|
||||
|
||||
int mount_fs_simplefs;
|
||||
int mount_fs_hashfs;
|
||||
|
||||
// page
|
||||
// thread
|
||||
// ticket
|
||||
// ticket_type
|
||||
// ticket_type_default
|
||||
// ...
|
||||
std::vector<std::string> mount_par_tab;
|
||||
|
||||
int mount_par_page;
|
||||
int mount_par_thread;
|
||||
int mount_par_ticket;
|
||||
int mount_par_ticket_type;
|
||||
int mount_par_ticket_type_default;
|
||||
int mount_par_ticket_status;
|
||||
int mount_par_ticket_status_default;
|
||||
int mount_par_ticket_priority;
|
||||
int mount_par_ticket_priority_default;
|
||||
int mount_par_ticket_category;
|
||||
int mount_par_ticket_category_default;
|
||||
int mount_par_ticket_expected;
|
||||
int mount_par_ticket_expected_default;
|
||||
int mount_par_createthread_on;
|
||||
int mount_par_createticket_on;
|
||||
int mount_par_only_root_remove;
|
||||
int mount_par_emacs_on;
|
||||
int mount_par_mkdir_on;
|
||||
int mount_par_app;
|
||||
int mount_par_html_template;
|
||||
|
||||
|
||||
MountTab mount_tab;
|
||||
|
||||
void CreateMountType();
|
||||
void CreateMountFs();
|
||||
void CreateMountPar();
|
||||
|
||||
void MountCmsForRoot();
|
||||
};
|
||||
|
||||
|
@@ -252,13 +252,14 @@ Users::Iterator i;
|
||||
{
|
||||
sending = false;
|
||||
|
||||
if( system->mounts.pmount->type == Mount::thread || system->mounts.pmount->type == Mount::ticket )
|
||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() ||
|
||||
system->mounts.pmount->type == system->mounts.MountTypeTicket() )
|
||||
{
|
||||
if( (i->thread_notify & notify_code) != 0 )
|
||||
sending = true;
|
||||
}
|
||||
else
|
||||
if( system->mounts.pmount->type == Mount::cms )
|
||||
if( system->mounts.pmount->type == system->mounts.MountTypeCms() )
|
||||
{
|
||||
if( (i->cms_notify & notify_code) != 0 )
|
||||
sending = true;
|
||||
|
@@ -48,7 +48,9 @@
|
||||
// now you can initialize your plugin
|
||||
#define WINIX_PLUGIN_INIT 3008
|
||||
|
||||
|
||||
// here you can add your own mount point, file systems, mount parameters
|
||||
// for adding a new mount type call: system->mounts.AddMountType("new_mount_name")
|
||||
#define WINIX_ADD_MOUNTS 3009
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -46,6 +46,7 @@ void System::Init()
|
||||
mounts.SetDirs(&dirs);
|
||||
mounts.SetDb(db);
|
||||
mounts.SetRequest(request);
|
||||
mounts.CreateMounts();
|
||||
mounts.ReadMounts();
|
||||
|
||||
users.SetRequest(request);
|
||||
@@ -458,7 +459,7 @@ bool res;
|
||||
|
||||
Mount * pmount = mounts.CalcMount(item.parent_id);
|
||||
|
||||
if( !pmount || pmount->fs == Mount::simplefs )
|
||||
if( !pmount || pmount->fs == mounts.MountFsSimplefs() )
|
||||
{
|
||||
res = MakePathSimpleFs(path, item.parent_id, create_dir);
|
||||
}
|
||||
|
Reference in New Issue
Block a user