changed: added Cur structure
we have there two pointers: Request * request; Session * session; these are the current request and the current session the session GC was moved to SessionManager (was in SessionContainer) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@708 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
61ac29b2de
commit
915cabdf97
|
@ -6,48 +6,47 @@ app.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
|||
app.o: ../db/dbtextstream.h ../core/textstream.h misc.h ../core/error.h log.h
|
||||
app.o: textstream.h ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
app.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
app.o: ../core/ugcontainer.h request.h requesttypes.h session.h error.h
|
||||
app.o: user.h plugindata.h rebus.h ../templates/htmltextstream.h
|
||||
app.o: ../notify/notify.h ../notify/notifypool.h ../templates/locale.h
|
||||
app.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
|
||||
app.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
app.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
app.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
app.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
app.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
app.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
app.o: ugcontainer.h lastcontainer.h mounts.h mount.h mountparser.h users.h
|
||||
app.o: groups.h group.h loadavg.h thumb.h basethread.h sessionmanager.h
|
||||
app.o: sessioncontainer.h ../functions/functions.h
|
||||
app.o: ../core/ugcontainer.h request.h requesttypes.h error.h
|
||||
app.o: ../templates/htmltextstream.h ../notify/notify.h
|
||||
app.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
app.o: ../templates/misc.h ../templates/localefilter.h ../templates/locale.h
|
||||
app.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
|
||||
app.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
app.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
app.o: ../templates/htmltextstream.h ../notify/notifythread.h
|
||||
app.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
app.o: ../core/config.h ../core/users.h user.h ugcontainer.h lastcontainer.h
|
||||
app.o: cur.h session.h plugindata.h rebus.h mounts.h mount.h mountparser.h
|
||||
app.o: users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
app.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
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/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/template.h ../functions/tinymce.h
|
||||
app.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
|
||||
app.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
||||
app.o: ../templates/templates.h ../templates/patterncacher.h
|
||||
app.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
|
||||
app.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
|
||||
app.o: compress.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
|
||||
app.o: postmultiparser.h acceptencodingparser.h acceptbaseparser.h plugin.h
|
||||
app.o: pluginmsg.h
|
||||
app.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
app.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
app.o: ../functions/privchanger.h ../functions/chown.h
|
||||
app.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
app.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
app.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
app.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
app.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
app.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
app.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
app.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
app.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
app.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
app.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
|
||||
app.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
|
||||
app.o: ../core/sessionmanager.h compress.h getparser.h httpsimpleparser.h
|
||||
app.o: postparser.h cookieparser.h postmultiparser.h acceptencodingparser.h
|
||||
app.o: acceptbaseparser.h plugin.h pluginmsg.h
|
||||
basethread.o: basethread.h log.h textstream.h
|
||||
bbcodeparser.o: bbcodeparser.h htmlfilter.h
|
||||
compress.o: compress.h log.h textstream.h
|
||||
config.o: config.h confparser.h htmlfilter.h log.h textstream.h plugin.h
|
||||
config.o: pluginmsg.h plugindata.h request.h requesttypes.h session.h item.h
|
||||
config.o: error.h user.h rebus.h ../templates/htmltextstream.h
|
||||
config.o: ../core/textstream.h misc.h system.h dirs.h dircontainer.h
|
||||
config.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
config.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
config.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
config.o: pluginmsg.h plugindata.h request.h requesttypes.h item.h error.h
|
||||
config.o: ../templates/htmltextstream.h ../core/textstream.h misc.h system.h
|
||||
config.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
config.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
config.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
config.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
config.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
config.o: ../templates/misc.h ../templates/localefilter.h
|
||||
|
@ -56,21 +55,22 @@ config.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|||
config.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
config.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
config.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
config.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
config.o: ugcontainer.h lastcontainer.h mounts.h mount.h mountparser.h
|
||||
config.o: users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
config.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
config.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
config.o: ../core/synchro.h ../functions/functionparser.h
|
||||
config.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
config.o: ../functions/privchanger.h ../functions/chown.h
|
||||
config.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
config.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
config.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
config.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
config.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
config.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
config.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
config.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h user.h
|
||||
config.o: ugcontainer.h lastcontainer.h cur.h session.h rebus.h mounts.h
|
||||
config.o: mount.h mountparser.h users.h groups.h group.h loadavg.h thumb.h
|
||||
config.o: basethread.h sessionmanager.h sessioncontainer.h
|
||||
config.o: ../functions/functions.h ../functions/functionbase.h
|
||||
config.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
config.o: ../functions/functionparser.h ../core/cur.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/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/template.h
|
||||
config.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
config.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
config.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
|
@ -84,8 +84,8 @@ dirs.o: ../db/dbtextstream.h ../core/textstream.h misc.h ../core/error.h
|
|||
dirs.o: log.h textstream.h ../db/dbitemquery.h ../core/item.h
|
||||
dirs.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
dirs.o: ../core/dircontainer.h ../core/ugcontainer.h request.h requesttypes.h
|
||||
dirs.o: session.h error.h user.h plugindata.h rebus.h config.h confparser.h
|
||||
dirs.o: htmlfilter.h ../templates/htmltextstream.h ../notify/notify.h
|
||||
dirs.o: error.h config.h confparser.h htmlfilter.h
|
||||
dirs.o: ../templates/htmltextstream.h ../notify/notify.h
|
||||
dirs.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
dirs.o: ../templates/misc.h ../templates/localefilter.h ../templates/locale.h
|
||||
dirs.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
|
||||
|
@ -93,7 +93,8 @@ dirs.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|||
dirs.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
dirs.o: ../templates/htmltextstream.h ../notify/notifythread.h
|
||||
dirs.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
dirs.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
||||
dirs.o: ../core/config.h ../core/users.h user.h ugcontainer.h lastcontainer.h
|
||||
dirs.o: cur.h session.h plugindata.h rebus.h
|
||||
groups.o: groups.h group.h ugcontainer.h ../db/db.h ../db/dbbase.h
|
||||
groups.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
||||
groups.o: item.h ../core/error.h log.h textstream.h ../db/dbitemquery.h
|
||||
|
@ -117,7 +118,7 @@ misc.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|||
misc.o: ../core/textstream.h ../core/error.h ../db/dbitemquery.h
|
||||
misc.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
misc.o: ../core/dircontainer.h ../core/ugcontainer.h
|
||||
misc.o: ../templates/htmltextstream.h ../core/request.h ../core/system.h
|
||||
misc.o: ../templates/htmltextstream.h ../core/cur.h ../core/system.h
|
||||
misc.o: ../core/sessionmanager.h
|
||||
mount.o: mount.h misc.h item.h
|
||||
mountparser.o: mountparser.h mount.h item.h error.h dirs.h dircontainer.h
|
||||
|
@ -125,11 +126,10 @@ mountparser.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|||
mountparser.o: ../core/textstream.h misc.h ../core/error.h log.h textstream.h
|
||||
mountparser.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
mountparser.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
mountparser.o: ../core/ugcontainer.h request.h requesttypes.h session.h
|
||||
mountparser.o: user.h plugindata.h rebus.h config.h confparser.h htmlfilter.h
|
||||
mountparser.o: ../templates/htmltextstream.h ../notify/notify.h
|
||||
mountparser.o: ../notify/notifypool.h ../templates/locale.h
|
||||
mountparser.o: ../core/confparser.h ../templates/misc.h
|
||||
mountparser.o: ../core/ugcontainer.h request.h requesttypes.h config.h
|
||||
mountparser.o: confparser.h htmlfilter.h ../templates/htmltextstream.h
|
||||
mountparser.o: ../notify/notify.h ../notify/notifypool.h
|
||||
mountparser.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
|
||||
mountparser.o: ../templates/localefilter.h ../templates/locale.h
|
||||
mountparser.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
mountparser.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
|
@ -137,37 +137,39 @@ mountparser.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|||
mountparser.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
mountparser.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
mountparser.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
mountparser.o: ugcontainer.h lastcontainer.h
|
||||
mountparser.o: user.h ugcontainer.h lastcontainer.h cur.h session.h
|
||||
mountparser.o: plugindata.h rebus.h
|
||||
mounts.o: mounts.h mount.h error.h dirs.h item.h dircontainer.h ../db/db.h
|
||||
mounts.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
mounts.o: ../core/textstream.h misc.h ../core/error.h log.h textstream.h
|
||||
mounts.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
mounts.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
mounts.o: ../core/ugcontainer.h request.h requesttypes.h session.h user.h
|
||||
mounts.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h
|
||||
mounts.o: ../templates/htmltextstream.h ../notify/notify.h
|
||||
mounts.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
mounts.o: ../templates/misc.h ../templates/localefilter.h
|
||||
mounts.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
mounts.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
mounts.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
mounts.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
mounts.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
mounts.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
mounts.o: ugcontainer.h lastcontainer.h mountparser.h plugin.h pluginmsg.h
|
||||
mounts.o: system.h users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
mounts.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
mounts.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
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 ../functions/default.h
|
||||
mounts.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
mounts.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
mounts.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
mounts.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
mounts.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
mounts.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
mounts.o: ../core/ugcontainer.h request.h requesttypes.h config.h
|
||||
mounts.o: confparser.h htmlfilter.h ../templates/htmltextstream.h
|
||||
mounts.o: ../notify/notify.h ../notify/notifypool.h ../templates/locale.h
|
||||
mounts.o: ../core/confparser.h ../templates/misc.h
|
||||
mounts.o: ../templates/localefilter.h ../templates/locale.h
|
||||
mounts.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
|
||||
mounts.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
mounts.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
mounts.o: ../templates/htmltextstream.h ../notify/notifythread.h
|
||||
mounts.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
mounts.o: ../core/config.h ../core/users.h user.h ugcontainer.h
|
||||
mounts.o: lastcontainer.h cur.h session.h plugindata.h rebus.h mountparser.h
|
||||
mounts.o: plugin.h pluginmsg.h system.h users.h groups.h group.h loadavg.h
|
||||
mounts.o: thumb.h basethread.h sessionmanager.h sessioncontainer.h
|
||||
mounts.o: ../functions/functions.h ../functions/functionbase.h
|
||||
mounts.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
mounts.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
mounts.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
||||
mounts.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.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/template.h
|
||||
mounts.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
mounts.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
mounts.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
|
@ -175,12 +177,11 @@ mounts.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
|
|||
mounts.o: ../core/httpsimpleparser.h ../core/log.h
|
||||
mounts.o: ../templates/indexpatterns.h ../core/sessionmanager.h
|
||||
plugin.o: plugin.h pluginmsg.h log.h textstream.h plugindata.h config.h
|
||||
plugin.o: confparser.h htmlfilter.h request.h requesttypes.h session.h item.h
|
||||
plugin.o: error.h user.h rebus.h ../templates/htmltextstream.h
|
||||
plugin.o: ../core/textstream.h misc.h system.h dirs.h dircontainer.h
|
||||
plugin.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
plugin.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
plugin.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
plugin.o: confparser.h htmlfilter.h request.h requesttypes.h item.h error.h
|
||||
plugin.o: ../templates/htmltextstream.h ../core/textstream.h misc.h system.h
|
||||
plugin.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
plugin.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
plugin.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
plugin.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
plugin.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
plugin.o: ../templates/misc.h ../templates/localefilter.h
|
||||
|
@ -189,21 +190,22 @@ plugin.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|||
plugin.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
plugin.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
plugin.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
plugin.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
plugin.o: ugcontainer.h lastcontainer.h mounts.h mount.h mountparser.h
|
||||
plugin.o: users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
plugin.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
plugin.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
plugin.o: ../core/synchro.h ../functions/functionparser.h
|
||||
plugin.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
plugin.o: ../functions/privchanger.h ../functions/chown.h
|
||||
plugin.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
plugin.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
plugin.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
plugin.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
plugin.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
plugin.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
plugin.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
plugin.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h user.h
|
||||
plugin.o: ugcontainer.h lastcontainer.h cur.h session.h rebus.h mounts.h
|
||||
plugin.o: mount.h mountparser.h users.h groups.h group.h loadavg.h thumb.h
|
||||
plugin.o: basethread.h sessionmanager.h sessioncontainer.h
|
||||
plugin.o: ../functions/functions.h ../functions/functionbase.h
|
||||
plugin.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
plugin.o: ../functions/functionparser.h ../core/cur.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/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/template.h
|
||||
plugin.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
plugin.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
plugin.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
|
@ -211,15 +213,14 @@ plugin.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
|
|||
plugin.o: ../core/httpsimpleparser.h ../core/log.h
|
||||
plugin.o: ../templates/indexpatterns.h ../core/sessionmanager.h
|
||||
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h textstream.h config.h
|
||||
plugindata.o: confparser.h htmlfilter.h request.h requesttypes.h session.h
|
||||
plugindata.o: item.h error.h user.h rebus.h ../templates/htmltextstream.h
|
||||
plugindata.o: ../core/textstream.h misc.h system.h dirs.h dircontainer.h
|
||||
plugindata.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
plugindata.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
plugindata.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
plugindata.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
plugindata.o: ../notify/notifypool.h ../templates/locale.h
|
||||
plugindata.o: ../core/confparser.h ../templates/misc.h
|
||||
plugindata.o: confparser.h htmlfilter.h request.h requesttypes.h item.h
|
||||
plugindata.o: error.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
plugindata.o: misc.h system.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
|
||||
plugindata.o: ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
plugindata.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
plugindata.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
plugindata.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
plugindata.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
|
||||
plugindata.o: ../templates/localefilter.h ../templates/locale.h
|
||||
plugindata.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
plugindata.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
|
@ -227,11 +228,12 @@ plugindata.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|||
plugindata.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
plugindata.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
plugindata.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
plugindata.o: ugcontainer.h lastcontainer.h mounts.h mount.h mountparser.h
|
||||
plugindata.o: users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
plugindata.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
plugindata.o: user.h ugcontainer.h lastcontainer.h cur.h session.h rebus.h
|
||||
plugindata.o: mounts.h mount.h mountparser.h users.h groups.h group.h
|
||||
plugindata.o: loadavg.h thumb.h basethread.h sessionmanager.h
|
||||
plugindata.o: sessioncontainer.h ../functions/functions.h
|
||||
plugindata.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
plugindata.o: ../core/synchro.h ../functions/functionparser.h
|
||||
plugindata.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.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
|
||||
|
@ -252,38 +254,40 @@ plugindata.o: ../templates/indexpatterns.h ../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
|
||||
rebus.o: log.h textstream.h rebus.h misc.h item.h request.h requesttypes.h
|
||||
rebus.o: session.h error.h user.h plugindata.h config.h confparser.h
|
||||
rebus.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
request.o: request.h requesttypes.h session.h item.h error.h user.h
|
||||
request.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h
|
||||
request.o: textstream.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
request.o: misc.h log.h plugin.h pluginmsg.h system.h dirs.h dircontainer.h
|
||||
request.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
request.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
request.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
request.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
request.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
request.o: ../templates/misc.h ../templates/localefilter.h
|
||||
request.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
request.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
request.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
request.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
request.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
request.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
request.o: ugcontainer.h lastcontainer.h mounts.h mount.h mountparser.h
|
||||
request.o: users.h groups.h group.h loadavg.h thumb.h basethread.h
|
||||
request.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
request.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
request.o: ../core/synchro.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 ../functions/default.h
|
||||
request.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
request.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
request.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
request.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
request.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
rebus.o: log.h textstream.h rebus.h misc.h item.h cur.h request.h
|
||||
rebus.o: requesttypes.h error.h config.h confparser.h htmlfilter.h
|
||||
rebus.o: ../templates/htmltextstream.h ../core/textstream.h session.h user.h
|
||||
rebus.o: plugindata.h
|
||||
request.o: request.h requesttypes.h item.h error.h config.h confparser.h
|
||||
request.o: htmlfilter.h textstream.h ../templates/htmltextstream.h
|
||||
request.o: ../core/textstream.h misc.h log.h plugin.h pluginmsg.h
|
||||
request.o: plugindata.h system.h dirs.h dircontainer.h ../db/db.h
|
||||
request.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
request.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
request.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
request.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
request.o: ../templates/locale.h ../core/confparser.h ../templates/misc.h
|
||||
request.o: ../templates/localefilter.h ../templates/locale.h
|
||||
request.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
|
||||
request.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
request.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
request.o: ../templates/htmltextstream.h ../notify/notifythread.h
|
||||
request.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
request.o: ../core/config.h ../core/users.h user.h ugcontainer.h
|
||||
request.o: lastcontainer.h cur.h session.h rebus.h mounts.h mount.h
|
||||
request.o: mountparser.h users.h groups.h group.h loadavg.h thumb.h
|
||||
request.o: basethread.h sessionmanager.h sessioncontainer.h
|
||||
request.o: ../functions/functions.h ../functions/functionbase.h
|
||||
request.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
request.o: ../functions/functionparser.h ../core/cur.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/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
|
||||
request.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
request.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
request.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
|
@ -293,15 +297,15 @@ request.o: ../core/httpsimpleparser.h ../core/log.h
|
|||
request.o: ../templates/indexpatterns.h ../core/sessionmanager.h
|
||||
session.o: session.h item.h error.h user.h plugindata.h rebus.h misc.h
|
||||
sessioncontainer.o: sessioncontainer.h session.h item.h error.h user.h
|
||||
sessioncontainer.o: plugindata.h rebus.h lastcontainer.h request.h
|
||||
sessioncontainer.o: requesttypes.h config.h confparser.h htmlfilter.h
|
||||
sessioncontainer.o: textstream.h ../templates/htmltextstream.h
|
||||
sessioncontainer.o: ../core/textstream.h misc.h basethread.h log.h
|
||||
sessioncontainer.o: plugindata.h rebus.h cur.h request.h requesttypes.h
|
||||
sessioncontainer.o: config.h confparser.h htmlfilter.h textstream.h
|
||||
sessioncontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessioncontainer.o: log.h
|
||||
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
|
||||
sessionmanager.o: error.h user.h plugindata.h rebus.h lastcontainer.h
|
||||
sessionmanager.o: request.h requesttypes.h config.h confparser.h htmlfilter.h
|
||||
sessionmanager.o: error.h user.h plugindata.h rebus.h cur.h request.h
|
||||
sessionmanager.o: requesttypes.h config.h confparser.h htmlfilter.h
|
||||
sessionmanager.o: textstream.h ../templates/htmltextstream.h
|
||||
sessionmanager.o: ../core/textstream.h misc.h basethread.h system.h dirs.h
|
||||
sessionmanager.o: ../core/textstream.h misc.h lastcontainer.h system.h dirs.h
|
||||
sessionmanager.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
sessionmanager.o: ../db/dbtextstream.h ../core/error.h log.h
|
||||
sessionmanager.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
|
@ -318,57 +322,58 @@ sessionmanager.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
|||
sessionmanager.o: ../notify/templatesnotify.h ../core/config.h
|
||||
sessionmanager.o: ../core/users.h ugcontainer.h mounts.h mount.h
|
||||
sessionmanager.o: mountparser.h users.h groups.h group.h loadavg.h thumb.h
|
||||
sessionmanager.o: sessionparser.h plugin.h pluginmsg.h
|
||||
sessionmanager.o: basethread.h sessionparser.h plugin.h pluginmsg.h
|
||||
sessionmanager.o: ../functions/functions.h ../functions/functionbase.h
|
||||
sessionmanager.o: ../core/request.h ../core/system.h ../core/synchro.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/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/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/functionparser.h ../core/cur.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/default.h
|
||||
sessionmanager.o: ../functions/download.h ../functions/emacs.h
|
||||
sessionmanager.o: ../functions/last.h ../functions/login.h
|
||||
sessionmanager.o: ../functions/logout.h ../functions/ln.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/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
|
||||
sessionparser.o: sessionparser.h session.h item.h error.h user.h plugindata.h
|
||||
sessionparser.o: rebus.h sessioncontainer.h lastcontainer.h request.h
|
||||
sessionparser.o: requesttypes.h config.h confparser.h htmlfilter.h
|
||||
sessionparser.o: textstream.h ../templates/htmltextstream.h
|
||||
sessionparser.o: ../core/textstream.h misc.h basethread.h users.h log.h
|
||||
sessionparser.o: rebus.h sessioncontainer.h cur.h request.h requesttypes.h
|
||||
sessionparser.o: config.h confparser.h htmlfilter.h textstream.h
|
||||
sessionparser.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessionparser.o: users.h log.h
|
||||
synchro.o: synchro.h
|
||||
system.o: system.h dirs.h item.h dircontainer.h ../db/db.h ../db/dbbase.h
|
||||
system.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
||||
system.o: ../core/error.h log.h textstream.h ../db/dbitemquery.h
|
||||
system.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
system.o: ../core/dircontainer.h ../core/ugcontainer.h request.h
|
||||
system.o: requesttypes.h session.h error.h user.h plugindata.h rebus.h
|
||||
system.o: config.h confparser.h htmlfilter.h ../templates/htmltextstream.h
|
||||
system.o: ../notify/notify.h ../notify/notifypool.h ../templates/locale.h
|
||||
system.o: ../core/confparser.h ../templates/misc.h
|
||||
system.o: ../templates/localefilter.h ../templates/locale.h
|
||||
system.o: ../../ezc/src/ezc.h ../../ezc/src/utf8.h ../../ezc/src/generator.h
|
||||
system.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
system.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
system.o: ../templates/htmltextstream.h ../notify/notifythread.h
|
||||
system.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
system.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
||||
system.o: requesttypes.h error.h config.h confparser.h htmlfilter.h
|
||||
system.o: ../templates/htmltextstream.h ../notify/notify.h
|
||||
system.o: ../notify/notifypool.h ../templates/locale.h ../core/confparser.h
|
||||
system.o: ../templates/misc.h ../templates/localefilter.h
|
||||
system.o: ../templates/locale.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
system.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
system.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
system.o: ../../ezc/src/stringconv.h ../templates/htmltextstream.h
|
||||
system.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
system.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h user.h
|
||||
system.o: ugcontainer.h lastcontainer.h cur.h session.h plugindata.h rebus.h
|
||||
system.o: mounts.h mount.h mountparser.h users.h groups.h group.h loadavg.h
|
||||
system.o: thumb.h basethread.h ../templates/templates.h
|
||||
system.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
|
||||
system.o: ../core/httpsimpleparser.h ../core/log.h
|
||||
system.o: ../templates/indexpatterns.h ../core/request.h ../core/system.h
|
||||
system.o: ../templates/indexpatterns.h ../core/cur.h ../core/system.h
|
||||
system.o: ../core/sessionmanager.h ../functions/functionbase.h
|
||||
system.o: ../core/synchro.h
|
||||
system.o: ../core/request.h ../core/synchro.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
|
||||
|
@ -376,15 +381,16 @@ 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/dircontainer.h ../core/ugcontainer.h ../core/config.h
|
||||
thumb.o: ../../ezc/src/utf8.h system.h dirs.h dircontainer.h request.h
|
||||
thumb.o: requesttypes.h session.h error.h user.h plugindata.h rebus.h
|
||||
thumb.o: config.h confparser.h htmlfilter.h ../templates/htmltextstream.h
|
||||
thumb.o: ../notify/notify.h ../notify/notifypool.h ../templates/locale.h
|
||||
thumb.o: ../core/confparser.h ../templates/misc.h ../templates/localefilter.h
|
||||
thumb.o: requesttypes.h error.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
|
||||
thumb.o: ../core/users.h user.h ugcontainer.h lastcontainer.h cur.h session.h
|
||||
thumb.o: plugindata.h rebus.h mounts.h mount.h mountparser.h users.h groups.h
|
||||
thumb.o: group.h loadavg.h
|
||||
users.o: users.h
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreacceptbaseparser
|
||||
#define headerfilecmslucoreacceptbaseparser
|
||||
#ifndef headerfile_winix_core_acceptbaseparser
|
||||
#define headerfile_winix_core_acceptbaseparser
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreacceptencodingparser
|
||||
#define headerfilecmslucoreacceptencodingparser
|
||||
#ifndef headerfile_winix_core_acceptencodingparser
|
||||
#define headerfile_winix_core_acceptencodingparser
|
||||
|
||||
#include "acceptbaseparser.h"
|
||||
#include "log.h"
|
||||
|
|
232
core/app.cpp
232
core/app.cpp
|
@ -31,33 +31,37 @@ App::App()
|
|||
last_sessions_save = std::time(0);
|
||||
fcgi_socket = -1;
|
||||
|
||||
// temporary there is only one request
|
||||
cur.request = &req;
|
||||
cur.session = session_manager.GetTmpSession();
|
||||
|
||||
db.SetConn(db_conn);
|
||||
|
||||
plugin.SetDb(&db);
|
||||
plugin.SetConfig(&config);
|
||||
plugin.SetRequest(&request);
|
||||
plugin.SetCur(&cur);
|
||||
plugin.SetSystem(&system);
|
||||
plugin.SetFunctions(&functions);
|
||||
plugin.SetTemplates(&templates);
|
||||
plugin.SetSynchro(&synchro);
|
||||
plugin.SetSessionManager(&session_manager);
|
||||
|
||||
request.SetConfig(&config);
|
||||
req.SetConfig(&config);
|
||||
|
||||
functions.SetConfig(&config);
|
||||
functions.SetRequest(&request);
|
||||
functions.SetCur(&cur);
|
||||
functions.SetDb(&db);
|
||||
functions.SetSystem(&system);
|
||||
functions.SetTemplates(&templates);
|
||||
functions.SetSynchro(&synchro);
|
||||
|
||||
system.SetConfig(&config);
|
||||
system.SetRequest(&request);
|
||||
system.SetCur(&cur);
|
||||
system.SetDb(&db);
|
||||
system.SetSynchro(&synchro);
|
||||
|
||||
templates.SetConfig(&config);
|
||||
templates.SetRequest(&request);
|
||||
templates.SetCur(&cur);
|
||||
templates.SetDb(&db);
|
||||
templates.SetSystem(&system);
|
||||
templates.SetFunctions(&functions);
|
||||
|
@ -65,7 +69,7 @@ App::App()
|
|||
|
||||
session_manager.SetLastContainer(&system.users.last);
|
||||
session_manager.SetConfig(&config);
|
||||
session_manager.SetRequest(&request);
|
||||
session_manager.SetCur(&cur);
|
||||
session_manager.SetSystem(&system);
|
||||
session_manager.SetSynchro(&synchro);
|
||||
|
||||
|
@ -131,7 +135,7 @@ bool App::Init()
|
|||
db_conn.WaitForConnection();
|
||||
db.LogQueries(config.log_db_query);
|
||||
|
||||
request.Clear();
|
||||
cur.request->Clear();
|
||||
compress.Init();
|
||||
system.Init();
|
||||
functions.Init();
|
||||
|
@ -143,6 +147,7 @@ bool App::Init()
|
|||
|
||||
// init notify after templates (it uses locales from templates)
|
||||
system.notify.ReadTemplates();
|
||||
session_manager.InitTmpSession();
|
||||
session_manager.LoadSessions();
|
||||
|
||||
CreateStaticTree();
|
||||
|
@ -158,7 +163,8 @@ void App::Close()
|
|||
{
|
||||
session_manager.SaveSessions();
|
||||
session_manager.DeleteSessions();
|
||||
request.Clear();
|
||||
cur.request->Clear();
|
||||
session_manager.UninitTmpSession();
|
||||
}
|
||||
|
||||
|
||||
|
@ -168,13 +174,13 @@ bool App::BaseUrlRedirect()
|
|||
if( config.base_url_http_host.empty() )
|
||||
return false;
|
||||
|
||||
if( Equal(config.base_url_http_host.c_str(), request.env_http_host) )
|
||||
if( Equal(config.base_url_http_host.c_str(), cur.request->env_http_host) )
|
||||
return false;
|
||||
|
||||
request.redirect_to = config.base_url;
|
||||
AssignString(request.env_request_uri, request.redirect_to, false);
|
||||
cur.request->redirect_to = config.base_url;
|
||||
AssignString(cur.request->env_request_uri, cur.request->redirect_to, false);
|
||||
|
||||
log << log3 << "RC: BaseUrlRedirect from: " << request.env_http_host << logend;
|
||||
log << log3 << "RC: BaseUrlRedirect from: " << cur.request->env_http_host << logend;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -184,19 +190,23 @@ void App::ProcessRequestThrow()
|
|||
{
|
||||
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
|
||||
// when BaseUrlRedirect() return true we didn't have to set everything in cur.request->Read()
|
||||
// in the future cur.request->Read() can be split and at the beginning only environment variables will be read
|
||||
// and then BaseUrlRedirect() will be called (for performance)
|
||||
if( !BaseUrlRedirect() )
|
||||
{
|
||||
session_manager.SetSession(); // set request.session as well
|
||||
// !! dac zeby zwracalo wskaznik (zawsze prawidlowy) na sesje
|
||||
// i tutaj przypisanie do request.session
|
||||
session_manager.SetSession();
|
||||
cur.session = session_manager.GetCurSession();
|
||||
|
||||
// !! tutaj dodac to ustawianie request.session
|
||||
if( cur.session->new_session )
|
||||
{
|
||||
cur.session->plugin_data.Resize(plugin.Size());
|
||||
plugin.Call(WINIX_SESSION_CREATED);
|
||||
}
|
||||
|
||||
plugin.Call(WINIX_SESSION_CHANGED);
|
||||
|
||||
functions.Parse();
|
||||
|
||||
system.mounts.CalcCurMount();
|
||||
|
||||
Make();
|
||||
|
@ -216,7 +226,6 @@ void App::ProcessRequest()
|
|||
ProcessRequestThrow();
|
||||
SaveSessionsIfNeeded(); // !! przerzucic to na watek sesji
|
||||
|
||||
request.Clear();
|
||||
system.load_avg.StopRequest();
|
||||
log << logendrequest;
|
||||
}
|
||||
|
@ -232,6 +241,9 @@ void App::ProcessRequest()
|
|||
{
|
||||
log << log1 << "App: there was an unknown exception" << logend;
|
||||
}
|
||||
|
||||
cur.request->Clear();
|
||||
cur.session = session_manager.GetTmpSession();
|
||||
}
|
||||
|
||||
|
||||
|
@ -270,20 +282,20 @@ void App::MakePage()
|
|||
bool sent = false;
|
||||
|
||||
|
||||
if( !request.redirect_to.empty() || !request.x_sendfile.empty() )
|
||||
if( !cur.request->redirect_to.empty() || !cur.request->x_sendfile.empty() )
|
||||
return;
|
||||
|
||||
|
||||
if( request.is_item && request.item.file_type == WINIX_ITEM_FILETYPE_NONE &&
|
||||
request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK && request.function )
|
||||
if( cur.request->is_item && cur.request->item.file_type == WINIX_ITEM_FILETYPE_NONE &&
|
||||
cur.request->item.content_type == Item::ct_raw && cur.request->status == WINIX_ERR_OK && cur.request->function )
|
||||
{
|
||||
if( request.function == &functions.fun_cat )
|
||||
if( cur.request->function == &functions.fun_cat )
|
||||
{
|
||||
request.page << request.item.content;
|
||||
cur.request->page << cur.request->item.content;
|
||||
sent = true;
|
||||
}
|
||||
else
|
||||
if( request.function == &functions.fun_run )
|
||||
if( cur.request->function == &functions.fun_run )
|
||||
{
|
||||
templates.GenerateRunRaw();
|
||||
sent = true;
|
||||
|
@ -301,35 +313,35 @@ bool sent = false;
|
|||
// !! ta nazwa chyba juz zajeta...
|
||||
void App::Make()
|
||||
{
|
||||
if( request.dir_tab.empty() )
|
||||
if( cur.request->dir_tab.empty() )
|
||||
{
|
||||
log << log1 << "Content: there is no a root dir (dir_tab is empty)" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
// request.status can be changed by function_parser
|
||||
if( request.status == WINIX_ERR_OK )
|
||||
// cur.request->status can be changed by function_parser
|
||||
if( cur.request->status == WINIX_ERR_OK )
|
||||
plugin.Call(WINIX_PREPARE_REQUEST);
|
||||
|
||||
if( request.status == WINIX_ERR_OK )
|
||||
if( cur.request->status == WINIX_ERR_OK )
|
||||
functions.CheckFunctionAndSymlink();
|
||||
|
||||
if( request.status == WINIX_ERR_OK )
|
||||
if( cur.request->status == WINIX_ERR_OK )
|
||||
functions.MakeFunction();
|
||||
|
||||
if( request.session->spam_score > 0 )
|
||||
log << log1 << "App: spam score: " << request.session->spam_score << logend;
|
||||
if( cur.session->spam_score > 0 )
|
||||
log << log1 << "App: spam score: " << cur.session->spam_score << logend;
|
||||
|
||||
if( request.IsParam(L"noredirect") )
|
||||
request.redirect_to.clear();
|
||||
if( cur.request->IsParam(L"noredirect") )
|
||||
cur.request->redirect_to.clear();
|
||||
|
||||
if( request.status == WINIX_ERR_OK )
|
||||
if( cur.request->status == WINIX_ERR_OK )
|
||||
plugin.Call(WINIX_PROCESS_REQUEST);
|
||||
|
||||
if( !request.redirect_to.empty() )
|
||||
if( !cur.request->redirect_to.empty() )
|
||||
return;
|
||||
|
||||
if( request.dir_tab.empty() )
|
||||
if( cur.request->dir_tab.empty() )
|
||||
{
|
||||
log << log1 << "App: there is no a root dir (dir_tab is empty -- after calling a function)" << logend;
|
||||
return;
|
||||
|
@ -342,8 +354,8 @@ void App::Make()
|
|||
{
|
||||
// !! dodac inne informacje (get, post, itp)
|
||||
// jesli jest debug_info wlaczone to nie robic przekierowan
|
||||
request.PrintGetTab();
|
||||
//request.PrintEnv(); // !! PrintEnv() mozna przeniesc tutaj (do klasy App)
|
||||
cur.request->PrintGetTab();
|
||||
//cur.request->PrintEnv(); // !! PrintEnv() mozna przeniesc tutaj (do klasy App)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -361,13 +373,13 @@ void App::ReadRequest()
|
|||
LogAccess();
|
||||
|
||||
ReadGetPostVars();
|
||||
cookie_parser.Parse(request.env_http_cookie, request.cookie_tab);
|
||||
accept_encoding_parser.Parse(request.env_http_accept_encoding);
|
||||
cookie_parser.Parse(cur.request->env_http_cookie, cur.request->cookie_tab);
|
||||
accept_encoding_parser.Parse(cur.request->env_http_accept_encoding);
|
||||
|
||||
CheckIE();
|
||||
CheckKonqueror();
|
||||
|
||||
if( request.role == Request::authorizer )
|
||||
if( cur.request->role == Request::authorizer )
|
||||
log << log3 << "Request: fast cgi role: authorizer" << logend;
|
||||
}
|
||||
|
||||
|
@ -380,7 +392,7 @@ const char * v = FCGX_GetParam(name, fcgi_request.envp);
|
|||
if( v )
|
||||
env = v;
|
||||
|
||||
// by default env is set to an empty string (in request.Clear() method)
|
||||
// by default env is set to an empty string (in cur.request->Clear() method)
|
||||
}
|
||||
|
||||
|
||||
|
@ -390,41 +402,41 @@ void App::ReadEnvVariables()
|
|||
// we store that values because FCGX_GetParam has O(n) complexity
|
||||
// with this variables (env_*) we have O(1)
|
||||
|
||||
SetEnv(request.env_request_method, "REQUEST_METHOD"); // !! mozna nie uzywac tego, teraz mamy w strukturze fcgi_request
|
||||
SetEnv(request.env_request_uri, "REQUEST_URI");
|
||||
SetEnv(request.env_http_cookie, "HTTP_COOKIE");
|
||||
SetEnv(request.env_remote_addr, "REMOTE_ADDR");
|
||||
SetEnv(request.env_http_host, "HTTP_HOST");
|
||||
SetEnv(request.env_http_user_agent, "HTTP_USER_AGENT");
|
||||
SetEnv(request.env_fcgi_role, "FCGI_ROLE");
|
||||
SetEnv(request.env_content_type, "CONTENT_TYPE");
|
||||
SetEnv(request.env_http_accept_encoding,"HTTP_ACCEPT_ENCODING");
|
||||
SetEnv(cur.request->env_request_method, "REQUEST_METHOD"); // !! mozna nie uzywac tego, teraz mamy w strukturze fcgi_request
|
||||
SetEnv(cur.request->env_request_uri, "REQUEST_URI");
|
||||
SetEnv(cur.request->env_http_cookie, "HTTP_COOKIE");
|
||||
SetEnv(cur.request->env_remote_addr, "REMOTE_ADDR");
|
||||
SetEnv(cur.request->env_http_host, "HTTP_HOST");
|
||||
SetEnv(cur.request->env_http_user_agent, "HTTP_USER_AGENT");
|
||||
SetEnv(cur.request->env_fcgi_role, "FCGI_ROLE");
|
||||
SetEnv(cur.request->env_content_type, "CONTENT_TYPE");
|
||||
SetEnv(cur.request->env_http_accept_encoding,"HTTP_ACCEPT_ENCODING");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void App::CheckRequestMethod()
|
||||
{
|
||||
request.method = Request::none;
|
||||
cur.request->method = Request::none;
|
||||
|
||||
if( ToSmall(request.env_request_method[0]) == 'g' )
|
||||
request.method = Request::get;
|
||||
if( ToSmall(cur.request->env_request_method[0]) == 'g' )
|
||||
cur.request->method = Request::get;
|
||||
else
|
||||
if( ToSmall(request.env_request_method[0]) == 'p' )
|
||||
request.method = Request::post;
|
||||
if( ToSmall(cur.request->env_request_method[0]) == 'p' )
|
||||
cur.request->method = Request::post;
|
||||
else
|
||||
if( ToSmall(request.env_request_method[0]) == 'h' )
|
||||
request.method = Request::head;
|
||||
if( ToSmall(cur.request->env_request_method[0]) == 'h' )
|
||||
cur.request->method = Request::head;
|
||||
}
|
||||
|
||||
|
||||
void App::CheckFCGIRole()
|
||||
{
|
||||
// default we assume 'responder'
|
||||
request.role = Request::responder;
|
||||
cur.request->role = Request::responder;
|
||||
|
||||
if( ToSmall(request.env_fcgi_role[0]) == 'a' )
|
||||
request.role = Request::authorizer;
|
||||
if( ToSmall(cur.request->env_fcgi_role[0]) == 'a' )
|
||||
cur.request->role = Request::authorizer;
|
||||
}
|
||||
|
||||
|
||||
|
@ -433,11 +445,11 @@ void App::LogAccess()
|
|||
{
|
||||
log.PutDate(log1);
|
||||
|
||||
log << request.env_remote_addr << ' '
|
||||
<< request.env_request_method << ' '
|
||||
<< request.env_http_host
|
||||
<< request.env_request_uri << ' '
|
||||
<< request.env_http_user_agent << logend;
|
||||
log << cur.request->env_remote_addr << ' '
|
||||
<< cur.request->env_request_method << ' '
|
||||
<< cur.request->env_http_host
|
||||
<< cur.request->env_request_uri << ' '
|
||||
<< cur.request->env_http_user_agent << logend;
|
||||
}
|
||||
|
||||
|
||||
|
@ -447,22 +459,22 @@ void App::ReadGetPostVars()
|
|||
{
|
||||
// get parameters we have always
|
||||
get_parser.UTF8(config.utf8);
|
||||
get_parser.Parse(request.env_request_uri, request.get_tab);
|
||||
get_parser.Parse(cur.request->env_request_uri, cur.request->get_tab);
|
||||
|
||||
if( request.method == Request::post )
|
||||
if( cur.request->method == Request::post )
|
||||
{
|
||||
if( IsSubStringNoCase("multipart/form-data", request.env_content_type) )
|
||||
if( IsSubStringNoCase("multipart/form-data", cur.request->env_content_type) )
|
||||
{
|
||||
log << log3 << "Request: post content type: multipart/form-data" << logend;
|
||||
// !! dodac metode UTF8 do post_multi_parsera
|
||||
// (narazie bierze bezposrednio z konfigu)
|
||||
// w ogole wywalic zaleznosc od konfiga
|
||||
post_multi_parser.Parse(fcgi_request.in, request.post_tab, request.post_file_tab);
|
||||
post_multi_parser.Parse(fcgi_request.in, cur.request->post_tab, cur.request->post_file_tab);
|
||||
}
|
||||
else
|
||||
{
|
||||
post_parser.UTF8(config.utf8);
|
||||
post_parser.Parse(fcgi_request.in, request.post_tab);
|
||||
post_parser.Parse(fcgi_request.in, cur.request->post_tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -472,24 +484,24 @@ void App::ReadGetPostVars()
|
|||
|
||||
void App::CheckIE()
|
||||
{
|
||||
char * msie = strstr(request.env_http_user_agent, "MSIE");
|
||||
char * msie = strstr(cur.request->env_http_user_agent, "MSIE");
|
||||
|
||||
if( msie )
|
||||
request.browser_msie = true;
|
||||
cur.request->browser_msie = true;
|
||||
else
|
||||
request.browser_msie = false;
|
||||
cur.request->browser_msie = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void App::CheckKonqueror()
|
||||
{
|
||||
char * kon = strstr(request.env_http_user_agent, "Konqueror");
|
||||
char * kon = strstr(cur.request->env_http_user_agent, "Konqueror");
|
||||
|
||||
if( kon )
|
||||
request.browser_konqueror = true;
|
||||
cur.request->browser_konqueror = true;
|
||||
else
|
||||
request.browser_konqueror = false;
|
||||
cur.request->browser_konqueror = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -499,18 +511,18 @@ void App::CheckKonqueror()
|
|||
|
||||
void App::PrepareSessionCookie()
|
||||
{
|
||||
if( !request.session || request.session->id==0 )
|
||||
if( !cur.session || cur.session->id==0 )
|
||||
return;
|
||||
|
||||
if( !request.session->puser || !request.session->remember_me )
|
||||
if( !cur.session->puser || !cur.session->remember_me )
|
||||
{
|
||||
request.SetCookie(config.http_session_id_name.c_str(), request.session->id);
|
||||
cur.request->SetCookie(config.http_session_id_name.c_str(), cur.session->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t t = std::time(0) + config.session_remember_max_idle;
|
||||
tm expires = Time(t);
|
||||
request.SetCookie(config.http_session_id_name.c_str(), request.session->id, &expires);
|
||||
cur.request->SetCookie(config.http_session_id_name.c_str(), cur.session->id, &expires);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -521,27 +533,27 @@ void App::SendHeaders(bool compressing, Header header)
|
|||
{
|
||||
PrepareSessionCookie();
|
||||
|
||||
if( request.send_as_attachment )
|
||||
if( cur.request->send_as_attachment )
|
||||
FCGX_PutS("Content-Disposition: attachment\r\n", fcgi_request.out);
|
||||
|
||||
if( !request.redirect_to.empty() )
|
||||
if( !cur.request->redirect_to.empty() )
|
||||
{
|
||||
FCGX_PutS("Status: 301 Moved Permanently\r\n", fcgi_request.out);
|
||||
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.aredirect_to << logend;
|
||||
UrlEncode(cur.request->redirect_to, cur.request->aredirect_to);
|
||||
FCGX_FPrintF(fcgi_request.out, "Location: %s\r\n", cur.request->aredirect_to.c_str());
|
||||
log << log2 << "Redirect to: " << cur.request->aredirect_to << logend;
|
||||
}
|
||||
else
|
||||
if( !request.x_sendfile.empty() )
|
||||
if( !cur.request->x_sendfile.empty() )
|
||||
{
|
||||
static std::string temp, temp2; // !! wrzucic gdzies to
|
||||
|
||||
Ezc::WideToUTF8(config.http_header_send_file, temp);
|
||||
Ezc::WideToUTF8(request.x_sendfile, temp2);
|
||||
Ezc::WideToUTF8(cur.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);
|
||||
log << log2 << "Sending file: " << request.x_sendfile << logend;
|
||||
log << log2 << "Sending file: " << cur.request->x_sendfile << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -562,7 +574,7 @@ void App::SendHeaders(bool compressing, Header header)
|
|||
default:
|
||||
FCGX_PutS("Status: 200 OK\r\n", fcgi_request.out);
|
||||
|
||||
if( request.role != Request::authorizer )
|
||||
if( cur.request->role != Request::authorizer )
|
||||
FCGX_PutS("Content-Type: text/html\r\n", fcgi_request.out);
|
||||
}
|
||||
}
|
||||
|
@ -570,7 +582,7 @@ void App::SendHeaders(bool compressing, Header header)
|
|||
if( compressing )
|
||||
FCGX_PutS("Content-Encoding: deflate\r\n", fcgi_request.out);
|
||||
|
||||
FCGX_PutS(request.headers.CStr(), fcgi_request.out);
|
||||
FCGX_PutS(cur.request->headers.CStr(), fcgi_request.out);
|
||||
FCGX_PutS("\r\n", fcgi_request.out);
|
||||
}
|
||||
|
||||
|
@ -593,8 +605,8 @@ void App::FilterCompressSend(bool compressing, const std::wstring & source_ref)
|
|||
{
|
||||
const std::wstring * source = &source_ref;
|
||||
|
||||
bool raw = request.is_item && request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK &&
|
||||
request.function && (request.function == &functions.fun_cat || request.function == &functions.fun_run);
|
||||
bool raw = cur.request->is_item && cur.request->item.content_type == Item::ct_raw && cur.request->status == WINIX_ERR_OK &&
|
||||
cur.request->function && (cur.request->function == &functions.fun_cat || cur.request->function == &functions.fun_run);
|
||||
|
||||
if( config.html_filter && !raw )
|
||||
{
|
||||
|
@ -626,11 +638,11 @@ void App::FilterCompressSend(bool compressing, const std::wstring & source_ref)
|
|||
bool App::IsCompressionAllowed(const std::wstring & source)
|
||||
{
|
||||
return( config.compression &&
|
||||
request.role == Request::responder &&
|
||||
request.redirect_to.empty() &&
|
||||
request.x_sendfile.empty() &&
|
||||
!request.browser_msie &&
|
||||
!request.browser_konqueror &&
|
||||
cur.request->role == Request::responder &&
|
||||
cur.request->redirect_to.empty() &&
|
||||
cur.request->x_sendfile.empty() &&
|
||||
!cur.request->browser_msie &&
|
||||
!cur.request->browser_konqueror &&
|
||||
accept_encoding_parser.AcceptDeflate() &&
|
||||
source.size() >= (size_t)config.compression_page_min_size );
|
||||
}
|
||||
|
@ -638,11 +650,11 @@ bool App::IsCompressionAllowed(const std::wstring & source)
|
|||
|
||||
bool App::CanSendContent(Header header)
|
||||
{
|
||||
if( !request.redirect_to.empty() || !request.x_sendfile.empty() )
|
||||
if( !cur.request->redirect_to.empty() || !cur.request->x_sendfile.empty() )
|
||||
// if there is a redirect or a file to send then we do not send a content
|
||||
return false;
|
||||
|
||||
if( header == h_200 && request.role == Request::authorizer && request.is_item && request.item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
if( header == h_200 && cur.request->role == Request::authorizer && cur.request->is_item && cur.request->item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
// if there is an item and the item has 'file' storage we do not send a content
|
||||
return false;
|
||||
|
||||
|
@ -650,7 +662,7 @@ bool App::CanSendContent(Header header)
|
|||
we don't have to check the HEAD method
|
||||
the server (lighttpd) doesn't send the body of its own
|
||||
*/
|
||||
if( request.method == Request::head )
|
||||
if( cur.request->method == Request::head )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -661,10 +673,10 @@ void App::AddDebugInfo(std::wstring & out)
|
|||
{
|
||||
if( config.debug_info )
|
||||
{
|
||||
if( !request.debug.Empty() )
|
||||
if( !cur.request->debug.Empty() )
|
||||
{
|
||||
out += L"\n<!--\n";
|
||||
out += request.debug.Str();
|
||||
out += cur.request->debug.Str();
|
||||
out += L"\n-->\n";
|
||||
}
|
||||
}
|
||||
|
@ -674,10 +686,10 @@ void App::AddDebugInfo(std::wstring & out)
|
|||
|
||||
void App::SendAnswer()
|
||||
{
|
||||
const std::wstring & source = request.page.Str();
|
||||
const std::wstring & source = cur.request->page.Str();
|
||||
Header header = h_200;
|
||||
bool compressing = IsCompressionAllowed(source);
|
||||
Error status = request.status;
|
||||
Error status = cur.request->status;
|
||||
|
||||
if( status == WINIX_ERR_NO_ITEM || status == WINIX_ERR_NO_FUNCTION || status == WINIX_ERR_UNKNOWN_PARAM )
|
||||
header = h_404;
|
||||
|
@ -964,7 +976,7 @@ void App::WaitForThreads()
|
|||
//pthread_join(signal_thread, 0);
|
||||
|
||||
system.notify.WaitForThread();
|
||||
session_manager.WaitForGC();
|
||||
session_manager.WaitForThread();
|
||||
system.thumb.WaitForThread();
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1012,7 @@ sigset_t set;
|
|||
FCGX_ShutdownPending();
|
||||
Ezc::WideToUTF8(app->config.base_url, app->url_to_fetch_on_exit);
|
||||
app->system.notify.PrepareToStopThread();
|
||||
app->session_manager.PrepareToStopGC();
|
||||
app->session_manager.WakeUpThread();
|
||||
app->system.thumb.WakeUpThread();
|
||||
app->Unlock();
|
||||
|
||||
|
@ -1033,7 +1045,7 @@ sigset_t set;
|
|||
system.notify.StartThread();
|
||||
|
||||
// gc for sessions
|
||||
session_manager.StartGC();
|
||||
session_manager.StartThread();
|
||||
|
||||
// thumbnails
|
||||
system.thumb.StartThread();
|
||||
|
|
11
core/app.h
11
core/app.h
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreapp
|
||||
#define headerfilecmslucoreapp
|
||||
#ifndef headerfile_winix_core_app
|
||||
#define headerfile_winix_core_app
|
||||
|
||||
#include <iostream>
|
||||
#include <ctime>
|
||||
|
@ -63,8 +63,12 @@ public:
|
|||
// configuration read from a config file
|
||||
Config config;
|
||||
|
||||
// pointers to the current request and a session
|
||||
Cur cur;
|
||||
|
||||
// temporary one request object
|
||||
// current request
|
||||
Request request;
|
||||
Request req;
|
||||
|
||||
// users sessions
|
||||
SessionManager session_manager;
|
||||
|
@ -127,6 +131,7 @@ private:
|
|||
Synchro synchro;
|
||||
pthread_t signal_thread;
|
||||
std::string url_to_fetch_on_exit;
|
||||
|
||||
|
||||
void ProcessRequestThrow();
|
||||
void ProcessRequest();
|
||||
|
|
|
@ -145,6 +145,9 @@ bool BaseThread::WaitForSignalSleep(time_t second)
|
|||
timespec t;
|
||||
int res;
|
||||
|
||||
if( synchro->was_stop_signal )
|
||||
return true;
|
||||
|
||||
t.tv_sec = time(0) + second;
|
||||
t.tv_nsec = 0;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorebasethread
|
||||
#define headerfilecmslucorebasethread
|
||||
#ifndef headerfile_winix_core_basethread
|
||||
#define headerfile_winix_core_basethread
|
||||
|
||||
#include <pthread.h>
|
||||
#include "synchro.h"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorebbcodeparser
|
||||
#define headerfilecmslucorebbcodeparser
|
||||
#ifndef headerfile_winix_core_bbcodeparser
|
||||
#define headerfile_winix_core_bbcodeparser
|
||||
|
||||
#include "htmlfilter.h"
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorecompress
|
||||
#define headerfilecmslucorecompress
|
||||
#ifndef headerfile_winix_core_compress
|
||||
#define headerfile_winix_core_compress
|
||||
|
||||
#include <cstring>
|
||||
#include <fcgiapp.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreconfig
|
||||
#define headerfilecmslucoreconfig
|
||||
#ifndef headerfile_winix_core_config
|
||||
#define headerfile_winix_core_config
|
||||
|
||||
#include <string>
|
||||
#include "confparser.h"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorecookieparser
|
||||
#define headerfilecmslucorecookieparser
|
||||
#ifndef headerfile_winix_core_cookieparser
|
||||
#define headerfile_winix_core_cookieparser
|
||||
|
||||
#include <fcgiapp.h>
|
||||
#include "httpsimpleparser.h"
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2010, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_core_cur
|
||||
#define headerfile_winix_core_cur
|
||||
|
||||
#include "request.h"
|
||||
#include "session.h"
|
||||
|
||||
|
||||
/*
|
||||
current request and session
|
||||
*/
|
||||
struct Cur
|
||||
{
|
||||
Request * request;
|
||||
Session * session;
|
||||
|
||||
// those pointers are never null, if there is no a session for the user
|
||||
// the 'session' pointer pointers at a special temporary session
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoredircontainer
|
||||
#define headerfilecmslucoredircontainer
|
||||
#ifndef headerfile_winix_core_dircontainer
|
||||
#define headerfile_winix_core_dircontainer
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
|
|
@ -19,9 +19,9 @@ void Dirs::SetDb(Db * pdb)
|
|||
}
|
||||
|
||||
|
||||
void Dirs::SetRequest(Request * prequest)
|
||||
void Dirs::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -603,8 +603,8 @@ Error Dirs::AddDirectory(Item & item, bool add_to_dir_tab, Item ** pdir, int not
|
|||
{
|
||||
Item * d = AddDir(item);
|
||||
|
||||
if( add_to_dir_tab && !request->dir_tab.empty() && request->dir_tab.back()->id == item.parent_id )
|
||||
request->dir_tab.push_back(d);
|
||||
if( add_to_dir_tab && !cur->request->dir_tab.empty() && cur->request->dir_tab.back()->id == item.parent_id )
|
||||
cur->request->dir_tab.push_back(d);
|
||||
|
||||
if( pdir )
|
||||
*pdir = d;
|
||||
|
|
10
core/dirs.h
10
core/dirs.h
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoredirs
|
||||
#define headerfilecmslucoredirs
|
||||
#ifndef headerfile_winix_core_dirs
|
||||
#define headerfile_winix_core_dirs
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
@ -32,7 +32,7 @@ public:
|
|||
void Clear();
|
||||
void ReadDirs();
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetDb(Db * pdb);
|
||||
void SetNotify(Notify * pnotify);
|
||||
|
||||
|
@ -79,8 +79,8 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
Request * request;
|
||||
Db * db;
|
||||
Cur * cur;
|
||||
Db * db;
|
||||
Notify * notify;
|
||||
|
||||
DirContainer dir_tab;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreerror
|
||||
#define headerfilecmslucoreerror
|
||||
#ifndef headerfile_winix_core_error
|
||||
#define headerfile_winix_core_error
|
||||
|
||||
#include <iostream>
|
||||
#include "log.h"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoregetparser
|
||||
#define headerfilecmslucoregetparser
|
||||
#ifndef headerfile_winix_core_getparser
|
||||
#define headerfile_winix_core_getparser
|
||||
|
||||
#include "httpsimpleparser.h"
|
||||
#include "requesttypes.h"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoregroup
|
||||
#define headerfilecmslucoregroup
|
||||
#ifndef headerfile_winix_core_group
|
||||
#define headerfile_winix_core_group
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoregroups
|
||||
#define headerfilecmslucoregroups
|
||||
#ifndef headerfile_winix_core_groups
|
||||
#define headerfile_winix_core_groups
|
||||
|
||||
#include <map>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorehtmlfilter
|
||||
#define headerfilecmslucorehtmlfilter
|
||||
#ifndef headerfile_winix_core_htmlfilter
|
||||
#define headerfile_winix_core_htmlfilter
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorehttpsimpleparser
|
||||
#define headerfilecmslucorehttpsimpleparser
|
||||
#ifndef headerfile_winix_core_httpsimpleparser
|
||||
#define headerfile_winix_core_httpsimpleparser
|
||||
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreitem
|
||||
#define headerfilecmslucoreitem
|
||||
#ifndef headerfile_winix_core_item
|
||||
#define headerfile_winix_core_item
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ LastTab::iterator i = FindNotLoggedOut(user_id, session_id);
|
|||
return;
|
||||
}
|
||||
|
||||
if( last_tab.size() >= LAST_TABLE_SIZE ) // last_tab has O(n) complexity
|
||||
if( last_tab.size() >= WINIX_LASTCONTAINER_TABLE_SIZE ) // last_tab has O(n) complexity
|
||||
last_tab.erase(last_tab.begin());
|
||||
|
||||
LastItem li;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorelastcontainer
|
||||
#define headerfilecmslucorelastcontainer
|
||||
#ifndef headerfile_winix_core_lastcontainer
|
||||
#define headerfile_winix_core_lastcontainer
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
|
||||
// how many items we store in the 'last' function
|
||||
#define LAST_TABLE_SIZE 100
|
||||
#define WINIX_LASTCONTAINER_TABLE_SIZE 100
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreloadavg
|
||||
#define headerfilecmslucoreloadavg
|
||||
#ifndef headerfile_winix_core_loadavg
|
||||
#define headerfile_winix_core_loadavg
|
||||
|
||||
#include <ctime>
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorelog
|
||||
#define headerfilecmslucorelog
|
||||
#ifndef headerfile_winix_core_log
|
||||
#define headerfile_winix_core_log
|
||||
|
||||
|
||||
#include <sstream>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoremisc
|
||||
#define headerfilecmslucoremisc
|
||||
#ifndef headerfile_winix_core_misc
|
||||
#define headerfile_winix_core_misc
|
||||
|
||||
|
||||
#include <string>
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef headerfilecmslucoremount
|
||||
#define headerfilecmslucoremount
|
||||
#ifndef headerfile_winix_core_mount
|
||||
#define headerfile_winix_core_mount
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoremountparser
|
||||
#define headerfilecmslucoremountparser
|
||||
#ifndef headerfile_winix_core_mountparser
|
||||
#define headerfile_winix_core_mountparser
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
|
|
@ -73,9 +73,9 @@ void Mounts::SetDb(Db * pdb)
|
|||
db = pdb;
|
||||
}
|
||||
|
||||
void Mounts::SetRequest(Request * prequest)
|
||||
void Mounts::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -252,10 +252,10 @@ std::vector<Item*>::reverse_iterator i;
|
|||
|
||||
// when the program starts (when the dir_tab is empty()
|
||||
// we don't want to call MountCmsForRoot()
|
||||
if( request->dir_tab.empty() )
|
||||
if( cur->request->dir_tab.empty() )
|
||||
return;
|
||||
|
||||
for(i = request->dir_tab.rbegin() ; i!=request->dir_tab.rend() ; ++i)
|
||||
for(i = cur->request->dir_tab.rbegin() ; i!=cur->request->dir_tab.rend() ; ++i)
|
||||
{
|
||||
std::map<long, Mount>::iterator m = mount_tab.find( (*i)->id );
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifndef headerfilecmslucorecoremounts
|
||||
#define headerfilecmslucorecoremounts
|
||||
#ifndef headerfile_winix_core_mounts
|
||||
#define headerfile_winix_core_mounts
|
||||
|
||||
|
||||
#include <map>
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
void SetDirs(Dirs * pdirs);
|
||||
void SetDb(Db * pdb);
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
|
||||
// dir_id, mount_point
|
||||
typedef std::map<long, Mount> MountTab;
|
||||
|
@ -97,9 +97,9 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
Db * db;
|
||||
Db * db;
|
||||
Dirs * dirs;
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
|
||||
Mount empty_mount;
|
||||
const std::wstring empty_str;
|
||||
|
|
|
@ -35,7 +35,7 @@ Plugin::Plugin()
|
|||
|
||||
db = 0;
|
||||
config = 0;
|
||||
request = 0;
|
||||
cur = 0;
|
||||
system = 0;
|
||||
functions = 0;
|
||||
templates = 0;
|
||||
|
@ -64,9 +64,9 @@ void Plugin::SetConfig(Config * pconfig)
|
|||
}
|
||||
|
||||
|
||||
void Plugin::SetRequest(Request * prequest)
|
||||
void Plugin::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,14 +105,14 @@ void Plugin::SetSessionManager(SessionManager * psession_manager)
|
|||
bool Plugin::SetPointers(PluginInfo & info)
|
||||
{
|
||||
// for safety we call a plugin function only when all our pointers are not null
|
||||
bool res = (db && config && request && system && functions && templates && synchro && session_manager);
|
||||
bool res = (db && config && cur && system && functions && templates && synchro && session_manager);
|
||||
|
||||
if( !res )
|
||||
log << log1 << "Plugin: cannot call a function - some of the winix pointers are null" << logend;
|
||||
|
||||
info.db = db;
|
||||
info.config = config;
|
||||
info.request = request;
|
||||
info.cur = cur;
|
||||
info.system = system;
|
||||
info.functions = functions;
|
||||
info.templates = templates;
|
||||
|
@ -252,8 +252,8 @@ void Plugin::Call(int message, Slots::iterator & slot)
|
|||
current_plugin = slot->second.index;
|
||||
info.plugin_id = current_plugin;
|
||||
|
||||
if( request && request->session && current_plugin != -1 )
|
||||
info.plugin_data_base = request->session->plugin_data.Get(current_plugin);
|
||||
if( current_plugin != -1 )
|
||||
info.plugin_data_base = cur->session->plugin_data.Get(current_plugin);
|
||||
else
|
||||
info.plugin_data_base = 0;
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ struct PluginInfo
|
|||
// objects from winix which are accessible from a plugin
|
||||
Db * db;
|
||||
Config * config;
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
|
@ -130,7 +130,7 @@ public:
|
|||
|
||||
void SetDb(Db * pdb);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetSystem(System * psystem);
|
||||
void SetFunctions(Functions * pfunctions);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
|
@ -178,7 +178,7 @@ private:
|
|||
|
||||
Db * db;
|
||||
Config * config;
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreplugindata
|
||||
#define headerfilecmslucoreplugindata
|
||||
#ifndef headerfile_winix_core_plugindata
|
||||
#define headerfile_winix_core_plugindata
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#define WINIX_SESSION_CHANGED 3002
|
||||
|
||||
// the winix is closing
|
||||
// the is not any session available (request->session is null)
|
||||
// the is not any session available (cur->session is null)
|
||||
#define WINIX_CLOSE 3004
|
||||
|
||||
// item was removed (rm function)
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorepostmultiparser
|
||||
#define headerfilecmslucorepostmultiparser
|
||||
#ifndef headerfile_winix_core_postmultiparser
|
||||
#define headerfile_winix_core_postmultiparser
|
||||
|
||||
#include <string>
|
||||
#include <fcgiapp.h>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorepostparser
|
||||
#define headerfilecmslucorepostparser
|
||||
#ifndef headerfile_winix_core_postparser
|
||||
#define headerfile_winix_core_postparser
|
||||
|
||||
#include <fcgiapp.h>
|
||||
#include <string>
|
||||
|
|
|
@ -12,13 +12,13 @@
|
|||
#include "log.h"
|
||||
#include "rebus.h"
|
||||
#include "misc.h"
|
||||
#include "request.h"
|
||||
#include "cur.h"
|
||||
|
||||
|
||||
|
||||
void Rebus::SetRequest(Request * prequest)
|
||||
void Rebus::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,29 +128,29 @@ return result;
|
|||
|
||||
bool Rebus::CheckRebus()
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
return false;
|
||||
|
||||
if( request->session->puser )
|
||||
if( cur->session->puser )
|
||||
// logged users don't have to use the rebus
|
||||
return true;
|
||||
|
||||
if( request->session->rebus_checked )
|
||||
if( cur->session->rebus_checked )
|
||||
return true;
|
||||
|
||||
request->session->rebus_checked = true;
|
||||
cur->session->rebus_checked = true;
|
||||
|
||||
if( !request->session->rebus_item )
|
||||
if( !cur->session->rebus_item )
|
||||
{
|
||||
log << log1 << "Rebus: rebus not set" << logend;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( IsAnswerOk(request->session->rebus_item, request->PostVar(L"rebus")) )
|
||||
if( IsAnswerOk(cur->session->rebus_item, cur->request->PostVar(L"rebus")) )
|
||||
return true;
|
||||
|
||||
log << log1 << "Rebus: rebus has an incorrect answer" << logend;
|
||||
// don't add request->session->spam_score when the rebus has incorrect answer
|
||||
// don't add cur->session->spam_score when the rebus has incorrect answer
|
||||
// a user could have made a mistake
|
||||
|
||||
return false;
|
||||
|
|
10
core/rebus.h
10
core/rebus.h
|
@ -7,15 +7,15 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorerebus
|
||||
#define headerfilecmslucorerebus
|
||||
#ifndef headerfile_winix_core_rebus
|
||||
#define headerfile_winix_core_rebus
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class Request;
|
||||
struct Cur;
|
||||
|
||||
|
||||
class Rebus
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void Init();
|
||||
Item * Rand();
|
||||
bool IsAnswerOk(Item * item, const std::wstring & answer);
|
||||
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
private:
|
||||
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
|
||||
bool InitPair(int a, int b, Item & item);
|
||||
|
||||
|
|
|
@ -78,10 +78,6 @@ void Request::Clear()
|
|||
env_content_type = &char_empty;
|
||||
env_http_accept_encoding = &char_empty;
|
||||
|
||||
temporary_session.Clear();
|
||||
temporary_session.id = 0;
|
||||
session = &temporary_session;
|
||||
|
||||
item_tab.clear();
|
||||
item.Clear();
|
||||
dir_tab.clear();
|
||||
|
|
|
@ -7,14 +7,13 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorerequest
|
||||
#define headerfilecmslucorerequest
|
||||
#ifndef headerfile_winix_core_request
|
||||
#define headerfile_winix_core_request
|
||||
|
||||
#include <fcgiapp.h>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include "requesttypes.h"
|
||||
#include "session.h"
|
||||
#include "item.h"
|
||||
#include "error.h"
|
||||
#include "config.h"
|
||||
|
@ -69,9 +68,6 @@ struct Request
|
|||
// true if the browser is Konqueror
|
||||
bool browser_konqueror;
|
||||
|
||||
// current session
|
||||
Session * session;
|
||||
|
||||
// current directory
|
||||
std::vector<Item*> dir_tab;
|
||||
|
||||
|
@ -138,9 +134,6 @@ private:
|
|||
|
||||
Config * config;
|
||||
|
||||
// session with id 0
|
||||
Session temporary_session;
|
||||
|
||||
void ClearPostFileTmp();
|
||||
|
||||
// contains '\0'
|
||||
|
|
|
@ -7,15 +7,17 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorerequesttypes
|
||||
#define headerfilecmslucorerequesttypes
|
||||
#ifndef headerfile_winix_core_requesttypes
|
||||
#define headerfile_winix_core_requesttypes
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
|
||||
#define WINIX_POSTTABLE_MAXSIZE 20
|
||||
// !! narazie uzywane tylko w post multi parserze
|
||||
// dodac do zwyklego parsera post
|
||||
#define WINIX_POSTTABLE_MAXSIZE 50
|
||||
|
||||
|
||||
struct PostFile
|
||||
|
|
|
@ -30,14 +30,15 @@ Session::Session()
|
|||
|
||||
void Session::Clear()
|
||||
{
|
||||
id = 0;
|
||||
time = 0;
|
||||
puser = 0;
|
||||
rebus_item = 0;
|
||||
id = 0;
|
||||
time = 0;
|
||||
puser = 0;
|
||||
rebus_item = 0;
|
||||
rebus_checked = false;
|
||||
remember_me = false;
|
||||
new_session = true;
|
||||
spam_score = 0;
|
||||
remember_me = false;
|
||||
new_session = true;
|
||||
spam_score = 0;
|
||||
plugin_data.Resize(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresession
|
||||
#define headerfilecmslucoresession
|
||||
#ifndef headerfile_winix_core_session
|
||||
#define headerfile_winix_core_session
|
||||
|
||||
#include <ctime>
|
||||
#include "item.h"
|
||||
|
|
|
@ -15,17 +15,13 @@
|
|||
|
||||
SessionContainer::SessionContainer()
|
||||
{
|
||||
request = 0;
|
||||
table_size = 0;
|
||||
work_mode = 1; // threading work mode
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void SessionContainer::SetRequest(Request * prequest)
|
||||
void SessionContainer::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,32 +31,55 @@ void SessionContainer::SetConfig(Config * pconfig)
|
|||
}
|
||||
|
||||
|
||||
void SessionContainer::SetTmpSession(Session * psession)
|
||||
{
|
||||
tmp_session = psession;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SessionContainer::Clear()
|
||||
{
|
||||
Table::iterator i = table.begin();
|
||||
|
||||
log << log3 << "SC: deleting all sessions" << logend;
|
||||
|
||||
// don't use table.clear();
|
||||
// because plugins session data would not be erased
|
||||
// we must set cur->session for each session and then delete it
|
||||
while( i != table.end() )
|
||||
{
|
||||
request->session = &(*i);
|
||||
cur->session = &(*i);
|
||||
table.erase(i++);
|
||||
}
|
||||
|
||||
// erasing indexes
|
||||
index_id.clear();
|
||||
table_size = 0;
|
||||
request->session = 0;
|
||||
cur->session = tmp_session;
|
||||
}
|
||||
|
||||
|
||||
void SessionContainer::SetLastContainer(LastContainer * plast_container)
|
||||
|
||||
void SessionContainer::EraseById(IdIterator i)
|
||||
{
|
||||
last_container = plast_container;
|
||||
Session * old_session = tmp_session;
|
||||
|
||||
if( cur->session != &(*i->second) )
|
||||
old_session = cur->session;
|
||||
|
||||
cur->session = &(*i->second);
|
||||
|
||||
log << log4 << "SC: deleting session, id: " << i->second->id << logend;
|
||||
table.erase(i->second);
|
||||
index_id.erase(i);
|
||||
table_size -= 1;
|
||||
|
||||
cur->session = old_session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t SessionContainer::Size()
|
||||
{
|
||||
// don't use table.size() as it has O(n) complexity on FreeBSD
|
||||
|
@ -86,6 +105,18 @@ Session & SessionContainer::Back()
|
|||
}
|
||||
|
||||
|
||||
SessionContainer::IdIterator SessionContainer::IdBegin()
|
||||
{
|
||||
return index_id.begin();
|
||||
}
|
||||
|
||||
|
||||
SessionContainer::IdIterator SessionContainer::IdEnd()
|
||||
{
|
||||
return index_id.end();
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool SessionContainer::PushBack(const Session & session)
|
||||
{
|
||||
|
@ -128,93 +159,3 @@ return i->second;
|
|||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* sessions gc (another thread)
|
||||
*
|
||||
*
|
||||
*/
|
||||
void SessionContainer::Work()
|
||||
{
|
||||
bool exit = false;
|
||||
IndexId::iterator i;
|
||||
|
||||
Lock();
|
||||
i = index_id.begin();
|
||||
Unlock();
|
||||
|
||||
while( !exit )
|
||||
{
|
||||
Lock();
|
||||
|
||||
if( i == index_id.end() )
|
||||
{
|
||||
i = index_id.begin();
|
||||
WaitForSignalSleep(10);
|
||||
//WaitForSignalSleep(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IsSessionOutdated(*i->second) )
|
||||
DeleteSession(i++);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
|
||||
exit = synchro->was_stop_signal;
|
||||
Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// it's called from the other thread (with Lock and Unlock)
|
||||
bool SessionContainer::IsSessionOutdated(const Session & s) const
|
||||
{
|
||||
bool outdated;
|
||||
|
||||
if( s.remember_me )
|
||||
outdated = s.last_time < std::time(0) - config->session_remember_max_idle;
|
||||
else
|
||||
outdated = s.last_time < std::time(0) - config->session_max_idle;
|
||||
|
||||
return outdated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// it's called from the other thread (with Lock and Unlock)
|
||||
void SessionContainer::DeleteSession(SessionContainer::IndexId::iterator i)
|
||||
{
|
||||
Session * old_session = 0;
|
||||
Session * del_session = &(*i->second);
|
||||
|
||||
if( del_session != request->session )
|
||||
old_session = request->session;
|
||||
|
||||
request->session = del_session;
|
||||
|
||||
log << log4 << "SessionContainer: deleting outdated session, id: " << del_session->id << logend;
|
||||
|
||||
if( del_session->puser )
|
||||
last_container->UserLogout(del_session->puser->id, del_session->id);
|
||||
|
||||
table.erase(i->second);
|
||||
index_id.erase(i);
|
||||
table_size -= 1;
|
||||
|
||||
// !! tu moze byc zero
|
||||
request->session = old_session;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* end of sessions gc
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,22 +7,20 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresessioncontainer
|
||||
#define headerfilecmslucoresessioncontainer
|
||||
#ifndef headerfile_winix_core_sessioncontainer
|
||||
#define headerfile_winix_core_sessioncontainer
|
||||
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <ctime>
|
||||
|
||||
#include "session.h"
|
||||
#include "lastcontainer.h"
|
||||
#include "request.h"
|
||||
#include "basethread.h"
|
||||
#include "cur.h"
|
||||
#include "config.h"
|
||||
|
||||
|
||||
|
||||
class SessionContainer : public BaseThread
|
||||
class SessionContainer
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -33,13 +31,14 @@ public:
|
|||
typedef std::list<Session> Table;
|
||||
typedef Table::iterator Iterator;
|
||||
typedef std::map<long, Iterator> IndexId;
|
||||
typedef IndexId::iterator IdIterator;
|
||||
|
||||
|
||||
SessionContainer();
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetLastContainer(LastContainer * plast_container);
|
||||
void SetTmpSession(Session * psession);
|
||||
|
||||
void Clear();
|
||||
|
||||
|
@ -50,20 +49,19 @@ public:
|
|||
bool PushBack(const Session & session);
|
||||
Iterator FindById(long);
|
||||
|
||||
IdIterator IdBegin();
|
||||
IdIterator IdEnd();
|
||||
|
||||
void EraseById(IdIterator i);
|
||||
|
||||
private:
|
||||
|
||||
LastContainer * last_container;
|
||||
|
||||
Table table;
|
||||
IndexId index_id;
|
||||
|
||||
Request * request;
|
||||
Config * config;
|
||||
//void DelFromIdIndex(Iterator iter);
|
||||
virtual void Work();
|
||||
bool IsSessionOutdated(const Session & s) const;
|
||||
void DeleteSession(IndexId::iterator i);
|
||||
Cur * cur;
|
||||
Config * config;
|
||||
Session * tmp_session;
|
||||
|
||||
// in FreeBSD implementation (GCC) list::size() has linear complexity
|
||||
// so we use our own table_size with O(1)
|
||||
|
|
|
@ -22,13 +22,19 @@
|
|||
|
||||
SessionManager::SessionManager()
|
||||
{
|
||||
temporary_session.id = 0;
|
||||
session = &temporary_session;
|
||||
session_tab.SetTmpSession(&temporary_session);
|
||||
|
||||
// thread work mode
|
||||
work_mode = 1;
|
||||
}
|
||||
|
||||
|
||||
void SessionManager::SetRequest(Request * prequest)
|
||||
void SessionManager::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
session_tab.SetRequest(prequest);
|
||||
cur = pcur;
|
||||
session_tab.SetCur(pcur);
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,17 +50,13 @@ void SessionManager::SetSystem(System * psystem)
|
|||
system = psystem;
|
||||
}
|
||||
|
||||
|
||||
void SessionManager::SetLastContainer(LastContainer * plast_container)
|
||||
{
|
||||
session_tab.SetLastContainer(plast_container);
|
||||
last_container = plast_container;
|
||||
}
|
||||
|
||||
|
||||
void SessionManager::SetSynchro(Synchro * psynchro)
|
||||
{
|
||||
session_tab.SetSynchro(psynchro);
|
||||
}
|
||||
|
||||
|
||||
size_t SessionManager::Size()
|
||||
{
|
||||
|
@ -103,52 +105,20 @@ return id;
|
|||
|
||||
|
||||
|
||||
void SessionManager::CreateTemporarySession()
|
||||
{
|
||||
SessionContainer::Iterator i = session_tab.FindById( 0 );
|
||||
|
||||
if( i == session_tab.End() )
|
||||
{
|
||||
Session s;
|
||||
s.id = 0;
|
||||
s.new_session = true;
|
||||
|
||||
session_tab.PushBack(s);
|
||||
request->session = &session_tab.Back();
|
||||
}
|
||||
else
|
||||
{
|
||||
request->session = &(*i);
|
||||
request->session->Clear(); // !! what about session.plugin_data?
|
||||
request->session->id = 0;
|
||||
request->session->new_session = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SessionManager::CreateSession()
|
||||
{
|
||||
Session s;
|
||||
int attempts = 100;
|
||||
int attempts = 100;
|
||||
bool added = false;
|
||||
|
||||
if( config->session_max == 0 || session_tab.Size() < config->session_max - 1 ) // -1 for the temporary session
|
||||
new_session.Clear();
|
||||
|
||||
if( config->session_max == 0 || session_tab.Size() < config->session_max )
|
||||
{
|
||||
for( ; attempts > 0 ; --attempts )
|
||||
for( ; !added && attempts > 0 ; --attempts )
|
||||
{
|
||||
s.id = CreateSessionId();
|
||||
|
||||
bool added = session_tab.PushBack(s);
|
||||
|
||||
if( added )
|
||||
{
|
||||
request->session = &session_tab.Back();
|
||||
request->session->new_session = true;
|
||||
|
||||
log << log2 << "SM: created a new session: " << request->session->id << logend;
|
||||
|
||||
return;
|
||||
}
|
||||
new_session.id = CreateSessionId();
|
||||
added = session_tab.PushBack(new_session);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -156,10 +126,21 @@ int attempts = 100;
|
|||
log << log2 << "SM: sessions limit exceeded (" << config->session_max << ")" << logend;
|
||||
}
|
||||
|
||||
// there is a problem with generating a new session id
|
||||
// we do not set a session cookie
|
||||
CreateTemporarySession();
|
||||
log << log1 << "SM: cannot create a session id (temporary used: with id 0)" << logend;
|
||||
if( added )
|
||||
{
|
||||
session = &session_tab.Back();
|
||||
session->new_session = true;
|
||||
log << log2 << "SM: created a new session: " << session->id << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
// there is a problem with generating a new session id
|
||||
// we do not set a session cookie
|
||||
session = &temporary_session;
|
||||
session->Clear();
|
||||
session->new_session = false; // temporary session was initialized at the beginning
|
||||
log << log1 << "SM: cannot create a session id (temporary used: with id 0)" << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,18 +155,18 @@ bool SessionManager::SetSessionFromCookie(const std::string & cookie)
|
|||
return false;
|
||||
|
||||
// that session is in the table
|
||||
request->session = &(*s);
|
||||
request->session->new_session = false;
|
||||
request->session->last_time = std::time(0);
|
||||
request->session->tm_last_time = Time(request->session->last_time);
|
||||
session = &(*s);
|
||||
session->new_session = false;
|
||||
session->last_time = std::time(0);
|
||||
session->tm_last_time = Time(session->last_time);
|
||||
|
||||
if( request->method == Request::get )
|
||||
request->session->last_time_get = request->session->last_time;
|
||||
if( cur->request->method == Request::get )
|
||||
session->last_time_get = session->last_time;
|
||||
|
||||
log << log2 << "SM: session: " << s->id;
|
||||
log << log2 << "SM: session: " << session->id;
|
||||
|
||||
if( request->session->puser )
|
||||
log << log2 << ", user: " << request->session->puser->name << ", id: " << request->session->puser->id;
|
||||
if( session->puser )
|
||||
log << log2 << ", user: " << session->puser->name << ", id: " << session->puser->id;
|
||||
|
||||
log << log2 << logend;
|
||||
|
||||
|
@ -196,9 +177,9 @@ return true;
|
|||
|
||||
void SessionManager::SetSession()
|
||||
{
|
||||
CookieTab::iterator i = request->cookie_tab.find(config->http_session_id_name);
|
||||
CookieTab::iterator i = cur->request->cookie_tab.find(config->http_session_id_name);
|
||||
|
||||
if( i == request->cookie_tab.end() )
|
||||
if( i == cur->request->cookie_tab.end() )
|
||||
{
|
||||
CreateSession();
|
||||
}
|
||||
|
@ -208,22 +189,12 @@ void SessionManager::SetSession()
|
|||
{
|
||||
// there is no such a session
|
||||
// deleting the old cookie
|
||||
request->cookie_tab.erase(i);
|
||||
cur->request->cookie_tab.erase(i);
|
||||
|
||||
// and creating a new one
|
||||
CreateSession();
|
||||
}
|
||||
}
|
||||
|
||||
// request->session is set now
|
||||
|
||||
if( request->session->new_session )
|
||||
{
|
||||
request->session->plugin_data.Resize(plugin.Size());
|
||||
plugin.Call(WINIX_SESSION_CREATED);
|
||||
}
|
||||
|
||||
plugin.Call(WINIX_SESSION_CHANGED);
|
||||
}
|
||||
|
||||
|
||||
|
@ -252,6 +223,31 @@ void SessionManager::DeleteSessions()
|
|||
|
||||
|
||||
|
||||
void SessionManager::InitTmpSession()
|
||||
{
|
||||
Session * old_session = cur->session;
|
||||
|
||||
log << log4 << "SM: initializing temporary session" << logend;
|
||||
cur->session = &temporary_session;
|
||||
plugin.Call(WINIX_SESSION_CREATED);
|
||||
|
||||
cur->session = old_session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SessionManager::UninitTmpSession()
|
||||
{
|
||||
Session * old_session = cur->session;
|
||||
|
||||
log << log4 << "SM: uninitializing temporary session" << logend;
|
||||
cur->session = &temporary_session;
|
||||
cur->session->plugin_data.DeleteAll(); // this will call plugin.Call(WINIX_SESSION_REMOVE);
|
||||
cur->session->plugin_data.Resize(0);
|
||||
|
||||
cur->session = old_session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SessionManager::LoadSessions()
|
||||
|
@ -259,20 +255,20 @@ void SessionManager::LoadSessions()
|
|||
SessionParser sp;
|
||||
SessionContainer::Iterator i;
|
||||
|
||||
// sessions will be overwritten (pointers are invalidated)
|
||||
cur->session = &temporary_session;
|
||||
|
||||
sp.SetUsers(&system->users);
|
||||
Session * old_session = request->session;
|
||||
|
||||
sp.Parse(config->session_file, session_tab);
|
||||
i = session_tab.Begin();
|
||||
|
||||
for( ; i!=session_tab.End() ; ++i )
|
||||
for(i=session_tab.Begin() ; i != session_tab.End() ; ++i)
|
||||
{
|
||||
i->plugin_data.Resize(plugin.Size());
|
||||
request->session = &(*i);
|
||||
cur->session = &(*i);
|
||||
plugin.Call(WINIX_SESSION_CREATED);
|
||||
}
|
||||
|
||||
request->session = old_session;
|
||||
cur->session = &temporary_session;
|
||||
}
|
||||
|
||||
|
||||
|
@ -316,24 +312,125 @@ void SessionManager::SaveSessions()
|
|||
|
||||
|
||||
|
||||
void SessionManager::StartGC()
|
||||
|
||||
Session * SessionManager::GetTmpSession()
|
||||
{
|
||||
session_tab.StartThread();
|
||||
return &temporary_session;
|
||||
}
|
||||
|
||||
|
||||
// use it with Lock() and Unlock();
|
||||
void SessionManager::PrepareToStopGC()
|
||||
Session * SessionManager::GetCurSession()
|
||||
{
|
||||
session_tab.WakeUpThread();
|
||||
}
|
||||
|
||||
|
||||
void SessionManager::WaitForGC()
|
||||
{
|
||||
session_tab.WaitForThread();
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* sessions gc (second thread)
|
||||
*
|
||||
*
|
||||
*/
|
||||
void SessionManager::Work()
|
||||
{
|
||||
bool exit = false;
|
||||
SessionContainer::IndexId::iterator i;
|
||||
|
||||
deleted = 0;
|
||||
|
||||
Lock();
|
||||
i = session_tab.IdBegin();
|
||||
Unlock();
|
||||
|
||||
while( !exit )
|
||||
{
|
||||
Lock();
|
||||
|
||||
CheckSession(i);
|
||||
exit = synchro->was_stop_signal;
|
||||
|
||||
Unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// it's called from the other thread (with Lock and Unlock)
|
||||
void SessionManager::CheckSession(SessionContainer::IndexId::iterator & i)
|
||||
{
|
||||
const int deleted_max_at_once = 10;
|
||||
|
||||
if( i == session_tab.IdEnd() )
|
||||
{
|
||||
if( deleted > 0 )
|
||||
{
|
||||
deleted = 0;
|
||||
log << logsave;
|
||||
}
|
||||
|
||||
i = session_tab.IdBegin();
|
||||
WaitForSignalSleep(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( IsSessionOutdated(*i->second) )
|
||||
{
|
||||
DeleteSession(i++);
|
||||
++deleted;
|
||||
}
|
||||
else
|
||||
{
|
||||
++i;
|
||||
}
|
||||
|
||||
if( deleted >= deleted_max_at_once )
|
||||
{
|
||||
log << logsave;
|
||||
WaitForSignalSleep(1);
|
||||
deleted = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// it's called from the other thread (with Lock and Unlock)
|
||||
bool SessionManager::IsSessionOutdated(const Session & s) const
|
||||
{
|
||||
bool outdated;
|
||||
|
||||
if( s.remember_me )
|
||||
outdated = s.last_time < std::time(0) - config->session_remember_max_idle;
|
||||
else
|
||||
outdated = s.last_time < std::time(0) - config->session_max_idle;
|
||||
|
||||
return outdated;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// it's called from the other thread (with Lock and Unlock)
|
||||
void SessionManager::DeleteSession(SessionContainer::IdIterator i)
|
||||
{
|
||||
Session * del_session = &(*i->second);
|
||||
|
||||
if( del_session->puser )
|
||||
last_container->UserLogout(del_session->puser->id, del_session->id);
|
||||
|
||||
session_tab.EraseById(i);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* end of sessions gc
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresessionmanager
|
||||
#define headerfilecmslucoresessionmanager
|
||||
#ifndef headerfile_winix_core_sessionmanager
|
||||
#define headerfile_winix_core_sessionmanager
|
||||
|
||||
#include <set>
|
||||
#include <ctime>
|
||||
|
@ -19,39 +19,29 @@
|
|||
#include "lastcontainer.h"
|
||||
#include "system.h"
|
||||
#include "synchro.h"
|
||||
#include "basethread.h"
|
||||
|
||||
|
||||
|
||||
class SessionManager
|
||||
class SessionManager : public BaseThread
|
||||
{
|
||||
Config * config;
|
||||
Request * request;
|
||||
System * system;
|
||||
|
||||
SessionContainer session_tab;
|
||||
|
||||
bool IsSession(long s);
|
||||
|
||||
long CreateSessionId();
|
||||
void CreateTemporarySession();
|
||||
void CreateSession();
|
||||
bool SetSessionFromCookie(const std::string & cookie);
|
||||
|
||||
public:
|
||||
|
||||
SessionManager();
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetSystem(System * psystem);
|
||||
void SetLastContainer(LastContainer * plast_container);
|
||||
void SetSynchro(Synchro * psynchro);
|
||||
|
||||
void SetSession();
|
||||
void DeleteSessions(); // deleting all sessions
|
||||
void StartGC();
|
||||
void PrepareToStopGC();
|
||||
void WaitForGC();
|
||||
|
||||
void InitTmpSession();
|
||||
void UninitTmpSession();
|
||||
|
||||
Session * GetTmpSession();
|
||||
Session * GetCurSession();
|
||||
|
||||
void LoadSessions();
|
||||
void SaveSessions();
|
||||
|
@ -60,6 +50,40 @@ public:
|
|||
SessionContainer::Iterator SessionEnd();
|
||||
|
||||
size_t Size();
|
||||
|
||||
private:
|
||||
|
||||
Config * config;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
|
||||
LastContainer * last_container;
|
||||
|
||||
// current session - set by SetSession()
|
||||
Session * session;
|
||||
|
||||
SessionContainer session_tab;
|
||||
|
||||
// session with id 0
|
||||
Session temporary_session;
|
||||
|
||||
// for adding a new session to the container
|
||||
Session new_session;
|
||||
|
||||
bool IsSession(long s);
|
||||
|
||||
long CreateSessionId();
|
||||
void CreateSession();
|
||||
bool SetSessionFromCookie(const std::string & cookie);
|
||||
|
||||
|
||||
// second thread
|
||||
int deleted;
|
||||
virtual void Work();
|
||||
void CheckSession(SessionContainer::IndexId::iterator & i);
|
||||
bool IsSessionOutdated(const Session & s) const;
|
||||
void DeleteSession(SessionContainer::IdIterator i);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresessionparser
|
||||
#define headerfilecmslucoresessionparser
|
||||
#ifndef headerfile_winix_core_sessionparser
|
||||
#define headerfile_winix_core_sessionparser
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresynchro
|
||||
#define headerfilecmslucoresynchro
|
||||
#ifndef headerfile_winix_core_synchro
|
||||
#define headerfile_winix_core_synchro
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
|
138
core/system.cpp
138
core/system.cpp
|
@ -15,9 +15,9 @@
|
|||
|
||||
|
||||
|
||||
void System::SetRequest(Request * prequest)
|
||||
void System::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,26 +44,26 @@ void System::SetSynchro(Synchro * psynchro)
|
|||
void System::Init()
|
||||
{
|
||||
dirs.SetDb(db);
|
||||
dirs.SetRequest(request);
|
||||
dirs.SetCur(cur);
|
||||
dirs.SetNotify(¬ify);
|
||||
dirs.ReadDirs();
|
||||
|
||||
mounts.SetDirs(&dirs);
|
||||
mounts.SetDb(db);
|
||||
mounts.SetRequest(request);
|
||||
mounts.SetCur(cur);
|
||||
mounts.CreateMounts();
|
||||
mounts.ReadMounts();
|
||||
|
||||
users.SetRequest(request);
|
||||
users.SetCur(cur);
|
||||
users.ReadUsers(db);
|
||||
users.SetTimeZoneOffset(config->time_zone_offset);
|
||||
groups.ReadGroups(db); // !! chwilowe przekazanie argumentu, db bedzie zmienione
|
||||
|
||||
rebus.SetRequest(request);
|
||||
rebus.SetCur(cur);
|
||||
rebus.Init();
|
||||
|
||||
notify.SetSynchro(synchro);
|
||||
notify.SetRequest(request);
|
||||
notify.SetCur(cur);
|
||||
notify.SetConfig(config);
|
||||
notify.SetUsers(&users);
|
||||
notify.SetDirs(&dirs);
|
||||
|
@ -80,35 +80,35 @@ void System::Init()
|
|||
// !! moze zwracac jakas wartosc?
|
||||
void System::RedirectTo(const Item & item, const wchar_t * postfix)
|
||||
{
|
||||
request->redirect_to = config->base_url;
|
||||
cur->request->redirect_to = config->base_url;
|
||||
|
||||
if( item.type == Item::dir )
|
||||
{
|
||||
// item_id is pointing to a directory
|
||||
dirs.MakePath(item.id, request->redirect_to, false);
|
||||
dirs.MakePath(item.id, cur->request->redirect_to, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 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( dirs.MakePath(item.parent_id, cur->request->redirect_to, false) )
|
||||
cur->request->redirect_to += item.url;
|
||||
}
|
||||
|
||||
if( postfix )
|
||||
request->redirect_to += postfix;
|
||||
cur->request->redirect_to += postfix;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void System::RedirectTo(long item_id, const wchar_t * postfix)
|
||||
{
|
||||
request->redirect_to = config->base_url;
|
||||
cur->request->redirect_to = config->base_url;
|
||||
Item * pdir = dirs.GetDir(item_id);
|
||||
|
||||
if( pdir )
|
||||
{
|
||||
// item_id is pointing to a directory
|
||||
dirs.MakePath(pdir->id, request->redirect_to, false);
|
||||
dirs.MakePath(pdir->id, cur->request->redirect_to, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,8 +122,8 @@ void System::RedirectTo(long item_id, const wchar_t * postfix)
|
|||
|
||||
if( db->GetItem(item_temp, iq) == WINIX_ERR_OK )
|
||||
{
|
||||
if( dirs.MakePath(item_temp.parent_id, request->redirect_to, false) )
|
||||
request->redirect_to += item_temp.url;
|
||||
if( dirs.MakePath(item_temp.parent_id, cur->request->redirect_to, false) )
|
||||
cur->request->redirect_to += item_temp.url;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -132,31 +132,31 @@ void System::RedirectTo(long item_id, const wchar_t * postfix)
|
|||
}
|
||||
|
||||
if( postfix )
|
||||
request->redirect_to += postfix;
|
||||
cur->request->redirect_to += postfix;
|
||||
}
|
||||
|
||||
|
||||
void System::RedirectTo(const std::wstring & url)
|
||||
{
|
||||
request->redirect_to = config->base_url;
|
||||
cur->request->redirect_to = config->base_url;
|
||||
|
||||
if( !url.empty() && url[0] == '/' )
|
||||
{
|
||||
// absolute path
|
||||
request->redirect_to += url;
|
||||
cur->request->redirect_to += url;
|
||||
}
|
||||
else
|
||||
{
|
||||
// relative path
|
||||
if( !request->dir_tab.empty() )
|
||||
if( !cur->request->dir_tab.empty() )
|
||||
{
|
||||
if( dirs.MakePath(request->dir_tab.back()->id, request->redirect_to, false) )
|
||||
request->redirect_to += url;
|
||||
if( dirs.MakePath(cur->request->dir_tab.back()->id, cur->request->redirect_to, false) )
|
||||
cur->request->redirect_to += url;
|
||||
}
|
||||
else
|
||||
{
|
||||
request->redirect_to += '/';
|
||||
request->redirect_to += url;
|
||||
cur->request->redirect_to += '/';
|
||||
cur->request->redirect_to += url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -186,38 +186,38 @@ void System::RedirectWithFunctionAndParamsTo(const std::wstring & url)
|
|||
{
|
||||
RedirectTo(url);
|
||||
|
||||
if( !request->function )
|
||||
if( !cur->request->function )
|
||||
return;
|
||||
|
||||
request->redirect_to += '/';
|
||||
request->redirect_to += request->function->fun.url;
|
||||
cur->request->redirect_to += '/';
|
||||
cur->request->redirect_to += cur->request->function->fun.url;
|
||||
|
||||
AddParams(request->param_tab, request->redirect_to, false);
|
||||
AddParams(cur->request->param_tab, cur->request->redirect_to, false);
|
||||
}
|
||||
|
||||
|
||||
void System::RedirectToLastDir()
|
||||
{
|
||||
if( !request->dir_tab.empty() )
|
||||
RedirectTo( *request->dir_tab.back() );
|
||||
if( !cur->request->dir_tab.empty() )
|
||||
RedirectTo( *cur->request->dir_tab.back() );
|
||||
}
|
||||
|
||||
|
||||
void System::RedirectToLastItem()
|
||||
{
|
||||
if( request->last_item )
|
||||
RedirectTo( *request->last_item );
|
||||
if( cur->request->last_item )
|
||||
RedirectTo( *cur->request->last_item );
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool System::CanChangeUser(const Item & item, long new_user_id)
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
// session must be set
|
||||
return false;
|
||||
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user is allowed everything
|
||||
return true;
|
||||
|
||||
|
@ -233,11 +233,11 @@ return true;
|
|||
|
||||
bool System::CanChangeGroup(const Item & item, long new_group_id)
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
// session must be set
|
||||
return false;
|
||||
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user is allowed everything
|
||||
return true;
|
||||
|
||||
|
@ -246,16 +246,16 @@ bool System::CanChangeGroup(const Item & item, long new_group_id)
|
|||
// user is allowed to change the group only if he is an owner of the item
|
||||
// he can change only into a group in which he is a member of, or into a 'no_group'
|
||||
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
return false;
|
||||
|
||||
if( request->session->puser->id != item.user_id )
|
||||
if( cur->session->puser->id != item.user_id )
|
||||
return false;
|
||||
|
||||
if( new_group_id == -1 )
|
||||
return true;
|
||||
|
||||
if( !request->session->puser->IsMemberOf(new_group_id) )
|
||||
if( !cur->session->puser->IsMemberOf(new_group_id) )
|
||||
return false;
|
||||
|
||||
// is logged, is the owner of the item, is the member of the new group
|
||||
|
@ -267,11 +267,11 @@ return true;
|
|||
|
||||
bool System::CanChangePrivileges(const Item & item, int new_priv)
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
// session must be set
|
||||
return false;
|
||||
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user is allowed everything
|
||||
return true;
|
||||
|
||||
|
@ -279,10 +279,10 @@ bool System::CanChangePrivileges(const Item & item, int new_priv)
|
|||
{
|
||||
// the owner of an item is allowed to change the privileges
|
||||
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
return false;
|
||||
|
||||
if( request->session->puser->id != item.user_id )
|
||||
if( cur->session->puser->id != item.user_id )
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -293,21 +293,21 @@ return true;
|
|||
|
||||
bool System::HasAccess(const Item & item, int mask)
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
// session must be set
|
||||
return false;
|
||||
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user is allowed everything
|
||||
return true;
|
||||
|
||||
if( request->session->puser && request->session->puser->id == item.user_id )
|
||||
if( cur->session->puser && cur->session->puser->id == item.user_id )
|
||||
{
|
||||
// the owner
|
||||
return ((item.privileges >> 6) & mask) == mask;
|
||||
}
|
||||
|
||||
if( request->session->puser && request->session->puser->IsMemberOf(item.group_id) )
|
||||
if( cur->session->puser && cur->session->puser->IsMemberOf(item.group_id) )
|
||||
{
|
||||
// group
|
||||
return ((item.privileges >> 3) & mask) == mask;
|
||||
|
@ -339,7 +339,7 @@ bool System::HasReadWriteAccess(const Item & item)
|
|||
|
||||
bool System::HasReadExecAccess(const Item & item)
|
||||
{
|
||||
if( request->session && request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session && cur->session->puser && cur->session->puser->super_user )
|
||||
{
|
||||
// there must be at least one 'x' (for the root)
|
||||
|
||||
|
@ -387,7 +387,7 @@ return true;
|
|||
|
||||
bool System::DirsHaveReadExecPerm()
|
||||
{
|
||||
return HasReadExecAccessToPath(request->dir_tab);
|
||||
return HasReadExecAccessToPath(cur->request->dir_tab);
|
||||
}
|
||||
|
||||
|
||||
|
@ -642,10 +642,10 @@ Error System::EditFile(Item & item, bool with_url, int notify_code)
|
|||
if( item.type != Item::file )
|
||||
return WINIX_ERR_FILE_EXPECTED;
|
||||
|
||||
if( request->session && request->session->puser )
|
||||
request->item.modification_user_id = request->session->puser->id;
|
||||
if( cur->session && cur->session->puser )
|
||||
cur->request->item.modification_user_id = cur->session->puser->id;
|
||||
else
|
||||
request->item.modification_user_id = -1;
|
||||
cur->request->item.modification_user_id = -1;
|
||||
|
||||
item.SetDateModifyToNow();
|
||||
Error status = db->EditItemById(item, with_url);
|
||||
|
@ -669,8 +669,8 @@ time_t System::LocalTime(time_t gmt_time)
|
|||
{
|
||||
int time_offset;
|
||||
|
||||
if( request->session && request->session->puser )
|
||||
time_offset = request->session->puser->time_zone_offset;
|
||||
if( cur->session && cur->session->puser )
|
||||
time_offset = cur->session->puser->time_zone_offset;
|
||||
else
|
||||
time_offset = config->time_zone_offset_guest;
|
||||
|
||||
|
@ -909,40 +909,40 @@ int System::FollowAllLinks(const std::wstring & link_to,
|
|||
|
||||
|
||||
|
||||
// the same as FollowAllLinks but operates on request->dir_tab and request->item
|
||||
// the same as FollowAllLinks but operates on cur->request->dir_tab and cur->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,
|
||||
int res = FollowAllLinks(cur->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;
|
||||
cur->request->dir_tab = temp_follow_dir_tab;
|
||||
|
||||
if( res == 0 )
|
||||
{
|
||||
request->is_item = false;
|
||||
request->item.Clear();
|
||||
request->last_item = request->dir_tab.back();
|
||||
cur->request->is_item = false;
|
||||
cur->request->item.Clear();
|
||||
cur->request->last_item = cur->request->dir_tab.back();
|
||||
|
||||
if( !request->dir_tab.back()->link_to.empty() )
|
||||
RedirectTo(request->dir_tab.back()->link_to);
|
||||
if( !cur->request->dir_tab.back()->link_to.empty() )
|
||||
RedirectTo(cur->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;
|
||||
cur->request->is_item = true;
|
||||
cur->request->item = temp_follow_item;
|
||||
cur->request->last_item = &cur->request->item;
|
||||
|
||||
if( request->item.type == Item::symlink )
|
||||
RedirectTo(request->item.link_to); // request->item.link_to is not empty
|
||||
if( cur->request->item.type == Item::symlink )
|
||||
RedirectTo(cur->request->item.link_to); // cur->request->item.link_to is not empty
|
||||
|
||||
log << log3 << "System: current directory changed and the new file loaded" << logend;
|
||||
}
|
||||
|
@ -952,9 +952,9 @@ bool System::FollowAllLinks(const std::wstring & link_to,
|
|||
else
|
||||
{
|
||||
if( res == 5 || res == 6 )
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
else
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoresystem
|
||||
#define headerfilecmslucoresystem
|
||||
#ifndef headerfile_winix_core_system
|
||||
#define headerfile_winix_core_system
|
||||
|
||||
#include <ctime>
|
||||
#include "dirs.h"
|
||||
|
@ -60,7 +60,7 @@ public:
|
|||
time_t system_start;
|
||||
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetDb(Db * pdb);
|
||||
void SetSynchro(Synchro * psynchro);
|
||||
|
@ -120,15 +120,16 @@ public:
|
|||
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
|
||||
// using cur->request->dir_tab and cur->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;
|
||||
Config * config;
|
||||
Db * db;
|
||||
Synchro * synchro;
|
||||
|
||||
Cur * cur;
|
||||
Db * db;
|
||||
Config * config;
|
||||
Synchro * synchro;
|
||||
|
||||
Item item_temp;
|
||||
std::wstring link_to_temp, name_temp;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorethumb
|
||||
#define headerfilecmslucorethumb
|
||||
#ifndef headerfile_winix_core_thumb
|
||||
#define headerfile_winix_core_thumb
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreugcontainer
|
||||
#define headerfilecmslucoreugcontainer
|
||||
#ifndef headerfile_winix_core_ugcontainer
|
||||
#define headerfile_winix_core_ugcontainer
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreuser
|
||||
#define headerfilecmslucoreuser
|
||||
#ifndef headerfile_winix_core_user
|
||||
#define headerfile_winix_core_user
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
|
|
@ -19,9 +19,9 @@ Users::Users()
|
|||
}
|
||||
|
||||
|
||||
void Users::SetRequest(Request * prequest)
|
||||
void Users::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -128,30 +128,30 @@ User & Users::operator[](Users::SizeType pos)
|
|||
|
||||
void Users::LoginUser(long user_id, bool remember_me)
|
||||
{
|
||||
if( !request->session )
|
||||
if( !cur->session )
|
||||
return;
|
||||
|
||||
if( request->session->id == 0 )
|
||||
if( cur->session->id == 0 )
|
||||
{
|
||||
log << log1 << "Users: cannot login a user on a temporary session" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
request->session->puser = GetUser(user_id);
|
||||
request->session->spam_score = 0;
|
||||
cur->session->puser = GetUser(user_id);
|
||||
cur->session->spam_score = 0;
|
||||
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
{
|
||||
log << log1 << "Users: user id: " << user_id << " is not in system.users table" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
request->session->remember_me = remember_me;
|
||||
cur->session->remember_me = remember_me;
|
||||
|
||||
last.UserLogin(user_id, request->session->puser->name, inet_addr(request->env_remote_addr), request->session->id);
|
||||
last.UserLogin(user_id, cur->session->puser->name, inet_addr(cur->request->env_remote_addr), cur->session->id);
|
||||
how_many_logged += 1;
|
||||
|
||||
log << log2 << "User " << request->session->puser->name << " (id: " << user_id << ") logged" << logend;
|
||||
log << log2 << "User " << cur->session->puser->name << " (id: " << user_id << ") logged" << logend;
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,19 +159,19 @@ void Users::LoginUser(long user_id, bool remember_me)
|
|||
|
||||
void Users::LogoutCurrentUser()
|
||||
{
|
||||
if( !request->session || !request->session->puser )
|
||||
if( !cur->session || !cur->session->puser )
|
||||
return;
|
||||
|
||||
log << log2 << "Users: user " << request->session->puser->name << ", id: "
|
||||
<< request->session->puser->id << " logged out" << logend;
|
||||
log << log2 << "Users: user " << cur->session->puser->name << ", id: "
|
||||
<< cur->session->puser->id << " logged out" << logend;
|
||||
|
||||
last.UserLogout(request->session->puser->id, request->session->id);
|
||||
last.UserLogout(cur->session->puser->id, cur->session->id);
|
||||
|
||||
if( how_many_logged > 0 ) // for safety
|
||||
how_many_logged -= 1;
|
||||
|
||||
request->session->puser = 0;
|
||||
request->session->remember_me = 0;
|
||||
cur->session->puser = 0;
|
||||
cur->session->remember_me = 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
10
core/users.h
10
core/users.h
|
@ -7,14 +7,14 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreusers
|
||||
#define headerfilecmslucoreusers
|
||||
#ifndef headerfile_winix_core_users
|
||||
#define headerfile_winix_core_users
|
||||
|
||||
#include <map>
|
||||
#include "user.h"
|
||||
#include "ugcontainer.h"
|
||||
#include "lastcontainer.h"
|
||||
#include "request.h"
|
||||
#include "cur.h"
|
||||
#include "db/db.h"
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ class Users
|
|||
typedef UGContainer<User> Table;
|
||||
Table table;
|
||||
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
long how_many_logged;
|
||||
|
||||
public:
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
Users();
|
||||
|
||||
void SetRequest(Request * request);
|
||||
void SetCur(Cur * pcur);
|
||||
|
||||
void Clear();
|
||||
void ReadUsers(Db * db);
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucoreversion
|
||||
#define headerfilecmslucoreversion
|
||||
#ifndef headerfile_winix_core_version
|
||||
#define headerfile_winix_core_version
|
||||
|
||||
|
||||
#define WINIX_VER_MAJOR 0
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -25,25 +25,25 @@ bool AddUser::CheckAddUserVars(const std::wstring & login, const std::wstring &
|
|||
{
|
||||
if( login.empty() )
|
||||
{
|
||||
request->status = WINIX_ERR_LOGIN_EMPTY;
|
||||
cur->request->status = WINIX_ERR_LOGIN_EMPTY;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( pass != conf_pass )
|
||||
{
|
||||
request->status = WINIX_ERR_PASSWORDS_DIFFERENT;
|
||||
cur->request->status = WINIX_ERR_PASSWORDS_DIFFERENT;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( pass.size() < config->password_min_size )
|
||||
{
|
||||
request->status = WINIX_ERR_PASSWORD_TOO_SHORT;
|
||||
cur->request->status = WINIX_ERR_PASSWORD_TOO_SHORT;
|
||||
return false;
|
||||
}
|
||||
|
||||
if( system->users.IsUser(login) )
|
||||
{
|
||||
request->status = WINIX_ERR_USER_EXISTS;
|
||||
cur->request->status = WINIX_ERR_USER_EXISTS;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -59,23 +59,23 @@ void AddUser::MakePost()
|
|||
{
|
||||
User user;
|
||||
|
||||
const std::wstring & login = request->PostVar(L"login");
|
||||
const std::wstring & pass = request->PostVar(L"password");
|
||||
const std::wstring & conf_pass = request->PostVar(L"confirmpassword");
|
||||
const std::wstring & login = cur->request->PostVar(L"login");
|
||||
const std::wstring & pass = cur->request->PostVar(L"password");
|
||||
const std::wstring & conf_pass = cur->request->PostVar(L"confirmpassword");
|
||||
|
||||
if( !CheckAddUserVars(login, pass, conf_pass) )
|
||||
return;
|
||||
|
||||
user.name = login;
|
||||
user.email = request->PostVar(L"email");
|
||||
user.email = cur->request->PostVar(L"email");
|
||||
|
||||
request->status = db->AddUser(user, pass);
|
||||
cur->request->status = db->AddUser(user, pass);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
if( system->users.AddUser(user) )
|
||||
{
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
system->users.LoginUser(user.id, false);
|
||||
|
||||
log << log2 << "Adduser: added a new user: " << user.name << logend;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentadduser
|
||||
#define headerfilecmslucontentadduser
|
||||
#ifndef headerfile_winix_functions_adduser
|
||||
#define headerfile_winix_functions_adduser
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -22,21 +22,21 @@ Cat::Cat()
|
|||
|
||||
void Cat::MakeGet()
|
||||
{
|
||||
if( !request->is_item )
|
||||
if( !cur->request->is_item )
|
||||
{
|
||||
log << log1 << "Content: cat function requires an item" << logend;
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( !system->HasReadAccess(request->item) )
|
||||
if( !system->HasReadAccess(cur->request->item) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
request->send_as_attachment = request->IsParam(L"attachment");
|
||||
cur->request->send_as_attachment = cur->request->IsParam(L"attachment");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentfuncatcat
|
||||
#define headerfilecmslucontentfuncatcat
|
||||
#ifndef headerfile_winix_functions_cat
|
||||
#define headerfile_winix_functions_cat
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ Chmod::Chmod()
|
|||
|
||||
void Chmod::MakePost()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
@ -33,7 +33,7 @@ void Chmod::MakePost()
|
|||
|
||||
void Chmod::MakeGet()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentchmod
|
||||
#define headerfilecmslucontentchmod
|
||||
#ifndef headerfile_winix_functions_chmod
|
||||
#define headerfile_winix_functions_chmod
|
||||
|
||||
#include "functionbase.h"
|
||||
#include "privchanger.h"
|
||||
|
|
|
@ -23,7 +23,7 @@ Chown::Chown()
|
|||
|
||||
void Chown::MakePost()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
@ -33,7 +33,7 @@ void Chown::MakePost()
|
|||
|
||||
void Chown::MakeGet()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentchown
|
||||
#define headerfilecmslucontentchown
|
||||
#ifndef headerfile_winix_functions_chown
|
||||
#define headerfile_winix_functions_chown
|
||||
|
||||
#include "functionbase.h"
|
||||
#include "privchanger.h"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentckeditor
|
||||
#define headerfilecmslucontentckeditor
|
||||
#ifndef headerfile_winix_functions_ckeditor
|
||||
#define headerfile_winix_functions_ckeditor
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -29,19 +29,19 @@ bool Cp::HasAccess()
|
|||
|
||||
bool Cp::CheckAccessFrom()
|
||||
{
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
if( !system->HasReadAccess(request->item) || request->item.type == Item::symlink )
|
||||
if( !system->HasReadAccess(cur->request->item) || cur->request->item.type == Item::symlink )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
if( !request->IsParam(L"r") )
|
||||
if( !cur->request->IsParam(L"r") )
|
||||
{
|
||||
// directories need 'r' parameter
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -54,7 +54,7 @@ bool Cp::CheckAccessTo()
|
|||
!system->HasReadExecAccessToPath(dir_tab) ||
|
||||
!system->HasWriteAccess(*dir_tab.back()) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -65,14 +65,14 @@ return true;
|
|||
|
||||
bool Cp::ParseDir()
|
||||
{
|
||||
const std::wstring & new_dir = request->PostVar(L"to");
|
||||
int res = system->dirs.FollowLink(request->dir_tab, new_dir, dir_tab, file);
|
||||
const std::wstring & new_dir = cur->request->PostVar(L"to");
|
||||
int res = system->dirs.FollowLink(cur->request->dir_tab, new_dir, dir_tab, file);
|
||||
|
||||
if( res == 3 )
|
||||
request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
cur->request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
else
|
||||
if( res != 0 && res != 1 )
|
||||
request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
|
||||
return res == 0 || res == 1;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ bool Cp::CopyStaticFile(const std::wstring & from, const std::wstring & to)
|
|||
else
|
||||
{
|
||||
log << log1 << "Cp: can't copy a file from: " << from << ", to: " << to << logend;
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -113,13 +113,13 @@ bool res1, res2, res3, res4, res5;
|
|||
|
||||
if( !res1 || !res2 || !res3 || !res4 || !res5 )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
if( CopyStaticFile(old_path, new_path) )
|
||||
{
|
||||
request->status = db->EditFileById(item, item.id);
|
||||
cur->request->status = db->EditFileById(item, item.id);
|
||||
|
||||
if( item.has_thumb )
|
||||
CopyStaticFile(old_path_thumb, new_path_thumb);
|
||||
|
@ -142,9 +142,9 @@ void Cp::CopyFile(Item & item, long dst_dir_id)
|
|||
SetNewAttributes(item);
|
||||
|
||||
item.parent_id = dst_dir_id;
|
||||
request->status = db->AddItem(item);
|
||||
cur->request->status = db->AddItem(item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
if( item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
CopyStaticFile(item);
|
||||
|
@ -187,8 +187,8 @@ void Cp::Prepare()
|
|||
new_user = -1;
|
||||
new_group = dir_tab.back()->group_id;
|
||||
|
||||
if( request->session->puser )
|
||||
new_user = request->session->puser->id;
|
||||
if( cur->session->puser )
|
||||
new_user = cur->session->puser->id;
|
||||
|
||||
loop_checker.clear();
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ long Cp::CopyDirTree(const Item & dir, long dst_dir_id)
|
|||
temp.link_redirect = 0;
|
||||
}
|
||||
|
||||
request->status = system->dirs.AddDirectory(temp);
|
||||
cur->request->status = system->dirs.AddDirectory(temp);
|
||||
loop_checker.push_back(temp.id);
|
||||
|
||||
// remember the new dir_id because temp can be changed
|
||||
|
@ -311,7 +311,7 @@ void Cp::PostCopyFile(Item & item, bool redirect)
|
|||
|
||||
CopyFileOrSymlink(item, dir_tab.back()->id);
|
||||
|
||||
if( request->status == WINIX_ERR_OK && redirect )
|
||||
if( cur->request->status == WINIX_ERR_OK && redirect )
|
||||
system->RedirectTo(item);
|
||||
}
|
||||
|
||||
|
@ -323,7 +323,7 @@ void Cp::PostCopyDirContent(const Item & dir, bool redirect)
|
|||
{
|
||||
if( !file.empty() )
|
||||
{
|
||||
request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -332,7 +332,7 @@ void Cp::PostCopyDirContent(const Item & dir, bool redirect)
|
|||
|
||||
CopyDirContentTree(dir, dir_tab.back()->id);
|
||||
|
||||
if( request->status == WINIX_ERR_OK && redirect )
|
||||
if( cur->request->status == WINIX_ERR_OK && redirect )
|
||||
system->RedirectTo(dir_tab.back()->id);
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ void Cp::PostCopyDir(const Item & dir, bool redirect)
|
|||
|
||||
long new_dir_id = CopyDirTree(dir, dir_id);
|
||||
|
||||
if( new_dir_id != -1 && request->status == WINIX_ERR_OK && redirect )
|
||||
if( new_dir_id != -1 && cur->request->status == WINIX_ERR_OK && redirect )
|
||||
system->RedirectTo(new_dir_id);
|
||||
}
|
||||
|
||||
|
@ -367,20 +367,20 @@ void Cp::MakePost()
|
|||
{
|
||||
Prepare();
|
||||
|
||||
preserve_attr = request->IsPostVar(L"preserveattr");
|
||||
remove_defaults = request->IsPostVar(L"removedefaults");
|
||||
follow_symlinks = request->IsPostVar(L"followsymlinks");
|
||||
preserve_attr = cur->request->IsPostVar(L"preserveattr");
|
||||
remove_defaults = cur->request->IsPostVar(L"removedefaults");
|
||||
follow_symlinks = cur->request->IsPostVar(L"followsymlinks");
|
||||
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
PostCopyFile(request->item);
|
||||
PostCopyFile(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( request->IsPostVar(L"onlycontent") )
|
||||
PostCopyDirContent(*request->dir_tab.back());
|
||||
if( cur->request->IsPostVar(L"onlycontent") )
|
||||
PostCopyDirContent(*cur->request->dir_tab.back());
|
||||
else
|
||||
PostCopyDir(*request->dir_tab.back());
|
||||
PostCopyDir(*cur->request->dir_tab.back());
|
||||
}
|
||||
|
||||
Clear();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentcp
|
||||
#define headerfilecmslucontentcp
|
||||
#ifndef headerfile_winix_functions_cp
|
||||
#define headerfile_winix_functions_cp
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -22,24 +22,24 @@ Default::Default()
|
|||
|
||||
bool Default::HasAccess()
|
||||
{
|
||||
return !request->is_item && system->HasWriteAccess(*request->dir_tab.back());
|
||||
return !cur->request->is_item && system->HasWriteAccess(*cur->request->dir_tab.back());
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Default::MakePost()
|
||||
{
|
||||
Item & dir = *request->dir_tab.back();
|
||||
Item & dir = *cur->request->dir_tab.back();
|
||||
|
||||
dir.link_to = request->PostVar(L"linkto");
|
||||
dir.link_redirect = request->IsPostVar(L"makeredirect") ? 1 : 0;
|
||||
dir.link_to = cur->request->PostVar(L"linkto");
|
||||
dir.link_redirect = cur->request->IsPostVar(L"makeredirect") ? 1 : 0;
|
||||
TrimWhite(dir.link_to);
|
||||
|
||||
// !! dodac sprawdzenie czy link_to jest pusty teraz
|
||||
|
||||
request->status = db->EditLinkItem(dir.id, dir.link_to, dir.link_redirect);
|
||||
cur->request->status = db->EditLinkItem(dir.id, dir.link_to, dir.link_redirect);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
log << log2 << "Default: changed link_to: " << dir.link_to << ", for dir_id: " << dir.id << logend;
|
||||
system->RedirectToLastDir();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentdefault
|
||||
#define headerfilecmslucontentdefault
|
||||
#ifndef headerfile_winix_functions_default
|
||||
#define headerfile_winix_functions_default
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -24,28 +24,28 @@ Download::Download()
|
|||
void Download::MakeGet()
|
||||
{
|
||||
// !! moze wywalic to no_item i wszedzie w takich miejscach dac poprostu permission_denied?
|
||||
if( !request->is_item )
|
||||
if( !cur->request->is_item )
|
||||
{
|
||||
log << log1 << "Content: download function requires an item" << logend;
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( !system->HasReadAccess(request->item) ||
|
||||
request->item.file_type == WINIX_ITEM_FILETYPE_NONE ||
|
||||
request->item.file_path.empty() )
|
||||
if( !system->HasReadAccess(cur->request->item) ||
|
||||
cur->request->item.file_type == WINIX_ITEM_FILETYPE_NONE ||
|
||||
cur->request->item.file_path.empty() )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
request->send_as_attachment = request->IsParam(L"attachment");
|
||||
cur->request->send_as_attachment = cur->request->IsParam(L"attachment");
|
||||
|
||||
if( request->item.has_thumb && request->IsParam(L"thumb") )
|
||||
system->MakeFilePath(request->item, request->x_sendfile, true);
|
||||
if( cur->request->item.has_thumb && cur->request->IsParam(L"thumb") )
|
||||
system->MakeFilePath(cur->request->item, cur->request->x_sendfile, true);
|
||||
else
|
||||
system->MakeFilePath(request->item, request->x_sendfile);
|
||||
system->MakeFilePath(cur->request->item, cur->request->x_sendfile);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentdownload
|
||||
#define headerfilecmslucontentdownload
|
||||
#ifndef headerfile_winix_functions_download
|
||||
#define headerfile_winix_functions_download
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Emacs::Emacs()
|
|||
|
||||
bool Emacs::HasAccess(const Item & item)
|
||||
{
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user can use emacs everywhere
|
||||
return true;
|
||||
|
||||
|
@ -35,7 +35,7 @@ bool Emacs::HasAccess(const Item & item)
|
|||
if( !system->mounts.pmount->IsPar(system->mounts.MountParEmacsOn()) )
|
||||
return true;
|
||||
|
||||
if( system->mounts.pmount->IsArg(system->mounts.MountParEmacsOn(), request->dir_tab.size()) )
|
||||
if( system->mounts.pmount->IsArg(system->mounts.MountParEmacsOn(), cur->request->dir_tab.size()) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -45,7 +45,7 @@ return false;
|
|||
|
||||
bool Emacs::HasAccess()
|
||||
{
|
||||
return HasAccess(*request->last_item);
|
||||
return HasAccess(*cur->request->last_item);
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,16 +56,16 @@ bool Emacs::PostEmacsCheckAbuse(bool adding)
|
|||
{
|
||||
if( !system->rebus.CheckRebus() )
|
||||
{
|
||||
request->status = WINIX_ERR_INCORRECT_REBUS;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_REBUS;
|
||||
return false;
|
||||
}
|
||||
|
||||
// !! is tested in createthread once
|
||||
functions->CheckGetPostTimes();
|
||||
|
||||
if( request->session->spam_score > 0 )
|
||||
if( cur->session->spam_score > 0 )
|
||||
{
|
||||
request->status = WINIX_ERR_SPAM;
|
||||
cur->request->status = WINIX_ERR_SPAM;
|
||||
log << log1 << "Emacs: ignoring due to suspected spamming" << logend;
|
||||
return false;
|
||||
}
|
||||
|
@ -109,39 +109,39 @@ return WINIX_NOTIFY_CODE_FILE_ADD;
|
|||
|
||||
void Emacs::MakePost()
|
||||
{
|
||||
bool adding = !request->is_item;
|
||||
bool adding = !cur->request->is_item;
|
||||
|
||||
if( !adding )
|
||||
old_url = request->item.url;
|
||||
old_url = cur->request->item.url;
|
||||
|
||||
functions->ReadItem(request->item, Item::file);
|
||||
functions->ReadItem(cur->request->item, Item::file);
|
||||
|
||||
if( adding )
|
||||
functions->SetUser(request->item); // set user before checking the rebus
|
||||
functions->SetUser(cur->request->item); // set user before checking the rebus
|
||||
|
||||
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
|
||||
cur->request->is_item = true; // !! moze lepiej nie ustawiac is_item? (bo jak wystapi blad np dodania do bazy danych
|
||||
// to formularz edycji zmieni sie z 'dodaj' na 'edytuj'
|
||||
request->item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
request->status = system->AddFile(request->item, NotifyCodeAdd());
|
||||
cur->request->item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
cur->request->status = system->AddFile(cur->request->item, NotifyCodeAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
request->status = system->EditFile(request->item, request->item.url != old_url, NotifyCodeEdit());
|
||||
cur->request->status = system->EditFile(cur->request->item, cur->request->item.url != old_url, NotifyCodeEdit());
|
||||
}
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
PostFunEmacsModifyMountPoint(adding);
|
||||
functions->CheckSpecialFile(request->item);
|
||||
functions->CheckSpecialFile(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Emacs: error: " << request->status << logend;
|
||||
log << log1 << "Emacs: error: " << cur->request->status << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentemacs
|
||||
#define headerfilecmslucontentemacs
|
||||
#ifndef headerfile_winix_functions_emacs
|
||||
#define headerfile_winix_functions_emacs
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -33,12 +33,13 @@ void FunctionBase::SetConfig(Config * pconfig)
|
|||
}
|
||||
|
||||
|
||||
void FunctionBase::SetRequest(Request * prequest)
|
||||
void FunctionBase::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionBase::SetDb(Db * pdb)
|
||||
{
|
||||
db = pdb;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentfunctionbase
|
||||
#define headerfilecmslucontentfunctionbase
|
||||
#ifndef headerfile_winix_functions_functionbase
|
||||
#define headerfile_winix_functions_functionbase
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
virtual void MakeGet();
|
||||
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetDb(Db * pdb);
|
||||
void SetSystem(System * psystem);
|
||||
void SetFunctions(Functions * pfunctions);
|
||||
|
@ -60,13 +60,13 @@ public:
|
|||
|
||||
protected:
|
||||
|
||||
Config * config;
|
||||
Request * request;
|
||||
Db * db;
|
||||
System * system;
|
||||
Config * config;
|
||||
Cur * cur;
|
||||
Db * db;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
Synchro * synchro;
|
||||
Synchro * synchro;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
void FunctionParser::SkipEmptyString(const char * msg)
|
||||
{
|
||||
for( ; get_index != get_tab_len && request->get_tab[get_index].empty() ; ++get_index )
|
||||
for( ; get_index != get_tab_len && cur->request->get_tab[get_index].empty() ; ++get_index )
|
||||
log << log3 << msg << logend;
|
||||
}
|
||||
|
||||
|
@ -31,14 +31,14 @@ void FunctionParser::ParseDirectories()
|
|||
if( !pdir )
|
||||
{
|
||||
// there is no the root dir
|
||||
request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
cur->request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while( true )
|
||||
{
|
||||
request->dir_tab.push_back( pdir );
|
||||
cur->request->dir_tab.push_back( pdir );
|
||||
log << log3 << "FP: Directory: ";
|
||||
|
||||
if( pdir->parent_id == -1 )
|
||||
|
@ -51,7 +51,7 @@ void FunctionParser::ParseDirectories()
|
|||
if( get_index == get_tab_len )
|
||||
break;
|
||||
|
||||
pdir = system->dirs.GetDir(request->get_tab[get_index], pdir->id);
|
||||
pdir = system->dirs.GetDir(cur->request->get_tab[get_index], pdir->id);
|
||||
|
||||
if( !pdir )
|
||||
break;
|
||||
|
@ -59,7 +59,7 @@ void FunctionParser::ParseDirectories()
|
|||
++get_index;
|
||||
}
|
||||
|
||||
request->last_item = request->dir_tab.back();
|
||||
cur->request->last_item = cur->request->dir_tab.back();
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,26 +71,26 @@ void FunctionParser::ParseItem()
|
|||
if( get_index == get_tab_len )
|
||||
return;
|
||||
|
||||
// request->dir_tab has at least one element
|
||||
long parent_id = request->dir_tab.back()->id;
|
||||
const std::wstring & url = request->get_tab[get_index];
|
||||
// cur->request->dir_tab has at least one element
|
||||
long parent_id = cur->request->dir_tab.back()->id;
|
||||
const std::wstring & url = cur->request->get_tab[get_index];
|
||||
|
||||
request->status = db->GetItem(parent_id, url, request->item);
|
||||
cur->request->status = db->GetItem(parent_id, url, cur->request->item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
request->last_item = &request->item;
|
||||
cur->request->last_item = &cur->request->item;
|
||||
|
||||
if( request->role == Request::authorizer && request->item.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
if( cur->request->role == Request::authorizer && cur->request->item.file_type == WINIX_ITEM_FILETYPE_NONE )
|
||||
{
|
||||
log << log1 << "FP: item.url: " << url << " exists but has not a static content (authorizer role)" << logend;
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
return;
|
||||
}
|
||||
|
||||
++get_index;
|
||||
request->is_item = true;
|
||||
log << log3 << "FP: Item: id: " << request->item.id << ", url: " << request->item.url << logend;
|
||||
cur->request->is_item = true;
|
||||
log << log3 << "FP: Item: id: " << cur->request->item.id << ", url: " << cur->request->item.url << logend;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -107,13 +107,13 @@ void FunctionParser::ParseFunction()
|
|||
if( get_index == get_tab_len )
|
||||
return;
|
||||
|
||||
request->function = functions->Find(request->get_tab[get_index]);
|
||||
cur->request->function = functions->Find(cur->request->get_tab[get_index]);
|
||||
|
||||
|
||||
if( request->function )
|
||||
if( cur->request->function )
|
||||
{
|
||||
++get_index;
|
||||
log << log3 << "FP: Function: " << request->function->fun.url << logend;
|
||||
log << log3 << "FP: Function: " << cur->request->function->fun.url << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ size_t i;
|
|||
param.value = par.substr(i+1);
|
||||
}
|
||||
|
||||
request->param_tab.push_back(param);
|
||||
cur->request->param_tab.push_back(param);
|
||||
|
||||
log << log3 << "FP: Param: name=" << param.name;
|
||||
|
||||
|
@ -165,45 +165,45 @@ void FunctionParser::ParseParams()
|
|||
if( get_index == get_tab_len )
|
||||
break;
|
||||
|
||||
ParseParams(request->get_tab[get_index]);
|
||||
ParseParams(cur->request->get_tab[get_index]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FunctionParser::Parse(Request * prequest, Db * pdb, Functions * pfunctions, System * psystem)
|
||||
void FunctionParser::Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem)
|
||||
{
|
||||
request = prequest;
|
||||
db = pdb;
|
||||
functions = pfunctions;
|
||||
cur = pcur;
|
||||
system = psystem;
|
||||
functions = pfunctions;
|
||||
|
||||
request->status = WINIX_ERR_OK;
|
||||
cur->request->status = WINIX_ERR_OK;
|
||||
get_index = 0;
|
||||
get_tab_len = request->get_tab.size();
|
||||
request->function = 0;
|
||||
request->is_item = false;
|
||||
get_tab_len = cur->request->get_tab.size();
|
||||
cur->request->function = 0;
|
||||
cur->request->is_item = false;
|
||||
|
||||
ParseDirectories();
|
||||
|
||||
if( request->status != WINIX_ERR_OK )
|
||||
if( cur->request->status != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
ParseFunction();
|
||||
|
||||
if( !request->function )
|
||||
if( !cur->request->function )
|
||||
{
|
||||
ParseItem();
|
||||
|
||||
if( request->status != WINIX_ERR_OK )
|
||||
if( cur->request->status != WINIX_ERR_OK )
|
||||
return;
|
||||
|
||||
ParseFunction();
|
||||
|
||||
if( !request->function && get_index != get_tab_len )
|
||||
if( !cur->request->function && get_index != get_tab_len )
|
||||
{
|
||||
request->status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log3 << "FP: Parse: unknown function: \"" << request->get_tab[get_index] << "\"" << logend;
|
||||
cur->request->status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log3 << "FP: Parse: unknown function: \"" << cur->request->get_tab[get_index] << "\"" << logend;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucorefunctionparser
|
||||
#define headerfilecmslucorefunctionparser
|
||||
#ifndef headerfile_winix_functions_functionparser
|
||||
#define headerfile_winix_functions_functionparser
|
||||
|
||||
#include "core/request.h"
|
||||
#include "db/db.h"
|
||||
#include "core/cur.h"
|
||||
#include "core/system.h"
|
||||
|
||||
|
||||
|
@ -21,10 +21,10 @@ class Functions;
|
|||
|
||||
class FunctionParser
|
||||
{
|
||||
Request * request;
|
||||
Db * db;
|
||||
Functions * functions;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
Functions * functions;
|
||||
|
||||
GetTab::size_type get_index;
|
||||
GetTab::size_type get_tab_len;
|
||||
|
@ -40,7 +40,7 @@ class FunctionParser
|
|||
|
||||
public:
|
||||
|
||||
void Parse(Request * prequest, Db * pdb, Functions * pfunctions, System * psystem);
|
||||
void Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -21,12 +21,13 @@ void Functions::SetConfig(Config * pconfig)
|
|||
}
|
||||
|
||||
|
||||
void Functions::SetRequest(Request * prequest)
|
||||
void Functions::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Functions::SetDb(Db * pdb)
|
||||
{
|
||||
db = pdb;
|
||||
|
@ -135,7 +136,7 @@ return WINIX_NOTHING_TO_DO;
|
|||
void Functions::SetObjects(FunctionBase * fun)
|
||||
{
|
||||
fun->SetConfig(config);
|
||||
fun->SetRequest(request);
|
||||
fun->SetCur(cur);
|
||||
fun->SetDb(db);
|
||||
fun->SetSystem(system);
|
||||
fun->SetFunctions(this);
|
||||
|
@ -224,22 +225,22 @@ void Functions::Init()
|
|||
|
||||
void Functions::Parse()
|
||||
{
|
||||
function_parser.Parse(request, db, this, system);
|
||||
function_parser.Parse(cur, db, this, system);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Functions::SetDefaultFunctionForFile()
|
||||
{
|
||||
if( request->item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
request->function = &fun_download;
|
||||
if( cur->request->item.file_type != WINIX_ITEM_FILETYPE_NONE )
|
||||
cur->request->function = &fun_download;
|
||||
else
|
||||
if( system->HasReadExecAccess(request->item) )
|
||||
request->function = &fun_run;
|
||||
if( system->HasReadExecAccess(cur->request->item) )
|
||||
cur->request->function = &fun_run;
|
||||
else
|
||||
request->function = &fun_cat;
|
||||
cur->request->function = &fun_cat;
|
||||
|
||||
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
|
||||
log << log3 << "Functions: default function: " << cur->request->function->fun.url << logend;
|
||||
}
|
||||
|
||||
|
||||
|
@ -249,30 +250,30 @@ void Functions::SetDefaultFunctionForDir()
|
|||
{
|
||||
// !! nie potrzebne
|
||||
// if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||
// request->function = &fun_thread;
|
||||
// cur->request->function = &fun_thread;
|
||||
// else
|
||||
|
||||
request->function = &fun_ls;
|
||||
cur->request->function = &fun_ls;
|
||||
|
||||
log << log3 << "Functions: default function: " << request->function->fun.url << logend;
|
||||
log << log3 << "Functions: default function: " << cur->request->function->fun.url << logend;
|
||||
}
|
||||
|
||||
|
||||
void Functions::SetDefaultFunction()
|
||||
{
|
||||
request->function = 0;
|
||||
cur->request->function = 0;
|
||||
|
||||
plugin.Call(WINIX_SELECT_DEFAULT_FUNCTION);
|
||||
|
||||
if( request->function )
|
||||
if( cur->request->function )
|
||||
{
|
||||
log << log3 << "Functions: default function: " << request->function->fun.url
|
||||
log << log3 << "Functions: default function: " << cur->request->function->fun.url
|
||||
<< " (set by a plugin)" << logend;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
SetDefaultFunctionForFile();
|
||||
else
|
||||
SetDefaultFunctionForDir();
|
||||
|
@ -288,13 +289,13 @@ void Functions::CheckFunctionFollowDir(bool was_default_function)
|
|||
|
||||
if( was_default_function )
|
||||
{
|
||||
if( request->dir_tab.back()->link_redirect == 1 )
|
||||
if( cur->request->dir_tab.back()->link_redirect == 1 )
|
||||
{
|
||||
system->RedirectTo(request->dir_tab.back()->link_to);
|
||||
system->RedirectTo(cur->request->dir_tab.back()->link_to);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( system->FollowAllLinks(request->dir_tab.back()->link_to, true, true) )
|
||||
if( system->FollowAllLinks(cur->request->dir_tab.back()->link_to, true, true) )
|
||||
SetDefaultFunction();
|
||||
}
|
||||
}
|
||||
|
@ -304,25 +305,25 @@ void Functions::CheckFunctionFollowDir(bool was_default_function)
|
|||
|
||||
void Functions::CheckFunctionFollowSymlink(bool was_default_function)
|
||||
{
|
||||
if( request->item.link_redirect == 1 )
|
||||
if( cur->request->item.link_redirect == 1 )
|
||||
{
|
||||
if( was_default_function )
|
||||
system->RedirectTo(request->item.link_to);
|
||||
system->RedirectTo(cur->request->item.link_to);
|
||||
else
|
||||
system->RedirectWithFunctionAndParamsTo(request->item.link_to);
|
||||
system->RedirectWithFunctionAndParamsTo(cur->request->item.link_to);
|
||||
}
|
||||
else
|
||||
if( system->FollowAllLinks(request->item.link_to, true, true) )
|
||||
if( system->FollowAllLinks(cur->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 )
|
||||
if( cur->request->status == WINIX_ERR_OK && !cur->request->redirect_to.empty() && !was_default_function && cur->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);
|
||||
cur->request->redirect_to += '/';
|
||||
cur->request->redirect_to += cur->request->function->fun.url;
|
||||
system->AddParams(cur->request->param_tab, cur->request->redirect_to, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -334,19 +335,19 @@ void Functions::CheckFunctionAndSymlink()
|
|||
{
|
||||
bool was_default_function = false;
|
||||
|
||||
if( !request->function || request->function == &fun_special_default )
|
||||
if( !cur->request->function || cur->request->function == &fun_special_default )
|
||||
{
|
||||
was_default_function = true;
|
||||
SetDefaultFunction();
|
||||
}
|
||||
|
||||
if( request->status != WINIX_ERR_OK || !request->redirect_to.empty() )
|
||||
if( cur->request->status != WINIX_ERR_OK || !cur->request->redirect_to.empty() )
|
||||
return;
|
||||
|
||||
if( !request->is_item && !request->dir_tab.back()->link_to.empty() )
|
||||
if( !cur->request->is_item && !cur->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 )
|
||||
if( cur->request->is_item && cur->request->item.type == Item::symlink && cur->request->function && cur->request->function->follow_symlinks )
|
||||
CheckFunctionFollowSymlink(was_default_function);
|
||||
}
|
||||
|
||||
|
@ -354,38 +355,38 @@ bool was_default_function = false;
|
|||
|
||||
void Functions::MakeFunction()
|
||||
{
|
||||
if( !request->function )
|
||||
if( !cur->request->function )
|
||||
{
|
||||
request->status = WINIX_ERR_NO_FUNCTION;
|
||||
cur->request->status = WINIX_ERR_NO_FUNCTION;
|
||||
log << log1 << "Functions: no function (neither cat nor ls)" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
if( !system->DirsHaveReadExecPerm() ||
|
||||
!system->HasReadExecAccess(request->function->fun) ||
|
||||
!request->function->HasAccess() )
|
||||
!system->HasReadExecAccess(cur->request->function->fun) ||
|
||||
!cur->request->function->HasAccess() )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
if( request->method == Request::get )
|
||||
if( cur->request->method == Request::get )
|
||||
{
|
||||
if( request->redirect_to.empty() )
|
||||
request->function->MakeGet();
|
||||
if( cur->request->redirect_to.empty() )
|
||||
cur->request->function->MakeGet();
|
||||
}
|
||||
else
|
||||
if( request->method == Request::post )
|
||||
if( cur->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();
|
||||
if( cur->request->redirect_to.empty() )
|
||||
cur->request->function->MakePost();
|
||||
else
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
}
|
||||
else
|
||||
if( request->method == Request::head )
|
||||
if( cur->request->method == Request::head )
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
@ -401,19 +402,19 @@ void Functions::CheckGetPostTimes(time_t difference)
|
|||
{
|
||||
time_t now = std::time(0);
|
||||
|
||||
if( request->session->puser )
|
||||
if( cur->session->puser )
|
||||
return;
|
||||
|
||||
if( request->method != Request::post )
|
||||
if( cur->request->method != Request::post )
|
||||
return;
|
||||
|
||||
if( now - request->session->last_time_get >= (time_t)difference )
|
||||
if( now - cur->session->last_time_get >= (time_t)difference )
|
||||
return;
|
||||
|
||||
if( request->AllPostVarEmpty() )
|
||||
if( cur->request->AllPostVarEmpty() )
|
||||
return;
|
||||
|
||||
request->session->spam_score += 1;
|
||||
cur->session->spam_score += 1;
|
||||
log << log1 << "Functions: spam +1: POST after GET sent too fast" << logend;
|
||||
}
|
||||
|
||||
|
@ -424,15 +425,15 @@ bool Functions::CheckAbuse()
|
|||
{
|
||||
if( !system->rebus.CheckRebus() )
|
||||
{
|
||||
request->status = WINIX_ERR_INCORRECT_REBUS;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_REBUS;
|
||||
return true;
|
||||
}
|
||||
|
||||
CheckGetPostTimes();
|
||||
|
||||
if( request->session->spam_score > 0 )
|
||||
if( cur->session->spam_score > 0 )
|
||||
{
|
||||
request->status = WINIX_ERR_SPAM;
|
||||
cur->request->status = WINIX_ERR_SPAM;
|
||||
log << log1 << "Functions: ignoring due to suspected spamming" << logend;
|
||||
return true;
|
||||
}
|
||||
|
@ -446,17 +447,17 @@ return false;
|
|||
// returning true if the 'url' has to be changed
|
||||
void Functions::ReadItemUrlSubject(Item & item, Item::Type item_type)
|
||||
{
|
||||
std::wstring * new_subject = request->PostVarp(L"subject");
|
||||
std::wstring * new_url = request->PostVarp(L"url");
|
||||
std::wstring * new_subject = cur->request->PostVarp(L"subject");
|
||||
std::wstring * new_url = cur->request->PostVarp(L"url");
|
||||
|
||||
if( new_subject )
|
||||
item.subject = *new_subject;
|
||||
|
||||
if( item.subject.empty() )
|
||||
{
|
||||
item.subject = request->dir_tab.back()->subject;
|
||||
item.subject = cur->request->dir_tab.back()->subject;
|
||||
item.subject += L"_msg_";
|
||||
Toa(db->Size(request->dir_tab.back()->id, Item::file), item.subject, 10, false);
|
||||
Toa(db->Size(cur->request->dir_tab.back()->id, Item::file), item.subject, 10, false);
|
||||
}
|
||||
|
||||
if( new_url )
|
||||
|
@ -475,13 +476,13 @@ void Functions::ReadItemFilterHtml(Item & item)
|
|||
html_filter.CheckOrphans(HTMLFilter::lang_none);
|
||||
html_filter.SafeMode(true);
|
||||
|
||||
html_filter.Filter(request->PostVar(L"itemcontent"), item.content);
|
||||
html_filter.Filter(cur->request->PostVar(L"itemcontent"), item.content);
|
||||
}
|
||||
|
||||
|
||||
void Functions::ReadItemContent(Item & item, const std::wstring & content_type)
|
||||
{
|
||||
bool is_root = request->session->puser && request->session->puser->super_user;
|
||||
bool is_root = cur->session->puser && cur->session->puser->super_user;
|
||||
bool filter_html = (content_type == L"2") && config->editors_html_safe_mode;
|
||||
|
||||
if( filter_html && is_root && config->editors_html_safe_mode_skip_root )
|
||||
|
@ -490,14 +491,14 @@ void Functions::ReadItemContent(Item & item, const std::wstring & content_type)
|
|||
if( filter_html )
|
||||
ReadItemFilterHtml(item);
|
||||
else
|
||||
request->PostVar(L"itemcontent", item.content);
|
||||
cur->request->PostVar(L"itemcontent", item.content);
|
||||
}
|
||||
|
||||
|
||||
void Functions::ReadItemContentWithType(Item & item)
|
||||
{
|
||||
item.content_type = Item::ct_formatted_text; // default is formatted text
|
||||
request->PostVar(L"contenttype", temp);
|
||||
cur->request->PostVar(L"contenttype", temp);
|
||||
|
||||
ReadItemContent(item, temp);
|
||||
|
||||
|
@ -513,10 +514,10 @@ void Functions::ReadItemContentWithType(Item & item)
|
|||
|
||||
// those below need special privileges
|
||||
|
||||
if( !request->session->puser )
|
||||
if( !cur->session->puser )
|
||||
return;
|
||||
|
||||
long user_id = request->session->puser->id;
|
||||
long user_id = cur->session->puser->id;
|
||||
|
||||
|
||||
if( temp == L"2" )
|
||||
|
@ -551,7 +552,7 @@ void Functions::ReadItem(Item & item, Item::Type item_type)
|
|||
return;
|
||||
|
||||
item.type = item_type;
|
||||
item.parent_id = request->dir_tab.back()->id; // !! moze to dac jako parametr?
|
||||
item.parent_id = cur->request->dir_tab.back()->id; // !! moze to dac jako parametr?
|
||||
|
||||
ReadItemUrlSubject(item, item_type);
|
||||
|
||||
|
@ -562,16 +563,16 @@ void Functions::ReadItem(Item & item, Item::Type item_type)
|
|||
|
||||
void Functions::SetUser(Item & item)
|
||||
{
|
||||
if( request->session && request->session->puser )
|
||||
if( cur->session && cur->session->puser )
|
||||
{
|
||||
item.user_id = request->session->puser->id;
|
||||
item.user_id = cur->session->puser->id;
|
||||
item.guest_name.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
item.user_id = -1;
|
||||
request->PostVar(L"guestname", item.guest_name);
|
||||
cur->request->PostVar(L"guestname", item.guest_name);
|
||||
}
|
||||
|
||||
item.group_id = request->dir_tab.back()->group_id;
|
||||
item.group_id = cur->request->dir_tab.back()->group_id;
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentfunctions
|
||||
#define headerfilecmslucontentfunctions
|
||||
#ifndef headerfile_winix_functions_functions
|
||||
#define headerfile_winix_functions_functions
|
||||
|
||||
#include <string>
|
||||
#include "functionbase.h"
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
|
||||
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetDb(Db * pdb);
|
||||
void SetSystem(System * psystem);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
private:
|
||||
|
||||
Config * config;
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
Db * db;
|
||||
System * system;
|
||||
Synchro * synchro;
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentlast
|
||||
#define headerfilecmslucontentlast
|
||||
#ifndef headerfile_winix_functions_last
|
||||
#define headerfile_winix_functions_last
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Ln::Ln()
|
|||
|
||||
bool Ln::HasAccess()
|
||||
{
|
||||
return system->HasWriteAccess(*request->dir_tab.back());
|
||||
return system->HasWriteAccess(*cur->request->dir_tab.back());
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,53 +33,53 @@ 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.parent_id = cur->request->dir_tab.back()->id;
|
||||
item.url = cur->request->PostVar(L"url");
|
||||
item.link_to = link_to;
|
||||
item.link_redirect = request->IsPostVar(L"makeredirect") ? 1 : 0;
|
||||
item.link_redirect = cur->request->IsPostVar(L"makeredirect") ? 1 : 0;
|
||||
item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
functions->SetUser(item);
|
||||
functions->PrepareUrl(item);
|
||||
|
||||
request->status = db->AddItem(item);
|
||||
cur->request->status = db->AddItem(item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->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);
|
||||
int res = system->FollowAllLinks(cur->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;
|
||||
cur->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.parent_id = cur->request->dir_tab.back()->id;
|
||||
item.url = cur->request->PostVar(L"url");
|
||||
item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
functions->SetUser(item);
|
||||
functions->PrepareUrl(item);
|
||||
request->status = db->AddHardLink(item);
|
||||
cur->request->status = db->AddHardLink(item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->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;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
}
|
||||
else
|
||||
{
|
||||
request->status = WINIX_ERR_NO_ITEM;
|
||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,20 +88,20 @@ void Ln::CreateHardLink(const std::wstring & link_to)
|
|||
// we do not use notifications for links
|
||||
void Ln::MakePost()
|
||||
{
|
||||
link_to = request->PostVar(L"linkto");
|
||||
link_to = cur->request->PostVar(L"linkto");
|
||||
TrimWhite(link_to);
|
||||
|
||||
if( link_to.empty() )
|
||||
return;
|
||||
|
||||
int type = Toi(request->PostVar(L"linktype"));
|
||||
int type = Toi(cur->request->PostVar(L"linktype"));
|
||||
|
||||
if( type == 0 )
|
||||
CreateHardLink(link_to);
|
||||
else
|
||||
CreateSymbolicLink(link_to);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
system->RedirectTo(item);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentln
|
||||
#define headerfilecmslucontentln
|
||||
#ifndef headerfile_winix_functions_ln
|
||||
#define headerfile_winix_functions_ln
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -22,15 +22,15 @@ Login::Login()
|
|||
|
||||
void Login::MakePost()
|
||||
{
|
||||
if( request->session->id == 0 )
|
||||
if( cur->session->id == 0 )
|
||||
{
|
||||
log << log1 << "Login: can't login in a temporary session (skipped)" << logend;
|
||||
return;
|
||||
}
|
||||
|
||||
const std::wstring & login = request->PostVar(L"login");
|
||||
const std::wstring & pass = request->PostVar(L"password");
|
||||
const std::wstring & remem = request->PostVar(L"rememberme");
|
||||
const std::wstring & login = cur->request->PostVar(L"login");
|
||||
const std::wstring & pass = cur->request->PostVar(L"password");
|
||||
const std::wstring & remem = cur->request->PostVar(L"rememberme");
|
||||
long user_id;
|
||||
|
||||
if( db->CheckUser(login, pass, user_id) )
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentlogin
|
||||
#define headerfilecmslucontentlogin
|
||||
#ifndef headerfile_winix_functions_login
|
||||
#define headerfile_winix_functions_login
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentlogout
|
||||
#define headerfilecmslucontentlogout
|
||||
#ifndef headerfile_winix_functions_logout
|
||||
#define headerfile_winix_functions_logout
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -23,23 +23,23 @@ Ls::Ls()
|
|||
|
||||
void Ls::MakeGet()
|
||||
{
|
||||
if( !request->is_item )
|
||||
if( !cur->request->is_item )
|
||||
{
|
||||
DbItemQuery iq;
|
||||
|
||||
iq.sel_content = false;
|
||||
|
||||
iq.WhereParentId(request->dir_tab.back()->id);
|
||||
iq.WhereParentId(cur->request->dir_tab.back()->id);
|
||||
iq.WhereType(Item::dir, false);
|
||||
|
||||
if( request->IsParam(L"ckeditor_browse") )
|
||||
if( cur->request->IsParam(L"ckeditor_browse") )
|
||||
{
|
||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE);
|
||||
db->GetItems(request->item_tab, iq);
|
||||
db->GetItems(cur->request->item_tab, iq);
|
||||
}
|
||||
else
|
||||
{
|
||||
db->GetItems(request->item_tab, iq);
|
||||
db->GetItems(cur->request->item_tab, iq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentls
|
||||
#define headerfilecmslucontentls
|
||||
#ifndef headerfile_winix_functions_ls
|
||||
#define headerfile_winix_functions_ls
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ bool Mkdir::HasAccess(const Item & item)
|
|||
if( item.type != Item::dir )
|
||||
return false;
|
||||
|
||||
if( request->session->puser && request->session->puser->super_user )
|
||||
if( cur->session->puser && cur->session->puser->super_user )
|
||||
// super user can use mkdir everywhere
|
||||
return true;
|
||||
|
||||
|
@ -40,7 +40,7 @@ bool Mkdir::HasAccess(const Item & item)
|
|||
if( !system->mounts.pmount->IsPar(system->mounts.MountParMkdirOn()) )
|
||||
return true;
|
||||
|
||||
if( system->mounts.pmount->IsArg(system->mounts.MountParMkdirOn(), request->dir_tab.size()) )
|
||||
if( system->mounts.pmount->IsArg(system->mounts.MountParMkdirOn(), cur->request->dir_tab.size()) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -49,7 +49,7 @@ return false;
|
|||
|
||||
bool Mkdir::HasAccess()
|
||||
{
|
||||
if( request->is_item || !HasAccess(*request->dir_tab.back()) )
|
||||
if( cur->request->is_item || !HasAccess(*cur->request->dir_tab.back()) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -60,19 +60,19 @@ return true;
|
|||
|
||||
void Mkdir::PostFunMkdir(bool add_to_dir_tab, int privileges)
|
||||
{
|
||||
functions->ReadItem(request->item, Item::dir);
|
||||
functions->SetUser(request->item);
|
||||
request->item.privileges = privileges;
|
||||
functions->ReadItem(cur->request->item, Item::dir);
|
||||
functions->SetUser(cur->request->item);
|
||||
cur->request->item.privileges = privileges;
|
||||
|
||||
request->status = system->dirs.AddDirectory(request->item, add_to_dir_tab);
|
||||
cur->request->status = system->dirs.AddDirectory(cur->request->item, add_to_dir_tab);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
system->RedirectTo(request->item);
|
||||
system->RedirectTo(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Content: PostFunMkdir: Error: " << request->status << logend;
|
||||
log << log1 << "Content: PostFunMkdir: Error: " << cur->request->status << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentmkdir
|
||||
#define headerfilecmslucontentmkdir
|
||||
#ifndef headerfile_winix_functions_mkdir
|
||||
#define headerfile_winix_functions_mkdir
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -35,15 +35,15 @@ Item * last;
|
|||
Item * last_but_one = 0;
|
||||
size_t dir_tab_size;
|
||||
|
||||
last = request->dir_tab.back();
|
||||
dir_tab_size = request->dir_tab.size();
|
||||
last = cur->request->dir_tab.back();
|
||||
dir_tab_size = cur->request->dir_tab.size();
|
||||
|
||||
if( dir_tab_size <= 1 )
|
||||
return false; // you cannot move the root directory
|
||||
|
||||
last_but_one = request->dir_tab[dir_tab_size - 2];
|
||||
last_but_one = cur->request->dir_tab[dir_tab_size - 2];
|
||||
|
||||
if( request->method != Request::post )
|
||||
if( cur->request->method != Request::post )
|
||||
{
|
||||
// used in GET or HEAD
|
||||
// we don't now whether we move the last directory or the last but one
|
||||
|
@ -56,7 +56,7 @@ size_t dir_tab_size;
|
|||
{
|
||||
// used in POST when the moving is performed
|
||||
|
||||
if( request->IsPostVar(L"onlycontent") )
|
||||
if( cur->request->IsPostVar(L"onlycontent") )
|
||||
return system->HasWriteAccess(*last);
|
||||
else
|
||||
return system->HasWriteAccess(*last_but_one);
|
||||
|
@ -70,13 +70,13 @@ return true;
|
|||
|
||||
bool Mv::CheckAccessFrom()
|
||||
{
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
// moving a file
|
||||
|
||||
if( !system->HasWriteAccess(*request->dir_tab.back()) )
|
||||
if( !system->HasWriteAccess(*cur->request->dir_tab.back()) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ bool Mv::CheckAccessFrom()
|
|||
{
|
||||
if( !CheckAccessFromToDir() )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ bool Mv::CheckAccessTo()
|
|||
!system->HasReadExecAccessToPath(dir_tab) ||
|
||||
!system->HasWriteAccess(*dir_tab.back()) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -112,14 +112,14 @@ return true;
|
|||
|
||||
bool Mv::ParseDir()
|
||||
{
|
||||
const std::wstring & new_dir = request->PostVar(L"to");
|
||||
int res = system->dirs.FollowLink(request->dir_tab, new_dir, dir_tab, file);
|
||||
const std::wstring & new_dir = cur->request->PostVar(L"to");
|
||||
int res = system->dirs.FollowLink(cur->request->dir_tab, new_dir, dir_tab, file);
|
||||
|
||||
if( res == 3 )
|
||||
request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
cur->request->status = WINIX_ERR_NO_ROOT_DIR;
|
||||
else
|
||||
if( res != 0 && res != 1 )
|
||||
request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
|
||||
return res == 0 || res == 1;
|
||||
}
|
||||
|
@ -142,7 +142,7 @@ bool Mv::MoveStaticFile(const std::wstring & from, const std::wstring & to)
|
|||
else
|
||||
{
|
||||
log << log1 << "Mv: can't move a file from: " << from << ", to: " << to << logend;
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -161,13 +161,13 @@ bool res1, res2, res3, res4, res5;
|
|||
|
||||
if( !res1 || !res2 || !res3 || !res4 || !res5 )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return;
|
||||
}
|
||||
|
||||
if( MoveStaticFile(old_path, new_path) )
|
||||
{
|
||||
request->status = db->EditFileById(item, item.id);
|
||||
cur->request->status = db->EditFileById(item, item.id);
|
||||
|
||||
if( item.has_thumb )
|
||||
MoveStaticFile(old_path_thumb, new_path_thumb);
|
||||
|
@ -189,9 +189,9 @@ void Mv::MoveFileOrSymlink(Item & item)
|
|||
}
|
||||
|
||||
item.parent_id = dir_tab.back()->id;
|
||||
request->status = db->EditParentUrlById(item, item.id);
|
||||
cur->request->status = db->EditParentUrlById(item, item.id);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
if( item.type == Item::file )
|
||||
log << log3 << "Mv: file: ";
|
||||
|
@ -280,13 +280,13 @@ void Mv::MoveDir(Item & dir)
|
|||
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;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
if( !system->dirs.ChangeParent(dir.id, dst_dir_id) )
|
||||
{
|
||||
request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -299,9 +299,9 @@ void Mv::MoveDir(Item & dir)
|
|||
file.clear();
|
||||
}
|
||||
|
||||
request->status = db->EditParentUrlById(dir, dir.id);
|
||||
cur->request->status = db->EditParentUrlById(dir, dir.id);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
{
|
||||
log << log3 << "Mv: directory: " << old_url << " was moved to: ";
|
||||
system->dirs.LogDir(dir_tab);
|
||||
|
@ -334,13 +334,13 @@ return false;
|
|||
|
||||
void Mv::PostMoveFile()
|
||||
{
|
||||
if( IsTheSameFile(request->item) )
|
||||
if( IsTheSameFile(cur->request->item) )
|
||||
return;
|
||||
|
||||
MoveFileOrSymlink(request->item);
|
||||
MoveFileOrSymlink(cur->request->item);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
system->RedirectTo(request->item);
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
system->RedirectTo(cur->request->item);
|
||||
}
|
||||
|
||||
|
||||
|
@ -349,14 +349,14 @@ void Mv::PostMoveDirContent()
|
|||
{
|
||||
if( !file.empty() )
|
||||
{
|
||||
request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
cur->request->status = WINIX_ERR_INCORRECT_DIR;
|
||||
return;
|
||||
}
|
||||
|
||||
if( request->dir_tab.back()->id == dir_tab.back()->id )
|
||||
if( cur->request->dir_tab.back()->id == dir_tab.back()->id )
|
||||
return; // nothing to do
|
||||
|
||||
MoveDirContent(*request->dir_tab.back());
|
||||
MoveDirContent(*cur->request->dir_tab.back());
|
||||
system->RedirectToLastDir();
|
||||
}
|
||||
|
||||
|
@ -364,7 +364,7 @@ void Mv::PostMoveDirContent()
|
|||
|
||||
void Mv::PostMoveDir()
|
||||
{
|
||||
Item & last_dir = *request->dir_tab.back();
|
||||
Item & last_dir = *cur->request->dir_tab.back();
|
||||
Item & new_dir = *dir_tab.back();
|
||||
|
||||
if( file.empty() && new_dir.id == last_dir.id )
|
||||
|
@ -372,7 +372,7 @@ void Mv::PostMoveDir()
|
|||
|
||||
MoveDir(last_dir);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
if( cur->request->status == WINIX_ERR_OK )
|
||||
system->RedirectToLastDir();
|
||||
}
|
||||
|
||||
|
@ -387,13 +387,13 @@ void Mv::MakePost()
|
|||
{
|
||||
Prepare();
|
||||
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
PostMoveFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
if( request->IsPostVar(L"onlycontent") )
|
||||
if( cur->request->IsPostVar(L"onlycontent") )
|
||||
PostMoveDirContent();
|
||||
else
|
||||
PostMoveDir();
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentmv
|
||||
#define headerfilecmslucontentmv
|
||||
#ifndef headerfile_winix_functions_mv
|
||||
#define headerfile_winix_functions_mv
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -21,14 +21,14 @@ Node::Node()
|
|||
|
||||
void Node::MakeGet()
|
||||
{
|
||||
if( request->param_tab.empty() )
|
||||
if( cur->request->param_tab.empty() )
|
||||
{
|
||||
//request->status = Error
|
||||
//cur->request->status = Error
|
||||
//!!zglosic 404
|
||||
return;
|
||||
}
|
||||
|
||||
long id = Tol(request->param_tab[0].name);
|
||||
long id = Tol(cur->request->param_tab[0].name);
|
||||
system->RedirectTo(id);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentnode
|
||||
#define headerfilecmslucontentnode
|
||||
#ifndef headerfile_winix_functions_node
|
||||
#define headerfile_winix_functions_node
|
||||
|
||||
#include "functionbase.h"
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ Priv::Priv()
|
|||
|
||||
void Priv::MakePost()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
@ -33,7 +33,7 @@ void Priv::MakePost()
|
|||
|
||||
void Priv::MakeGet()
|
||||
{
|
||||
priv_changer.SetRequest(request);
|
||||
priv_changer.SetCur(cur);
|
||||
priv_changer.SetSystem(system);
|
||||
priv_changer.SetDb(db);
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentpriv
|
||||
#define headerfilecmslucontentpriv
|
||||
#ifndef headerfile_winix_functions_priv
|
||||
#define headerfile_winix_functions_priv
|
||||
|
||||
#include "functionbase.h"
|
||||
#include "privchanger.h"
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#include "privchanger.h"
|
||||
|
||||
|
||||
void PrivChanger::SetRequest(Request * prequest)
|
||||
void PrivChanger::SetCur(Cur * pcur)
|
||||
{
|
||||
request = prequest;
|
||||
cur = pcur;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,9 +34,9 @@ bool PrivChanger::CheckAccess()
|
|||
// but we cannot use parameter 'r' on files
|
||||
// and only logged users can change permissions
|
||||
|
||||
if( !request->session->puser || (request->is_item && request->IsParam(L"r")) )
|
||||
if( !cur->session->puser || (cur->request->is_item && cur->request->IsParam(L"r")) )
|
||||
{
|
||||
request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ void PrivChanger::ChangePriv(Item & item, long user_id, long group_id, int privi
|
|||
return;
|
||||
}
|
||||
|
||||
request->status = db->EditPrivById(item, item.id);
|
||||
cur->request->status = db->EditPrivById(item, item.id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -174,12 +174,12 @@ void PrivChanger::PrivFilesInDir(long parent_id)
|
|||
iq.WhereParentId(parent_id);
|
||||
iq.WhereType(Item::dir, false);
|
||||
|
||||
db->GetItems(request->item_tab, iq);
|
||||
db->GetItems(cur->request->item_tab, iq);
|
||||
|
||||
|
||||
std::vector<Item>::iterator i = request->item_tab.begin();
|
||||
std::vector<Item>::iterator i = cur->request->item_tab.begin();
|
||||
|
||||
for( ; i != request->item_tab.end() ; ++i)
|
||||
for( ; i != cur->request->item_tab.end() ; ++i)
|
||||
{
|
||||
PrivLog(L"changed file: ", -1, i->url);
|
||||
ChangePriv(*i, user_id_file, group_id_file, priv_file);
|
||||
|
@ -210,9 +210,9 @@ void PrivChanger::PrivDir(long parent_id)
|
|||
void PrivChanger::ReadPriv(const wchar_t * user_in, const wchar_t * group_in, const wchar_t * priv_in,
|
||||
long & user_id, long & group_id, int & priv)
|
||||
{
|
||||
const std::wstring & user_str = request->PostVar(user_in);
|
||||
const std::wstring & group_str = request->PostVar(group_in);
|
||||
const std::wstring & priv_str = request->PostVar(priv_in);
|
||||
const std::wstring & user_str = cur->request->PostVar(user_in);
|
||||
const std::wstring & group_str = cur->request->PostVar(group_in);
|
||||
const std::wstring & priv_str = cur->request->PostVar(priv_in);
|
||||
|
||||
if( change_owner )
|
||||
{
|
||||
|
@ -234,18 +234,18 @@ void PrivChanger::PrivDir()
|
|||
PrivLogStart(L"Content: changes for dirs: ", user_id_dir, group_id_dir, priv_dir);
|
||||
|
||||
|
||||
if( request->IsPostVar(L"changecurrentdir") )
|
||||
if( cur->request->IsPostVar(L"changecurrentdir") )
|
||||
{
|
||||
Item & last_dir = *request->dir_tab.back();
|
||||
Item & last_dir = *cur->request->dir_tab.back();
|
||||
PrivLog(L"changed dir: ", last_dir.id, last_dir.url);
|
||||
ChangePriv(*request->dir_tab.back(), user_id_dir, group_id_dir, priv_dir);
|
||||
ChangePriv(*cur->request->dir_tab.back(), user_id_dir, group_id_dir, priv_dir);
|
||||
}
|
||||
|
||||
|
||||
subdirectories = request->IsPostVar(L"changesubdirs");
|
||||
subdirectories = cur->request->IsPostVar(L"changesubdirs");
|
||||
|
||||
// go through all directories
|
||||
PrivDir(request->dir_tab.back()->id);
|
||||
PrivDir(cur->request->dir_tab.back()->id);
|
||||
|
||||
system->RedirectToLastDir();
|
||||
}
|
||||
|
@ -258,14 +258,14 @@ void PrivChanger::PrivOneItem()
|
|||
ReadPriv(L"user", L"group", L"privileges", user_id_file, group_id_file, priv_file);
|
||||
PrivLogStart(L"Content: changes: ", user_id_file, group_id_file, priv_file);
|
||||
|
||||
if( request->is_item )
|
||||
if( cur->request->is_item )
|
||||
{
|
||||
ChangePriv(request->item, user_id_file, group_id_file, priv_file);
|
||||
system->RedirectTo(request->item);
|
||||
ChangePriv(cur->request->item, user_id_file, group_id_file, priv_file);
|
||||
system->RedirectTo(cur->request->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangePriv(*request->dir_tab.back(), user_id_file, group_id_file, priv_file);
|
||||
ChangePriv(*cur->request->dir_tab.back(), user_id_file, group_id_file, priv_file);
|
||||
system->RedirectToLastDir();
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ void PrivChanger::Change(bool change_owner_, bool change_priv_)
|
|||
change_owner = change_owner_;
|
||||
change_priv = change_priv_;
|
||||
|
||||
if( request->IsParam(L"r") )
|
||||
if( cur->request->IsParam(L"r") )
|
||||
{
|
||||
PrivDir();
|
||||
}
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfilecmslucontentprivchanger
|
||||
#define headerfilecmslucontentprivchanger
|
||||
#ifndef headerfile_winix_functions_privchanger
|
||||
#define headerfile_winix_functions_privchanger
|
||||
|
||||
|
||||
#include "core/request.h"
|
||||
|
@ -24,13 +24,13 @@ public:
|
|||
bool CheckAccess();
|
||||
void Change(bool change_owner_, bool change_priv_);
|
||||
|
||||
void SetRequest(Request * prequest);
|
||||
void SetCur(Cur * pcur);
|
||||
void SetSystem(System * psystem);
|
||||
void SetDb(Db * pdb);
|
||||
|
||||
private:
|
||||
|
||||
Request * request;
|
||||
Cur * cur;
|
||||
System * system;
|
||||
Db * db;
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue