added: TextStream a class similar to std::ostringstream

but with a Clear() method
       the dynamic allocated buffer can be easily reused
added: DbTextStream a special version of a stream
       used to create a database string query
       everything is escaped by default
added: DbBase a base class with some basic methods for communicating
       with the database
added: DbConn a class for managing connection to the database
changed: some refactoring in Db class       



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@655 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2010-09-18 00:51:12 +00:00
parent 8b1db3304f
commit a589e5a090
52 changed files with 3261 additions and 1913 deletions

View File

@ -19,12 +19,13 @@ all: winix
winix: FORCE
@cd core ; $(MAKE) -e
@cd db ; $(MAKE) -e
@cd functions ; $(MAKE) -e
@cd templates ; $(MAKE) -e
@cd templatesnotify ; $(MAKE) -e
@cd plugins/stats ; $(MAKE) -e
@cd ../ezc/src ; $(MAKE) -e
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o functions/*.o templates/*.o templatesnotify/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o db/*.o functions/*.o templates/*.o templatesnotify/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread
@cd main ; $(MAKE) -e
# use the full path with winix.so
$(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so
@ -33,6 +34,7 @@ winix: FORCE
clean:
@cd core ; $(MAKE) -e clean
@cd db ; $(MAKE) -e clean
@cd functions ; $(MAKE) -e clean
@cd templates ; $(MAKE) -e clean
@cd templatesnotify ; $(MAKE) -e clean
@ -48,6 +50,7 @@ FORCE:
depend:
@cd core ; $(MAKE) -e depend
@cd db ; $(MAKE) -e depend
@cd functions ; $(MAKE) -e depend
@cd templates ; $(MAKE) -e depend
@cd templatesnotify ; $(MAKE) -e depend

View File

@ -2,16 +2,19 @@
acceptbaseparser.o: acceptbaseparser.h
app.o: app.h config.h confparser.h htmlfilter.h system.h dirs.h item.h
app.o: dircontainer.h db.h user.h group.h thread.h error.h log.h
app.o: ugcontainer.h ticket.h request.h requesttypes.h session.h plugindata.h
app.o: rebus.h mounts.h mount.h mountparser.h users.h lastcontainer.h
app.o: groups.h loadavg.h sessionmanager.h sessioncontainer.h notify.h
app.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
app.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
app.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
app.o: ../core/thread.h ../core/error.h log.h ../core/dircontainer.h
app.o: ../core/ugcontainer.h ../core/ticket.h request.h requesttypes.h
app.o: session.h error.h user.h plugindata.h rebus.h mounts.h mount.h
app.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h group.h
app.o: loadavg.h sessionmanager.h sessioncontainer.h notify.h
app.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
app.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
app.o: ../templates/localefilter.h ../core/locale.h ../functions/functions.h
app.o: ../functions/functionbase.h ../core/item.h ../core/db.h
app.o: ../core/request.h ../core/system.h ../core/notify.h
app.o: ../functions/functionparser.h ../functions/adduser.h
app.o: ../functions/functionbase.h ../core/request.h ../core/system.h
app.o: ../core/notify.h ../functions/functionparser.h ../functions/adduser.h
app.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
app.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
app.o: ../functions/createthread.h ../functions/createticket.h
@ -21,12 +24,11 @@ app.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
app.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
app.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
app.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
app.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
app.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
app.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
app.o: ../core/htmlfilter.h ../templates/templates.h
app.o: ../templates/patterncacher.h ../core/item.h misc.h
app.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../functions/funticket.h ../functions/template.h
app.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
app.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
app.o: ../templates/templates.h ../templates/patterncacher.h ../core/item.h
app.o: misc.h ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../core/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
@ -35,11 +37,15 @@ bbcodeparser.o: bbcodeparser.h htmlfilter.h
compress.o: compress.h log.h
config.o: config.h confparser.h htmlfilter.h log.h plugin.h pluginmsg.h
config.o: plugindata.h request.h requesttypes.h session.h item.h error.h
config.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h thread.h
config.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
config.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
config.o: sessioncontainer.h ../functions/functions.h
config.o: ../functions/functionbase.h ../core/item.h ../core/db.h
config.o: user.h rebus.h system.h dirs.h dircontainer.h ../db/db.h
config.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
config.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
config.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
config.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
config.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
config.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
config.o: group.h loadavg.h sessionmanager.h sessioncontainer.h
config.o: ../functions/functions.h ../functions/functionbase.h
config.o: ../core/request.h ../core/config.h ../core/system.h
config.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
config.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
@ -52,30 +58,32 @@ config.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
config.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
config.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
config.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
config.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
config.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
config.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
config.o: ../core/htmlfilter.h ../templates/templates.h
config.o: ../templates/patterncacher.h ../core/item.h misc.h
config.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
config.o: ../core/log.h ../templates/indexpatterns.h
config.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
config.o: ../core/sessionmanager.h
config.o: ../functions/funticket.h ../functions/template.h
config.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
config.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
config.o: ../templates/templates.h ../templates/patterncacher.h
config.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
config.o: ../core/httpsimpleparser.h ../core/log.h
config.o: ../templates/indexpatterns.h ../templates/localefilter.h
config.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
confparser.o: confparser.h misc.h item.h
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
db.o: ugcontainer.h ticket.h misc.h
db_itemcolumns.o: db.h item.h user.h group.h thread.h error.h log.h
db_itemcolumns.o: dircontainer.h ugcontainer.h ticket.h
dircontainer.o: dircontainer.h item.h log.h
dirs.o: dirs.h item.h dircontainer.h db.h user.h group.h thread.h error.h
dirs.o: log.h ugcontainer.h ticket.h request.h requesttypes.h session.h
dirs.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h notify.h
dirs.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
dirs.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
dirs.o: ../templates/localefilter.h ../core/locale.h system.h mounts.h
dirs.o: mount.h mountparser.h users.h lastcontainer.h groups.h loadavg.h
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
groups.o: error.h dircontainer.h ticket.h
dirs.o: dirs.h item.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
dirs.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
dirs.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
dirs.o: ../core/thread.h ../core/error.h log.h ../core/dircontainer.h
dirs.o: ../core/ugcontainer.h ../core/ticket.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 notify.h ../templatesnotify/templatesnotify.h
dirs.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h ../core/config.h
dirs.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
dirs.o: system.h mounts.h mount.h mountparser.h users.h ugcontainer.h
dirs.o: lastcontainer.h groups.h group.h loadavg.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
groups.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
groups.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
groups.o: log.h ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
htmlfilter.o: htmlfilter.h
httpsimpleparser.o: httpsimpleparser.h
lastcontainer.o: lastcontainer.h log.h
@ -84,22 +92,29 @@ locale.o: locale.h confparser.h log.h
log.o: log.h
misc.o: misc.h item.h log.h
mount.o: mount.h
mountparser.o: mountparser.h mount.h item.h error.h log.h dirs.h
mountparser.o: dircontainer.h db.h user.h group.h thread.h ugcontainer.h
mountparser.o: ticket.h request.h requesttypes.h session.h plugindata.h
mountparser.o: rebus.h config.h confparser.h htmlfilter.h misc.h
mounts.o: mounts.h mount.h error.h log.h dirs.h item.h dircontainer.h db.h
mounts.o: user.h group.h thread.h ugcontainer.h ticket.h request.h
mounts.o: requesttypes.h session.h plugindata.h rebus.h config.h confparser.h
mountparser.o: mountparser.h mount.h item.h error.h dirs.h dircontainer.h
mountparser.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
mountparser.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
mountparser.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
mountparser.o: ../core/thread.h ../core/error.h log.h ../core/dircontainer.h
mountparser.o: ../core/ugcontainer.h ../core/ticket.h request.h
mountparser.o: requesttypes.h session.h user.h plugindata.h rebus.h config.h
mountparser.o: confparser.h htmlfilter.h misc.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 ../db/dbitemquery.h ../core/item.h
mounts.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
mounts.o: ../core/thread.h ../core/error.h log.h ../core/dircontainer.h
mounts.o: ../core/ugcontainer.h ../core/ticket.h request.h requesttypes.h
mounts.o: session.h user.h plugindata.h rebus.h config.h confparser.h
mounts.o: htmlfilter.h mountparser.h plugin.h pluginmsg.h system.h users.h
mounts.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
mounts.o: sessioncontainer.h ../functions/functions.h
mounts.o: ../functions/functionbase.h ../core/item.h ../core/db.h
mounts.o: ../core/request.h ../core/config.h ../core/system.h
mounts.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
mounts.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
mounts.o: ../functions/privchanger.h ../functions/chown.h
mounts.o: ../functions/ckeditor.h ../functions/cp.h
mounts.o: ugcontainer.h lastcontainer.h groups.h group.h loadavg.h
mounts.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
mounts.o: ../functions/functionbase.h ../core/request.h ../core/config.h
mounts.o: ../core/system.h ../core/notify.h ../../ezc/src/ezc.h
mounts.o: ../functions/functionparser.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/createthread.h ../functions/createticket.h
mounts.o: ../functions/default.h ../functions/download.h
mounts.o: ../functions/editticket.h ../functions/emacs.h ../functions/last.h
@ -107,30 +122,37 @@ mounts.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
mounts.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
mounts.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
mounts.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
mounts.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
mounts.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
mounts.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
mounts.o: ../core/htmlfilter.h ../templates/templates.h
mounts.o: ../templates/patterncacher.h ../core/item.h misc.h
mounts.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
mounts.o: ../core/log.h ../templates/indexpatterns.h
mounts.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
mounts.o: ../core/sessionmanager.h
mounts.o: ../functions/funticket.h ../functions/template.h
mounts.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
mounts.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
mounts.o: ../templates/templates.h ../templates/patterncacher.h
mounts.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
mounts.o: ../core/httpsimpleparser.h ../core/log.h
mounts.o: ../templates/indexpatterns.h ../templates/localefilter.h
mounts.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
notify.o: log.h notify.h ../templatesnotify/templatesnotify.h
notify.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h confparser.h
notify.o: ../core/config.h ../templates/misc.h ../templates/localefilter.h
notify.o: ../core/locale.h request.h requesttypes.h session.h item.h error.h
notify.o: user.h plugindata.h rebus.h config.h htmlfilter.h system.h dirs.h
notify.o: dircontainer.h db.h group.h thread.h ugcontainer.h ticket.h
notify.o: mounts.h mount.h mountparser.h users.h lastcontainer.h groups.h
notify.o: loadavg.h misc.h
notify.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
notify.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
notify.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
notify.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
notify.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
notify.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
notify.o: group.h loadavg.h misc.h
plugin.o: plugin.h pluginmsg.h log.h plugindata.h config.h confparser.h
plugin.o: htmlfilter.h request.h requesttypes.h session.h item.h error.h
plugin.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h thread.h
plugin.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
plugin.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
plugin.o: sessioncontainer.h ../functions/functions.h
plugin.o: ../functions/functionbase.h ../core/item.h ../core/db.h
plugin.o: user.h rebus.h system.h dirs.h dircontainer.h ../db/db.h
plugin.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
plugin.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
plugin.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
plugin.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
plugin.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
plugin.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
plugin.o: group.h loadavg.h sessionmanager.h sessioncontainer.h
plugin.o: ../functions/functions.h ../functions/functionbase.h
plugin.o: ../core/request.h ../core/config.h ../core/system.h
plugin.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
plugin.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
@ -143,22 +165,25 @@ plugin.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
plugin.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
plugin.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
plugin.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
plugin.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
plugin.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
plugin.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
plugin.o: ../core/htmlfilter.h ../templates/templates.h
plugin.o: ../templates/patterncacher.h ../core/item.h misc.h
plugin.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
plugin.o: ../core/log.h ../templates/indexpatterns.h
plugin.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
plugin.o: ../core/sessionmanager.h
plugin.o: ../functions/funticket.h ../functions/template.h
plugin.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
plugin.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
plugin.o: ../templates/templates.h ../templates/patterncacher.h
plugin.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugin.o: ../core/httpsimpleparser.h ../core/log.h
plugin.o: ../templates/indexpatterns.h ../templates/localefilter.h
plugin.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h config.h confparser.h
plugindata.o: htmlfilter.h request.h requesttypes.h session.h item.h error.h
plugindata.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h
plugindata.o: thread.h ugcontainer.h ticket.h mounts.h mount.h mountparser.h
plugindata.o: users.h lastcontainer.h groups.h loadavg.h sessionmanager.h
plugindata.o: sessioncontainer.h ../functions/functions.h
plugindata.o: ../functions/functionbase.h ../core/item.h ../core/db.h
plugindata.o: user.h rebus.h system.h dirs.h dircontainer.h ../db/db.h
plugindata.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
plugindata.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
plugindata.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
plugindata.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
plugindata.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
plugindata.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
plugindata.o: group.h loadavg.h sessionmanager.h sessioncontainer.h
plugindata.o: ../functions/functions.h ../functions/functionbase.h
plugindata.o: ../core/request.h ../core/config.h ../core/system.h
plugindata.o: ../core/notify.h ../../ezc/src/ezc.h
plugindata.o: ../functions/functionparser.h ../functions/adduser.h
@ -172,8 +197,7 @@ plugindata.o: ../functions/last.h ../functions/login.h ../functions/logout.h
plugindata.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
plugindata.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
plugindata.o: ../functions/rm.h ../functions/run.h ../functions/subject.h
plugindata.o: ../functions/funthread.h ../core/thread.h
plugindata.o: ../functions/funticket.h ../core/ticket.h
plugindata.o: ../functions/funthread.h ../functions/funticket.h
plugindata.o: ../functions/template.h ../functions/tinymce.h
plugindata.o: ../functions/uname.h ../functions/upload.h
plugindata.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
@ -182,17 +206,21 @@ plugindata.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugindata.o: ../core/httpsimpleparser.h ../core/log.h
plugindata.o: ../templates/indexpatterns.h ../templates/localefilter.h
plugindata.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h config.h
postmultiparser.o: confparser.h htmlfilter.h
postmultiparser.o: postmultiparser.h error.h requesttypes.h config.h
postmultiparser.o: confparser.h htmlfilter.h log.h
rebus.o: log.h rebus.h misc.h item.h request.h requesttypes.h session.h
rebus.o: error.h user.h plugindata.h config.h confparser.h htmlfilter.h
request.o: request.h requesttypes.h session.h item.h error.h log.h user.h
request.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h plugin.h
request.o: pluginmsg.h system.h dirs.h dircontainer.h db.h group.h thread.h
request.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h users.h
request.o: lastcontainer.h groups.h loadavg.h sessionmanager.h
request.o: sessioncontainer.h ../functions/functions.h
request.o: ../functions/functionbase.h ../core/item.h ../core/db.h
request.o: request.h requesttypes.h session.h item.h error.h user.h
request.o: plugindata.h rebus.h config.h confparser.h htmlfilter.h log.h
request.o: plugin.h pluginmsg.h system.h dirs.h dircontainer.h ../db/db.h
request.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
request.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
request.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
request.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
request.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
request.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
request.o: group.h loadavg.h sessionmanager.h sessioncontainer.h
request.o: ../functions/functions.h ../functions/functionbase.h
request.o: ../core/request.h ../core/config.h ../core/system.h
request.o: ../core/notify.h ../../ezc/src/ezc.h ../functions/functionparser.h
request.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
@ -205,26 +233,29 @@ request.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
request.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
request.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
request.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
request.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
request.o: ../functions/template.h ../functions/tinymce.h
request.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
request.o: ../functions/who.h ../core/htmlfilter.h ../templates/templates.h
request.o: ../templates/patterncacher.h ../core/item.h misc.h
request.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
request.o: ../core/log.h ../templates/indexpatterns.h
request.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
request.o: ../core/sessionmanager.h
session.o: session.h item.h error.h log.h user.h plugindata.h rebus.h
sessioncontainer.o: sessioncontainer.h session.h item.h error.h log.h user.h
sessioncontainer.o: plugindata.h rebus.h lastcontainer.h
request.o: ../functions/funticket.h ../functions/template.h
request.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
request.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
request.o: ../templates/templates.h ../templates/patterncacher.h
request.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
request.o: ../core/httpsimpleparser.h ../core/log.h
request.o: ../templates/indexpatterns.h ../templates/localefilter.h
request.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
session.o: session.h item.h error.h user.h plugindata.h rebus.h
sessioncontainer.o: sessioncontainer.h session.h item.h error.h user.h
sessioncontainer.o: plugindata.h rebus.h lastcontainer.h log.h
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
sessionmanager.o: error.h log.h user.h plugindata.h rebus.h lastcontainer.h
sessionmanager.o: error.h user.h plugindata.h rebus.h lastcontainer.h
sessionmanager.o: config.h confparser.h htmlfilter.h request.h requesttypes.h
sessionmanager.o: system.h dirs.h dircontainer.h db.h group.h thread.h
sessionmanager.o: ugcontainer.h ticket.h mounts.h mount.h mountparser.h
sessionmanager.o: users.h groups.h loadavg.h sessionparser.h plugin.h
sessionmanager.o: pluginmsg.h ../functions/functions.h
sessionmanager.o: ../functions/functionbase.h ../core/item.h ../core/db.h
sessionmanager.o: system.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
sessionmanager.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
sessionmanager.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
sessionmanager.o: ../core/user.h ../core/group.h ../core/thread.h
sessionmanager.o: ../core/error.h log.h ../core/dircontainer.h
sessionmanager.o: ../core/ugcontainer.h ../core/ticket.h mounts.h mount.h
sessionmanager.o: mountparser.h users.h ugcontainer.h groups.h group.h
sessionmanager.o: loadavg.h sessionparser.h plugin.h pluginmsg.h
sessionmanager.o: ../functions/functions.h ../functions/functionbase.h
sessionmanager.o: ../core/request.h ../core/config.h ../core/system.h
sessionmanager.o: ../core/notify.h ../../ezc/src/ezc.h
sessionmanager.o: ../functions/functionparser.h ../functions/adduser.h
@ -239,8 +270,7 @@ sessionmanager.o: ../functions/logout.h ../functions/ls.h
sessionmanager.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
sessionmanager.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
sessionmanager.o: ../functions/run.h ../functions/subject.h
sessionmanager.o: ../functions/funthread.h ../core/thread.h
sessionmanager.o: ../functions/funticket.h ../core/ticket.h
sessionmanager.o: ../functions/funthread.h ../functions/funticket.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
@ -250,20 +280,32 @@ sessionmanager.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
sessionmanager.o: ../core/log.h ../templates/indexpatterns.h
sessionmanager.o: ../templates/localefilter.h ../core/locale.h
sessionmanager.o: ../core/locale.h ../core/sessionmanager.h
sessionparser.o: sessionparser.h session.h item.h error.h log.h user.h
sessionparser.o: plugindata.h rebus.h sessioncontainer.h lastcontainer.h
sessionparser.o: users.h ugcontainer.h request.h requesttypes.h config.h
sessionparser.o: confparser.h htmlfilter.h db.h group.h thread.h
sessionparser.o: dircontainer.h ticket.h
system.o: system.h dirs.h item.h dircontainer.h db.h user.h group.h thread.h
system.o: error.h log.h ugcontainer.h ticket.h request.h requesttypes.h
system.o: session.h plugindata.h rebus.h config.h confparser.h htmlfilter.h
system.o: mounts.h mount.h mountparser.h users.h lastcontainer.h groups.h
system.o: loadavg.h misc.h notify.h ../templatesnotify/templatesnotify.h
system.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h
system.o: ../core/config.h ../templates/misc.h ../templates/localefilter.h
system.o: ../core/locale.h
users.o: users.h user.h ugcontainer.h log.h lastcontainer.h request.h
sessionparser.o: sessionparser.h session.h item.h error.h user.h plugindata.h
sessionparser.o: rebus.h sessioncontainer.h lastcontainer.h users.h
sessionparser.o: ugcontainer.h request.h requesttypes.h config.h confparser.h
sessionparser.o: htmlfilter.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
sessionparser.o: ../db/dbtextstream.h ../core/textstream.h
sessionparser.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
sessionparser.o: ../core/user.h ../core/group.h ../core/thread.h
sessionparser.o: ../core/error.h log.h ../core/dircontainer.h
sessionparser.o: ../core/ugcontainer.h ../core/ticket.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
system.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
system.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
system.o: log.h ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
system.o: request.h requesttypes.h session.h error.h user.h plugindata.h
system.o: rebus.h config.h confparser.h htmlfilter.h mounts.h mount.h
system.o: mountparser.h users.h ugcontainer.h lastcontainer.h groups.h
system.o: group.h loadavg.h misc.h notify.h
system.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
system.o: ../core/mount.h ../core/locale.h ../core/config.h
system.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
textstream.o: textstream.h
users.o: users.h user.h ugcontainer.h lastcontainer.h request.h
users.o: requesttypes.h session.h item.h error.h plugindata.h rebus.h
users.o: config.h confparser.h htmlfilter.h db.h group.h thread.h
users.o: dircontainer.h ticket.h
users.o: config.h confparser.h htmlfilter.h ../db/db.h ../db/dbbase.h
users.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
users.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
users.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
users.o: log.h ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h

View File

@ -1 +1 @@
o = acceptbaseparser.o app.o bbcodeparser.o compress.o config.o confparser.o db.o db_itemcolumns.o dircontainer.o dirs.o groups.o htmlfilter.o httpsimpleparser.o lastcontainer.o loadavg.o locale.o log.o misc.o mount.o mountparser.o mounts.o notify.o plugin.o plugindata.o postmultiparser.o rebus.o request.o session.o sessioncontainer.o sessionmanager.o sessionparser.o system.o users.o
o = acceptbaseparser.o app.o bbcodeparser.o compress.o config.o confparser.o dircontainer.o dirs.o groups.o htmlfilter.o httpsimpleparser.o lastcontainer.o loadavg.o locale.o log.o misc.o mount.o mountparser.o mounts.o notify.o plugin.o plugindata.o postmultiparser.o rebus.o request.o session.o sessioncontainer.o sessionmanager.o sessionparser.o system.o textstream.o users.o

View File

@ -21,6 +21,8 @@ App::App()
stdout_is_closed = false;
last_sessions_save = time(0);
db.SetConn(db_conn);
plugin.SetDb(&db);
plugin.SetConfig(&config);
plugin.SetRequest(&request);
@ -131,8 +133,9 @@ return true;
bool App::Init()
{
db.Init(config.db_database, config.db_user, config.db_pass);
db.WaitForConnection();
db_conn.SetConnParam(config.db_database, config.db_user, config.db_pass);
db_conn.WaitForConnection();
db.LogQueries(config.log_db_query);
if( !CreateFCGISocket() )
return false;

View File

@ -25,7 +25,7 @@
#include "request.h"
#include "sessionmanager.h"
#include "notify.h"
#include "db.h"
#include "db/db.h"
#include "functions/functions.h"
#include "templates/templates.h"
#include "templatesnotify/templatesnotify.h"
@ -67,7 +67,7 @@ public:
// database
Db db;
DbConn db_conn;

View File

@ -99,6 +99,7 @@ void Config::AssignValues(bool stdout_is_closed)
log_level = Int("log_level", 1);
log_request = Int("log_request", 1);
log_stdout = Bool("log_stdout", false);
log_db_query = Bool("log_db_query", false);
post_file_max = Int("post_file_max", 8388608); // 8 MB
auth_simplefs_dir = Text("auth_simplefs_dir");

View File

@ -39,6 +39,10 @@ public:
// default: 1
int log_request;
// logging db queries
// default: false
bool log_db_query;
// request delimiter in the log file, default "---------"
std::string log_delimiter;

View File

@ -17,7 +17,7 @@
#include "item.h"
#include "dircontainer.h"
#include "db.h"
#include "db/db.h"
#include "request.h"

View File

@ -14,7 +14,7 @@
#include "group.h"
#include "ugcontainer.h"
#include "db.h"
#include "db/db.h"

View File

@ -10,7 +10,7 @@
#include "mounts.h"
#include "request.h"
#include "log.h"
#include "db.h"
#include "db/db.h"
#include "plugin.h"

View File

@ -18,7 +18,7 @@
#include "mount.h"
#include "error.h"
#include "dirs.h"
#include "db.h"
#include "db/db.h"
#include "request.h"
#include "mountparser.h"

View File

@ -13,7 +13,7 @@
#include "dirs.h"
#include "mounts.h"
#include "db.h"
#include "db/db.h"
#include "request.h"
#include "config.h"
#include "users.h"

126
core/textstream.cpp Executable file
View File

@ -0,0 +1,126 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "textstream.h"
void TextStream::Clear()
{
buffer.clear();
}
const std::string & TextStream::Str() const
{
return buffer;
}
const char * TextStream::CStr() const
{
return buffer.c_str();
}
TextStream & TextStream::operator<<(const char * str)
{
buffer += str;
return *this;
}
TextStream & TextStream::operator<<(const std::string * str)
{
buffer += *str;
return *this;
}
TextStream & TextStream::operator<<(const std::string & str)
{
buffer += str;
return *this;
}
TextStream & TextStream::operator<<(char v)
{
buffer += v;
return *this;
}
TextStream & TextStream::operator<<(int v)
{
char buf[50];
sprintf(buf, "%d", v);
buffer += buf;
return *this;
}
TextStream & TextStream::operator<<(long v)
{
char buf[50];
sprintf(buf, "%ld", v);
buffer += buf;
return *this;
}
TextStream & TextStream::operator<<(unsigned int v)
{
char buf[50];
sprintf(buf, "%u", v);
buffer += buf;
return *this;
}
TextStream & TextStream::operator<<(unsigned long v)
{
char buf[50];
sprintf(buf, "%lu", v);
buffer += buf;
return *this;
}
TextStream & TextStream::operator<<(double v)
{
char buf[50];
sprintf(buf, "%f", v);
buffer += buf;
return *this;
}
TextStream & TextStream::operator<<(const void * v)
{
char buf[50];
sprintf(buf, "%p", v);
buffer += buf;
return *this;
}

47
core/textstream.h Executable file
View File

@ -0,0 +1,47 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_core_textstream
#define headerfile_winix_core_textstream
#include <string>
class TextStream
{
public:
void Clear();
const std::string & Str() const;
const char * CStr() const;
TextStream & operator<<(const char * str);
TextStream & operator<<(const std::string * str);
TextStream & operator<<(const std::string & str);
TextStream & operator<<(char);
TextStream & operator<<(int);
TextStream & operator<<(long);
TextStream & operator<<(unsigned int);
TextStream & operator<<(unsigned long);
TextStream & operator<<(double);
TextStream & operator<<(const void *);// printing a pointer
protected:
std::string buffer;
};
#endif

View File

@ -15,7 +15,7 @@
#include "ugcontainer.h"
#include "lastcontainer.h"
#include "request.h"
#include "db.h"
#include "db/db.h"
class Users

22
db/Makefile Executable file
View File

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

15
db/Makefile.dep Executable file
View File

@ -0,0 +1,15 @@
# DO NOT DELETE
db.o: db.h dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
db.o: dbitemquery.h ../core/item.h dbitemcolumns.h ../core/user.h
db.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
db.o: ../core/dircontainer.h ../core/item.h ../core/ugcontainer.h
db.o: ../core/ticket.h ../core/log.h ../core/misc.h
dbbase.o: dbbase.h dbconn.h dbtextstream.h ../core/textstream.h ../core/log.h
dbbase.o: ../core/error.h ../core/log.h
dbconn.o: dbconn.h dbtextstream.h ../core/textstream.h ../core/log.h
dbconn.o: ../core/error.h ../core/log.h
dbitemcolumns.o: dbitemcolumns.h ../core/item.h dbbase.h dbconn.h
dbitemcolumns.o: dbtextstream.h ../core/textstream.h
dbitemquery.o: dbitemquery.h ../core/item.h
dbtextstream.o: dbtextstream.h ../core/textstream.h

1
db/Makefile.o.dep Executable file
View File

@ -0,0 +1 @@
o = db.o dbbase.o dbconn.o dbitemcolumns.o dbitemquery.o dbtextstream.o

1424
db/db.cpp

File diff suppressed because it is too large Load Diff

169
db/db.h
View File

@ -7,43 +7,41 @@
*
*/
#ifndef headerfilecmslucoredb
#define headerfilecmslucoredb
#ifndef headerfile_winix_db_db
#define headerfile_winix_db_db
#include <string>
#include <vector>
#include <map>
#include <sstream>
#include <libpq-fe.h>
#include <cstdio>
#include <ctime>
#include <cstring>
#include "item.h"
#include "user.h"
#include "group.h"
#include "thread.h"
#include "error.h"
#include "dircontainer.h"
#include "ugcontainer.h"
#include "ticket.h"
#include "dbbase.h"
#include "dbitemquery.h"
#include "dbitemcolumns.h"
#include "core/item.h"
#include "core/user.h"
#include "core/group.h"
#include "core/thread.h"
#include "core/error.h"
#include "core/dircontainer.h"
#include "core/ugcontainer.h"
#include "core/ticket.h"
class Db
class Db : public DbBase
{
public:
Db(bool close_at_end_ = true);
~Db();
// !! przerobic tak aby GetItem zwracalo wszystkie pozycja
// !! GetFile tylko dla plikow
// !! GetDir tylko dla katalogow
// !! GetFile i GetDir beda uzywac GetItem
void Init(const std::string & database, const std::string & user, const std::string & pass);
void WaitForConnection();
bool CheckUser(const std::string & login, const std::string & password, long & user_id);
Error AddUser(User & user, const std::string & password);
@ -54,91 +52,9 @@ public:
void CheckAllUrlSubject();
struct ItemQuery
{
// id is selected always
bool sel_parent_id; // parent_id
bool sel_user_id; // user_id, modification_user_id
bool sel_group_id; // group_id
bool sel_guest_name; // guest_name
bool sel_privileges; // privileges
bool sel_date; // date_creation, date_modification
bool sel_subject; // subject
bool sel_content; // content, content_type, (content_id)
bool sel_url; // url
bool sel_type; // type (dir, file, none)
bool sel_default_item; // default_item
bool sel_auth; // auth, auth_path
bool sel_html_template; // template
bool where_id; //
bool where_parent_id; //
bool where_type;
bool where_auth;
long id; // if where_id is true
long parent_id; // if where_parent_id is true
Item::Type type;
Item::Auth auth;
bool auth_equal; // if true means auth should be equal
bool sort_asc;
void SetAllSel(bool sel)
{
sel_parent_id = sel;
sel_user_id = sel;
sel_group_id = sel;
sel_guest_name = sel;
sel_privileges = sel;
sel_date = sel;
sel_subject = sel;
sel_content = sel;
sel_url = sel;
sel_type = sel;
sel_default_item= sel;
sel_auth = sel;
sel_html_template= sel;
}
void SetAllWhere(bool where_)
{
where_id = where_;
where_parent_id = where_;
where_type = where_;
where_auth = where_;
}
void SetAll(bool sel, bool where_)
{
SetAllSel(sel);
SetAllWhere(where_);
}
void WhereId(long id_) { where_id = true; id = id_; }
void WhereParentId(long parent_id_) { where_parent_id = true; parent_id = parent_id_; }
void WhereType(Item::Type type_) { where_type = true; type = type_; }
void WhereAuth(Item::Auth st,
bool equal = true) { where_auth = true; auth = st; auth_equal = equal; }
ItemQuery()
{
sort_asc = true;
auth_equal = true;
SetAll(true, false);
id = -1;
parent_id = -1;
type = Item::none;
auth = Item::auth_none;
}
};
void GetItems(std::vector<Item> & item_tab, const ItemQuery & item_query);
void GetItems(std::vector<long> & item_tab, const ItemQuery & item_query);
void GetItems(std::vector<Item> & item_tab, const DbItemQuery & item_query);
void GetItems(std::vector<long> & item_tab, const DbItemQuery & item_query);
// !! pobiera tylko jeden item (cos wymyslec innego z nazwa albo argumentem)
@ -171,12 +87,6 @@ public:
long GetFileId(long parent_id, const std::string & url);
long GetDirId(long parent_id, const std::string & url);
static tm ConvertTime(const char * str);
static const char * ConvertTime(const tm & t);
PGconn * GetPGconn();
virtual void Connect();
Error AddThread(Thread & thread);
@ -197,24 +107,9 @@ public:
protected:
PGconn * pg_conn;
std::string db_database, db_user, db_pass;
bool close_at_end;
void SetDbParameters();
void Close();
bool AssertConnection(bool put_log = true, bool throw_if_no_connection = true);
DbTextStream query, query_create_url;
std::string temp_url;
std::string Escape(const std::string & s);
std::string Escape(const char * s);
PGresult * AssertQuery(const std::string & q);
void AssertResultStatus(PGresult * r, ExecStatusType t);
static int AssertColumn(PGresult * r, const char * column_name);
static const char * AssertValue(PGresult * r, int row, int col);
void ClearResult(PGresult * r);
long AssertCurrval(const char * table);
bool AddItemCreateUrlSubject(Item & item);
Error AddItemIntoContent(Item & item);
@ -227,24 +122,15 @@ protected:
void CheckAllUrlSubjectModifyItem(Item & item);
PGresult * GetItemsQuery(const ItemQuery & iq, bool skip_other_sel = false);
PGresult * GetItemsQuery(const DbItemQuery & iq, bool skip_other_sel = false);
bool DelItemDelItem(const Item & item);
void DelItemDelContent(const Item & item);
Error DelItemCountContents(const Item & item, long & contents);
struct ItemColumns
{
int id, user_id, group_id, privileges, date_creation, date_modification, url, type, parent_id,
content_id, default_item, subject, content, content_type, guest_name, auth, auth_path,
modification_user_id, html_template;
void SetColumns(PGresult * r);
void SetItem(PGresult * r, long row, Item & item);
};
// !! tymczasowo
// bedzie wszystko w osobnym pluginie
struct TicketColumns
{
int id, dir_id, parent_id, type, status, priority, category, expected, progress, item_id;
@ -253,10 +139,7 @@ protected:
void SetTicket(PGresult * r, long row, Ticket & ticket);
};
}; // class Db
};
#endif

View File

@ -1,99 +0,0 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "db.h"
void Db::ItemColumns::SetColumns(PGresult * r)
{
// PQfnumber returns -1 if there is no such a column
id = PQfnumber(r, "id");
user_id = PQfnumber(r, "user_id");
group_id = PQfnumber(r, "group_id");
privileges = PQfnumber(r, "privileges");
date_creation = PQfnumber(r, "date_creation");
date_modification = PQfnumber(r, "date_modification");
url = PQfnumber(r, "url");
type = PQfnumber(r, "type");
parent_id = PQfnumber(r, "parent_id");
content_id = PQfnumber(r, "content_id");
default_item = PQfnumber(r, "default_item");
subject = PQfnumber(r, "subject");
content = PQfnumber(r, "content");
content_type = PQfnumber(r, "content_type");
guest_name = PQfnumber(r, "guest_name");
auth = PQfnumber(r, "auth");
auth_path = PQfnumber(r, "auth_path");
html_template = PQfnumber(r, "template");
modification_user_id = PQfnumber(r, "modification_user_id");
}
void Db::ItemColumns::SetItem(PGresult * r, long row, Item & item)
{
if( id != -1 ) item.id = atol( Db::AssertValue(r, row, id) );
if( user_id != -1 ) item.user_id = atol( Db::AssertValue(r, row, user_id) );
if( group_id != -1 ) item.group_id = atol( Db::AssertValue(r, row, group_id) );
if( privileges != -1 ) item.privileges = atoi( Db::AssertValue(r, row, privileges) );
if( date_creation != -1 ) item.date_creation = ConvertTime( Db::AssertValue(r, row, date_creation) );
if( date_modification != -1 ) item.date_modification = ConvertTime( Db::AssertValue(r, row, date_modification) );
if( url != -1 ) item.url = Db::AssertValue(r, row, url);
if( type != -1 ) item.type = static_cast<Item::Type>( atoi(Db::AssertValue(r, row, type)) );
if( parent_id != -1 ) item.parent_id = atol( Db::AssertValue(r, row, parent_id) );
if( content_id != -1 ) item.content_id = atol( Db::AssertValue(r, row, content_id) );
if( default_item != -1 ) item.default_item = atol( Db::AssertValue(r, row, default_item) );
if( subject != -1 ) item.subject = Db::AssertValue(r, row, subject);
if( content != -1 ) item.content = Db::AssertValue(r, row, content);
if( content_type != -1 ) item.content_type = static_cast<Item::ContentType>( atoi(Db::AssertValue(r, row, content_type)) );
if( guest_name != -1 ) item.guest_name = Db::AssertValue(r, row, guest_name);
if( auth != -1 ) item.auth = static_cast<Item::Auth>( atoi(Db::AssertValue(r, row, auth)) );
if( auth_path != -1 ) item.auth_path = Db::AssertValue(r, row, auth_path);
if( html_template != -1 ) item.html_template = Db::AssertValue(r, row, html_template);
if( modification_user_id != -1 ) item.modification_user_id = atol( Db::AssertValue(r, row, modification_user_id) );
}
void Db::TicketColumns::SetColumns(PGresult * r)
{
// PQfnumber returns -1 if there is no such a column
id = PQfnumber(r, "id");
dir_id = PQfnumber(r, "dir_id");
parent_id = PQfnumber(r, "parent_id");
type = PQfnumber(r, "type");
status = PQfnumber(r, "status");
priority = PQfnumber(r, "priority");
category = PQfnumber(r, "category");
expected = PQfnumber(r, "expected");
progress = PQfnumber(r, "progress");
item_id = PQfnumber(r, "item_id");
}
void Db::TicketColumns::SetTicket(PGresult * r, long row, Ticket & ticket)
{
if( id != -1 ) ticket.id = atol( Db::AssertValue(r, row, id) );
if( dir_id != -1 ) ticket.dir_id = atol( Db::AssertValue(r, row, dir_id) );
if( parent_id != -1 ) ticket.parent_id = atol( Db::AssertValue(r, row, parent_id) );
if( type != -1 ) ticket.type = atoi( Db::AssertValue(r, row, type) );
if( status != -1 ) ticket.status = atoi( Db::AssertValue(r, row, status) );
if( priority != -1 ) ticket.priority = atoi( Db::AssertValue(r, row, priority) );
if( category != -1 ) ticket.category = atoi( Db::AssertValue(r, row, category) );
if( expected != -1 ) ticket.expected = atoi( Db::AssertValue(r, row, expected) );
if( progress != -1 ) ticket.progress = atoi( Db::AssertValue(r, row, progress) );
if( item_id != -1 ) ticket.item_id = atol( Db::AssertValue(r, row, item_id) );
}

301
db/dbbase.cpp Executable file
View File

@ -0,0 +1,301 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "dbbase.h"
#include "core/log.h"
#include "core/error.h"
#include <stdlib.h>
#include <limits.h>
#include <limits>
DbBase::DbBase()
{
db_conn = 0;
log_queries = false;
}
void DbBase::SetConn(DbConn * conn)
{
db_conn = conn;
}
void DbBase::SetConn(DbConn & conn)
{
db_conn = &conn;
}
DbConn * DbBase::GetConn()
{
return db_conn;
}
void DbBase::LogQueries(bool log_q)
{
log_queries = log_q;
}
PGresult * DbBase::AssertQuery(const char * q)
{
if( log_queries )
log << log1 << "Db: executing query: " << q << logend;
bool bad_query = false;
PGresult * r = PQexec(db_conn->GetPgConn(), q);
if( !r )
{
bad_query = true;
if( PQstatus(db_conn->GetPgConn()) != CONNECTION_OK )
{
db_conn->AssertConnection();
r = PQexec(db_conn->GetPgConn(), q);
if( r )
bad_query = false;
}
}
if( bad_query )
{
log << log1 << "Db: Problem with this query: \"" << q << '\"' << logend;
log << log1 << "Db: " << PQerrorMessage(db_conn->GetPgConn()) << logend;
throw Error(WINIX_ERR_DB_INCORRECT_QUERY);
}
return r;
}
PGresult * DbBase::AssertQuery(const std::string & q)
{
return AssertQuery(q.c_str());
}
PGresult * DbBase::AssertQuery(const DbTextStream & query)
{
return AssertQuery(query.CStr());
}
void DbBase::AssertResult(PGresult * r, ExecStatusType t)
{
if( PQresultStatus(r) != t )
{
log << "Db: Incorrect result status: " << PQerrorMessage(db_conn->GetPgConn()) << logend;
throw Error(WINIX_ERR_DB_INCORRENT_RESULT_STATUS);
}
}
int DbBase::AssertColumn(PGresult * r, const char * column_name)
{
int c = PQfnumber(r, column_name);
if( c == -1 )
{
log << log1 << "Db: there is no column: " << column_name << logend;
throw Error(WINIX_ERR_DB_NO_COLUMN);
}
return c;
}
const char * DbBase::AssertValue(PGresult * r, int row, int col)
{
const char * res = PQgetvalue(r, row, col);
if( !res )
{
log << log1 << "Db: there is no such an item in the result, row:" << row << ", col:" << col << logend;
throw Error(WINIX_ERR_NO_ITEM);
}
return res;
}
long DbBase::AssertValueLong(PGresult * r, int row, int col)
{
return strtol( AssertValue(r, row, col), 0, 10 );
}
int DbBase::AssertValueInt(PGresult * r, int row, int col)
{
return (int)strtol( AssertValue(r, row, col), 0, 10 );
}
unsigned long DbBase::AssertValueULong(PGresult * r, int row, int col)
{
return strtoul( AssertValue(r, row, col), 0, 10 );
}
unsigned int DbBase::AssertValueUInt(PGresult * r, int row, int col)
{
return (unsigned int)strtoul( AssertValue(r, row, col), 0, 10 );
}
void DbBase::ClearResult(PGresult * r)
{
if( r )
PQclear(r);
}
bool DbBase::IsNull(PGresult * r, int row, int col)
{
return PQgetisnull(r, row, col) == 1;
}
int DbBase::Rows(PGresult * r)
{
// PQntuples - Returns the number of rows (tuples) in the query result. Because it returns
// an integer result, large result sets might overflow the return value on 32-bit operating systems.
return PQntuples(r);
}
int DbBase::Cols(PGresult * r)
{
// PQnfields - Returns the number of columns (fields) in each row of the query result.
return PQnfields(r);
}
long DbBase::AffectedRows(PGresult * r)
{
// PQcmdTuples - This function returns a string containing the number of rows affected by the SQL
// statement that generated the PGresult. This function can only be used following the execution
// of an INSERT, UPDATE, DELETE, MOVE, FETCH, or COPY statement, or [...]
char * rows_str = PQcmdTuples(r); // can be an empty string
long rows = 0;
if( rows_str )
{
rows = strtol(rows_str, 0, 10);
// strtol - If an overflow or underflow occurs, errno is set to ERANGE
// and the function return value is clamped according to the following table:
// Function underflow overflow
// strtol() LONG_MIN LONG_MAX
if( rows < 0 )
rows = 0;
}
return rows;
}
long DbBase::AssertCurrval(const char * table)
{
PGresult * r;
bquery.Clear();
bquery << R("select currval(")
<< table
<< R(");");
r = AssertQuery(bquery);
AssertResult(r, PGRES_TUPLES_OK);
if( Rows(r) != 1 )
{
log << log1 << "Db: error (currval) for table: " << table << ", " << PQerrorMessage(db_conn->GetPgConn()) << logend;
throw Error(WINIX_ERR_DB_ERR_CURRVAL);
}
return AssertValueLong(r, 0, 0);
}
tm DbBase::ConvertTime(const char * str)
{
tm t;
memset(&t, 0, sizeof(t));
if( !str )
return t;
size_t len = strlen(str);
if( len != 19 )
{
// the format must be like this: 2008-12-31 22:30:00
log << log1 << "DbBase: ConvertTime: unknown time format: \"" << str << "\"";
return t;
}
t.tm_year = atoi(str + 0) - 1900; /* year - 1900 */
t.tm_mon = atoi(str + 5) - 1; /* month of year (0 - 11) */
t.tm_mday = atoi(str + 8); /* day of month (1 - 31) */
t.tm_hour = atoi(str + 11); /* hours (0 - 23) */
t.tm_min = atoi(str + 14); /* minutes (0 - 59) */
t.tm_sec = atoi(str + 17); /* seconds (0 - 60) */
// t.tm_wday = 0; /* day of week (Sunday = 0) */
// t.tm_yday = 0; /* day of year (0 - 365) */
// t.tm_isdst = 0; /* is summer time in effect? */
// t.tm_zone = 0; // const_cast<char*>(""); /* abbreviation of timezone name */
return t;
}
const char * DbBase::ConvertTime(const tm & t)
{
// not thread safe
static char buffer[100];
sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d",
t.tm_year + 1900,
t.tm_mon + 1,
t.tm_mday,
t.tm_hour,
t.tm_min,
t.tm_sec);
return buffer;
}

75
db/dbbase.h Executable file
View File

@ -0,0 +1,75 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_db_dbbase
#define headerfile_winix_db_dbbase
#include "dbconn.h"
#include "dbtextstream.h"
class DbBase
{
public:
DbBase();
void SetConn(DbConn * conn);
void SetConn(DbConn & conn);
DbConn * GetConn();
void LogQueries(bool log_q);
PGresult * AssertQuery(const char * query);
PGresult * AssertQuery(const std::string & query);
PGresult * AssertQuery(const DbTextStream & query);
void AssertResult(PGresult * r, ExecStatusType t);
static int AssertColumn(PGresult * r, const char * column_name);
static const char * AssertValue(PGresult * r, int row, int col);
static long AssertValueLong(PGresult * r, int row, int col);
static int AssertValueInt(PGresult * r, int row, int col);
static unsigned long AssertValueULong(PGresult * r, int row, int col);
static unsigned int AssertValueUInt(PGresult * r, int row, int col);
void ClearResult(PGresult * r);
long AssertCurrval(const char * table);
bool IsNull(PGresult * r, int row, int col);
int Rows(PGresult * r);
int Cols(PGresult * r);
long AffectedRows(PGresult * r);
static tm ConvertTime(const char * str);
static const char * ConvertTime(const tm & t); // warning: it uses its own static buffer
protected:
// a helper method for escaping strings
template<class RawType>
DbTextStream::RawText<RawType> R(const RawType & par)
{
return DbTextStream::RawText<RawType>(par);
}
DbConn * db_conn;
bool log_queries;
private:
DbTextStream bquery;
};
#endif

153
db/dbconn.cpp Executable file
View File

@ -0,0 +1,153 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "dbconn.h"
#include "core/log.h"
#include "core/error.h"
DbConn::DbConn()
{
pg_conn = 0;
}
DbConn::~DbConn()
{
Close();
}
PGconn * DbConn::GetPgConn()
{
return pg_conn;
}
void DbConn::SetConnParam(const std::string & d, const std::string & u, const std::string & p)
{
db_database = d;
db_user = u;
db_pass = p;
}
void DbConn::Connect()
{
Close();
conn_info.Clear();
conn_info.SetExtented(false);
conn_info << R("dbname=") << db_database
<< R(" user=") << db_user
<< R(" password=") << db_pass;
pg_conn = PQconnectdb(conn_info.CStr());
// warning! pg_conn can be not null but there cannnot be a connection established
// use PQstatus(pg_conn) to check whether the connection works fine
}
void DbConn::LogConnectionSocket()
{
log << log2 << "Db: connection to the database works fine" << logend;
log << log3 << "Db: connection socket: " << PQsocket(pg_conn) << logend;
}
void DbConn::WaitForConnection()
{
if( !pg_conn || PQstatus(pg_conn) != CONNECTION_OK )
{
log << log3 << "Db: waiting for the db to be ready...." << logend;
while( !AssertConnection(false, false) )
sleep(5);
LogConnectionSocket();
}
}
void DbConn::Close()
{
if( pg_conn )
{
PQfinish(pg_conn);
pg_conn = 0;
}
}
bool DbConn::AssertConnection(bool put_log, bool throw_if_no_connection)
{
bool was_connection = true;
if( !pg_conn )
{
was_connection = false;
Connect();
}
else
if( PQstatus(pg_conn) != CONNECTION_OK )
{
if( put_log )
log << log2 << "Db: connection to the database is lost, trying to recover" << logend;
was_connection = false;
PQreset(pg_conn);
}
if( pg_conn && PQstatus(pg_conn) == CONNECTION_OK )
{
if( !was_connection )
{
if( put_log )
LogConnectionSocket();
SetDbParameters();
}
return true;
}
else
{
if( put_log )
log << log1 << "Db: connection to db server cannot be established" << logend;
if( throw_if_no_connection )
throw Error(WINIX_ERR_DB_FATAL_ERROR_DURING_CONNECTING);
return false;
}
}
void DbConn::SetDbParameters()
{
if( PQsetClientEncoding(pg_conn, "LATIN2") == -1 )
log << log1 << "Db: Can't set the proper client encoding" << logend;
}

55
db/dbconn.h Executable file
View File

@ -0,0 +1,55 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_db_dbconn
#define headerfile_winix_db_dbconn
#include <string>
#include <libpq-fe.h>
#include "dbtextstream.h"
class DbConn
{
public:
DbConn();
~DbConn();
void SetConnParam(const std::string & database, const std::string & user, const std::string & pass);
void Connect();
void WaitForConnection();
void Close();
bool AssertConnection(bool put_log = true, bool throw_if_no_connection = true);
void SetDbParameters();
PGconn * GetPgConn();
private:
void LogConnectionSocket();
PGconn * pg_conn;
std::string db_database, db_user, db_pass;
DbTextStream conn_info;
// a helper method for escaping strings
template<class RawType>
DbTextStream::RawText<RawType> R(const RawType & par)
{
return DbTextStream::RawText<RawType>(par);
}
};
#endif

66
db/dbitemcolumns.cpp Executable file
View File

@ -0,0 +1,66 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "dbitemcolumns.h"
#include "dbbase.h"
void DbItemColumns::SetColumns(PGresult * r)
{
// PQfnumber returns -1 if there is no such a column
id = PQfnumber(r, "id");
user_id = PQfnumber(r, "user_id");
group_id = PQfnumber(r, "group_id");
privileges = PQfnumber(r, "privileges");
date_creation = PQfnumber(r, "date_creation");
date_modification = PQfnumber(r, "date_modification");
url = PQfnumber(r, "url");
type = PQfnumber(r, "type");
parent_id = PQfnumber(r, "parent_id");
content_id = PQfnumber(r, "content_id");
default_item = PQfnumber(r, "default_item");
subject = PQfnumber(r, "subject");
content = PQfnumber(r, "content");
content_type = PQfnumber(r, "content_type");
guest_name = PQfnumber(r, "guest_name");
auth = PQfnumber(r, "auth");
auth_path = PQfnumber(r, "auth_path");
html_template = PQfnumber(r, "template");
modification_user_id = PQfnumber(r, "modification_user_id");
}
void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
{
if( id != -1 ) item.id = DbBase::AssertValueLong(r, row, id);
if( user_id != -1 ) item.user_id = DbBase::AssertValueLong(r, row, user_id);
if( group_id != -1 ) item.group_id = DbBase::AssertValueLong(r, row, group_id);
if( privileges != -1 ) item.privileges = DbBase::AssertValueInt(r, row, privileges);
if( date_creation != -1 ) item.date_creation = DbBase::ConvertTime( DbBase::AssertValue(r, row, date_creation) );
if( date_modification != -1 ) item.date_modification = DbBase::ConvertTime( DbBase::AssertValue(r, row, date_modification) );
if( url != -1 ) item.url = DbBase::AssertValue(r, row, url);
if( type != -1 ) item.type = static_cast<Item::Type>( DbBase::AssertValueInt(r, row, type) );
if( parent_id != -1 ) item.parent_id = DbBase::AssertValueLong(r, row, parent_id);
if( content_id != -1 ) item.content_id = DbBase::AssertValueLong(r, row, content_id);
if( default_item != -1 ) item.default_item = DbBase::AssertValueLong(r, row, default_item);
if( subject != -1 ) item.subject = DbBase::AssertValue(r, row, subject);
if( content != -1 ) item.content = DbBase::AssertValue(r, row, content);
if( content_type != -1 ) item.content_type = static_cast<Item::ContentType>( DbBase::AssertValueInt(r, row, content_type) );
if( guest_name != -1 ) item.guest_name = DbBase::AssertValue(r, row, guest_name);
if( auth != -1 ) item.auth = static_cast<Item::Auth>( DbBase::AssertValueInt(r, row, auth) );
if( auth_path != -1 ) item.auth_path = DbBase::AssertValue(r, row, auth_path);
if( html_template != -1 ) item.html_template = DbBase::AssertValue(r, row, html_template);
if( modification_user_id != -1 ) item.modification_user_id = DbBase::AssertValueLong(r, row, modification_user_id);
}

50
db/dbitemcolumns.h Executable file
View File

@ -0,0 +1,50 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_db_dbitemcolumns
#define headerfile_winix_db_dbitemcolumns
#include <libpq-fe.h>
#include "core/item.h"
struct DbItemColumns
{
int id;
int user_id;
int group_id;
int privileges;
int date_creation;
int date_modification;
int url;
int type;
int parent_id;
int content_id;
int default_item;
int subject;
int content;
int content_type;
int guest_name;
int auth;
int auth_path;
int modification_user_id;
int html_template;
void SetColumns(PGresult * r);
void SetItem(PGresult * r, long row, Item & item);
};
#endif

97
db/dbitemquery.cpp Executable file
View File

@ -0,0 +1,97 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "dbitemquery.h"
DbItemQuery::DbItemQuery()
{
sort_asc = true;
auth_equal = true;
SetAll(true, false);
id = -1;
parent_id = -1;
type = Item::none;
auth = Item::auth_none;
}
void DbItemQuery::SetAllSel(bool sel)
{
sel_parent_id = sel;
sel_user_id = sel;
sel_group_id = sel;
sel_guest_name = sel;
sel_privileges = sel;
sel_date = sel;
sel_subject = sel;
sel_content = sel;
sel_url = sel;
sel_type = sel;
sel_default_item = sel;
sel_auth = sel;
sel_html_template = sel;
}
void DbItemQuery::SetAllWhere(bool where_)
{
where_id = where_;
where_parent_id = where_;
where_type = where_;
where_auth = where_;
}
void DbItemQuery::SetAll(bool sel, bool where_)
{
SetAllSel(sel);
SetAllWhere(where_);
}
void DbItemQuery::WhereId(long id_)
{
where_id = true;
id = id_;
}
void DbItemQuery::WhereParentId(long parent_id_)
{
where_parent_id = true;
parent_id = parent_id_;
}
void DbItemQuery::WhereType(Item::Type type_)
{
where_type = true;
type = type_;
}
void DbItemQuery::WhereAuth(Item::Auth st, bool equal)
{
where_auth = true;
auth = st;
auth_equal = equal;
}

67
db/dbitemquery.h Executable file
View File

@ -0,0 +1,67 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_db_dbitemquery
#define headerfile_winix_db_dbitemquery
#include "core/item.h"
struct DbItemQuery
{
// id is selected always
bool sel_parent_id; // parent_id
bool sel_user_id; // user_id, modification_user_id
bool sel_group_id; // group_id
bool sel_guest_name; // guest_name
bool sel_privileges; // privileges
bool sel_date; // date_creation, date_modification
bool sel_subject; // subject
bool sel_content; // content, content_type, (content_id)
bool sel_url; // url
bool sel_type; // type (dir, file, none)
bool sel_default_item; // default_item
bool sel_auth; // auth, auth_path
bool sel_html_template; // template
bool where_id; //
bool where_parent_id; //
bool where_type;
bool where_auth;
long id; // if where_id is true
long parent_id; // if where_parent_id is true
Item::Type type;
Item::Auth auth;
bool auth_equal; // if true means auth should be equal
bool sort_asc;
DbItemQuery();
void SetAllSel(bool sel);
void SetAllWhere(bool where_);
void SetAll(bool sel, bool where_);
void WhereId(long id_);
void WhereParentId(long parent_id_);
void WhereType(Item::Type type_);
void WhereAuth(Item::Auth st, bool equal = true);
};
#endif

364
db/dbtextstream.cpp Executable file
View File

@ -0,0 +1,364 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "dbtextstream.h"
DbTextStream::DbTextStream()
{
was_param = false;
ext_escape = true;
}
void DbTextStream::SetExtented(bool ext)
{
ext_escape = ext;
}
/*
without escaping
*/
DbTextStream & DbTextStream::PutText(const char * str)
{
buffer += str;
was_param = false;
return *this;
}
DbTextStream & DbTextStream::PutText(const std::string * str)
{
return PutText(str->c_str());
}
DbTextStream & DbTextStream::PutText(const std::string & str)
{
return PutText(str.c_str());
}
DbTextStream & DbTextStream::operator<<(const DbTextStream::RawText<const char*> & raw)
{
return PutText(raw.par);
}
DbTextStream & DbTextStream::operator<<(DbTextStream::RawText<std::string> raw)
{
return PutText(raw.par.c_str());
}
DbTextStream & DbTextStream::operator<<(RawText<char> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<int> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<long> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<unsigned int> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<unsigned long> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<double> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
DbTextStream & DbTextStream::operator<<(RawText<void*> raw)
{
TextStream::operator<<(raw.par);
was_param = false;
return *this;
}
/*
with escaping
*/
// !! sprawdzic jej dzialanie dla kolumn bytea (binarnych)
DbTextStream & DbTextStream::EBinPutChar(char c_)
{
char buf[10];
int c = (unsigned char)c_;
if( (c>=0 && c<=31) || c>=127 || c==39 || c==92 )
{
sprintf(buf, "\\\\%03o", c);
buffer += buf;
}
else
{
buffer += c;
}
return *this;
}
DbTextStream & DbTextStream::ETextPutChar(char c)
{
if( c == '\\' )
buffer += "\\\\";
else
if( c == '\'' )
buffer += "\\\'"; // don't use "''" because we use the method for PQconnectdb too
else
if( c != 0 )
buffer += c;
return *this;
}
DbTextStream & DbTextStream::EPutText(const char * str)
{
if( was_param )
buffer += ", ";
if( ext_escape )
buffer += 'E';
buffer += '\'';
for( ; *str ; ++str )
ETextPutChar(*str);
buffer += '\'';
was_param = true;
return *this;
}
DbTextStream & DbTextStream::EPutText(const std::string * str)
{
return EPutText(str->c_str());
}
DbTextStream & DbTextStream::EPutText(const std::string & str)
{
return EPutText(str.c_str());
}
// this method can escaped 0 in the middle of the string
DbTextStream & DbTextStream::EPutBin(const char * str, size_t len)
{
if( was_param )
buffer += ", ";
if( ext_escape )
buffer += 'E';
buffer += '\'';
for(size_t i = 0 ; i < len ; ++i)
EBinPutChar(str[i]);
buffer += '\'';
was_param = true;
return *this;
}
DbTextStream & DbTextStream::EPutBin(const std::string * str)
{
return EPutBin(str->c_str(), str->size());
}
DbTextStream & DbTextStream::EPutBin(const std::string & str)
{
return EPutBin(str.c_str(), str.size());
}
DbTextStream & DbTextStream::operator<<(const char * str)
{
return EPutText(str);
}
DbTextStream & DbTextStream::operator<<(const std::string * str)
{
return EPutText(str);
}
DbTextStream & DbTextStream::operator<<(const std::string & str)
{
return EPutText(str);
}
DbTextStream & DbTextStream::operator<<(char v)
{
if( was_param )
buffer += ", ";
if( ext_escape )
buffer += 'E';
buffer += '\'';
ETextPutChar(v);
buffer += '\'';
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(int v)
{
if( was_param )
buffer += ", ";
TextStream::operator<<(v);
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(long v)
{
if( was_param )
buffer += ", ";
TextStream::operator<<(v);
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(unsigned int v)
{
if( was_param )
buffer += ", ";
TextStream::operator<<(v);
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(unsigned long v)
{
if( was_param )
buffer += ", ";
TextStream::operator<<(v);
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(double v)
{
if( was_param )
buffer += ", ";
TextStream::operator<<(v);
was_param = true;
return *this;
}
DbTextStream & DbTextStream::operator<<(const void * v)
{
if( was_param )
buffer += ", ";
buffer += '\''; // !! not needed here?
TextStream::operator<<(v);
buffer += '\'';
was_param = true;
return *this;
}

144
db/dbtextstream.h Executable file
View File

@ -0,0 +1,144 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_core_dbtextstream
#define headerfile_winix_core_dbtextstream
#include "core/textstream.h"
/*
DbTextStream is used as a buffer for creating a database's query
By default all operators<< espace its string artuments. If you don't want
to escape an argument you should use a helper function R() (raw argument)
note: you have to define the function yourself, we do not provide it
because such a short name would make a mess in namespaces
sample:
create a helper function R as follows:
template<class RawType>
DbTextStream::RawText<RawType> R(const RawType & par)
{
return DbTextStream::RawText<RawType>(par);
}
now you can use DbTextStream in an easy way:
DbTextStream query;
std::string key = "some string";
query << R("select * from table where key=") << key << R(";");
in above example only the key is escaped.
Also with escaping operators<< insert commas between parameters, e.g.:
query << R("insert into table (key1, key2, key3) values (")
<< key1
<< key2
<< key3
<< R(");");
between key1 key2 and key3 are commas inserted automatically
*/
class DbTextStream : public TextStream
{
public:
/*
a helper struct to select a proper operator<<
(for non-escaping versions of these operators)
*/
template<class RawType>
struct RawText
{
const RawType & par;
RawText(const RawText<RawType> & p) : par(p.par) {}
RawText(const RawType & p) : par(p) {}
};
DbTextStream();
// extented escaping: adding E character before the first quote e.g. E'string'
// default: true
void SetExtented(bool ext);
/*
without escaping
*/
DbTextStream & PutText(const char *);
DbTextStream & PutText(const std::string *);
DbTextStream & PutText(const std::string &);
/*
we need this template operator for such calling:
dbtextstream_object << R("some string");
"some string" is actually a table (not a pointer)
*/
template<size_t str_size>
DbTextStream & operator<<(const RawText<char [str_size]> & raw) { return PutText(raw.par); }
DbTextStream & operator<<(const RawText<const char*> & raw);
DbTextStream & operator<<(RawText<std::string> raw);
DbTextStream & operator<<(RawText<char> raw);
DbTextStream & operator<<(RawText<int> raw);
DbTextStream & operator<<(RawText<long> raw);
DbTextStream & operator<<(RawText<unsigned int> raw);
DbTextStream & operator<<(RawText<unsigned long> raw);
DbTextStream & operator<<(RawText<double> raw);
DbTextStream & operator<<(RawText<void*> raw);
/*
with escaping
*/
DbTextStream & EBinPutChar(char c);
DbTextStream & ETextPutChar(char c);
DbTextStream & EPutText(const char * str);
DbTextStream & EPutText(const std::string * str);
DbTextStream & EPutText(const std::string & str);
DbTextStream & EPutBin(const char * str, size_t len);
DbTextStream & EPutBin(const std::string * str);
DbTextStream & EPutBin(const std::string & str);
DbTextStream & operator<<(const char * str);
DbTextStream & operator<<(const std::string * str);
DbTextStream & operator<<(const std::string & str);
DbTextStream & operator<<(char);
DbTextStream & operator<<(int);
DbTextStream & operator<<(long);
DbTextStream & operator<<(unsigned int);
DbTextStream & operator<<(unsigned long);
DbTextStream & operator<<(double);
DbTextStream & operator<<(const void *);
private:
bool was_param;
bool ext_escape;
};
#endif

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ private:
// !! wywalic przedrostki cp_ Cp
Item cp_temp;
Db::ItemQuery cp_iq;
DbItemQuery cp_iq;
bool cp_remove_defaults;
bool cp_preserve_attr;
long cp_new_user;

View File

@ -13,7 +13,7 @@
#include <string>
#include <vector>
#include "core/item.h"
#include "core/db.h"
#include "db/db.h"
#include "core/request.h"
#include "core/config.h"
#include "core/system.h"

View File

@ -11,7 +11,7 @@
#define headerfilecmslucorefunctionparser
#include "core/request.h"
#include "core/db.h"
#include "db/db.h"
#include "core/system.h"

View File

@ -62,7 +62,7 @@ void FunThread::MakeGet()
{
is_thread = (db->GetThreadByDirId(request->dir_tab.back()->id, thread) == WINIX_ERR_OK);
Db::ItemQuery iq;
DbItemQuery iq;
if( system->mounts.pmount->IsArg(system->mounts.MountParThread(), "sort_desc") )
iq.sort_asc = false;

View File

@ -76,7 +76,7 @@ void FunTicket::MakeGet()
{
ReadTicket();
Db::ItemQuery iq;
DbItemQuery iq;
iq.WhereParentId(request->dir_tab.back()->id);
iq.WhereType(Item::file);

View File

@ -25,7 +25,7 @@ void Ls::MakeGet()
{
if( !request->is_item )
{
Db::ItemQuery iq;
DbItemQuery iq;
iq.sel_content = false;

View File

@ -222,7 +222,7 @@ void Mv::MoveFile(Item & item, bool redirect)
void Mv::MoveContentOfDir()
{
Db::ItemQuery iq;
DbItemQuery iq;
iq.sel_parent_id = true;
iq.sel_type = true;

View File

@ -33,7 +33,7 @@ private:
std::string mv_new_path;
long mv_dir_id;
std::vector<Item> mv_auth;
Db::ItemQuery mv_auth_iq;
DbItemQuery mv_auth_iq;
bool MoveCheckAccessFromToDir();
bool MoveCheckAccessFrom();

View File

@ -166,7 +166,7 @@ Item * root = 0;
void PrivChanger::PrivFilesInDir(long parent_id)
{
Db::ItemQuery iq;
DbItemQuery iq;
iq.SetAll(false, false);
iq.sel_user_id = iq.sel_group_id = iq.sel_guest_name = iq.sel_privileges = true;

View File

@ -13,7 +13,7 @@
#include "core/request.h"
#include "core/system.h"
#include "core/db.h"
#include "db/db.h"

View File

@ -28,7 +28,7 @@ public:
private:
Db::ItemQuery rm_auth_iq;
DbItemQuery rm_auth_iq;
bool HasAccess(const Item & item);
void RemoveAuthPrepareQuery();

View File

@ -2,19 +2,22 @@
main.o: ../core/log.h ../core/app.h ../core/config.h ../core/confparser.h
main.o: ../core/htmlfilter.h ../core/system.h ../core/dirs.h ../core/item.h
main.o: ../core/dircontainer.h ../core/db.h ../core/user.h ../core/group.h
main.o: ../core/thread.h ../core/error.h ../core/log.h ../core/ugcontainer.h
main.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
main.o: ../core/session.h ../core/plugindata.h ../core/rebus.h
main.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
main.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
main.o: ../core/loadavg.h ../core/sessionmanager.h ../core/sessioncontainer.h
main.o: ../core/notify.h ../templatesnotify/templatesnotify.h
main.o: ../../ezc/src/ezc.h ../core/mount.h ../core/locale.h ../core/config.h
main.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
main.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
main.o: ../core/db.h ../core/request.h ../core/system.h ../core/notify.h
main.o: ../functions/functionparser.h ../functions/adduser.h
main.o: ../core/dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
main.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
main.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
main.o: ../core/thread.h ../core/error.h ../core/log.h ../core/dircontainer.h
main.o: ../core/ugcontainer.h ../core/ticket.h ../core/request.h
main.o: ../core/requesttypes.h ../core/session.h ../core/error.h
main.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/mounts.h
main.o: ../core/mount.h ../core/mountparser.h ../core/users.h
main.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
main.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
main.o: ../core/sessioncontainer.h ../core/notify.h
main.o: ../templatesnotify/templatesnotify.h ../../ezc/src/ezc.h
main.o: ../core/mount.h ../core/locale.h ../core/config.h ../templates/misc.h
main.o: ../templates/localefilter.h ../core/locale.h ../functions/functions.h
main.o: ../functions/functionbase.h ../core/request.h ../core/system.h
main.o: ../core/notify.h ../functions/functionparser.h ../functions/adduser.h
main.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
main.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
main.o: ../functions/createthread.h ../functions/createticket.h
@ -24,14 +27,14 @@ main.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
main.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
main.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
main.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
main.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
main.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
main.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
main.o: ../core/htmlfilter.h ../templates/templates.h
main.o: ../templates/patterncacher.h ../core/item.h ../templates/misc.h
main.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
main.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
main.o: ../core/compress.h ../core/getparser.h ../core/httpsimpleparser.h
main.o: ../core/postparser.h ../core/cookieparser.h ../core/postmultiparser.h
main.o: ../functions/funticket.h ../functions/template.h
main.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
main.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
main.o: ../templates/templates.h ../templates/patterncacher.h ../core/item.h
main.o: ../templates/misc.h ../templates/ckeditorgetparser.h
main.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
main.o: ../core/sessionmanager.h ../core/compress.h ../core/getparser.h
main.o: ../core/httpsimpleparser.h ../core/postparser.h
main.o: ../core/cookieparser.h ../core/postmultiparser.h
main.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
main.o: ../core/plugin.h ../core/pluginmsg.h

View File

@ -16,12 +16,9 @@
#include "core/app.h"
#include "core/plugin.h"
// !! chwilowo
#include "core/db.h"
Log log;
Log nlog; // notify log (used by another thread)
Log nlog; // notify log (used by a notification thread)
Plugin plugin;

View File

@ -5,33 +5,36 @@ init.o: ../../core/log.h ../../core/request.h ../../core/requesttypes.h
init.o: ../../core/session.h ../../core/item.h ../../core/error.h
init.o: ../../core/log.h ../../core/user.h ../../core/plugindata.h
init.o: ../../core/rebus.h ../../core/config.h ../../core/confparser.h
init.o: ../../core/htmlfilter.h ../../core/config.h ../../core/db.h
init.o: ../../core/group.h ../../core/thread.h ../../core/dircontainer.h
init.o: ../../core/htmlfilter.h ../../core/config.h ../../db/db.h
init.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
init.o: ../../core/textstream.h ../../db/dbitemquery.h ../../core/item.h
init.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
init.o: ../../core/thread.h ../../core/error.h ../../core/dircontainer.h
init.o: ../../core/ugcontainer.h ../../core/ticket.h bot.h stats.h
init.o: templates.h ../../core/plugin.h ../../core/pluginmsg.h
init.o: ../../core/request.h ../../core/system.h ../../core/dirs.h
init.o: ../../core/db.h ../../core/mounts.h ../../core/mount.h
init.o: ../../core/mountparser.h ../../core/users.h
init.o: ../../core/lastcontainer.h ../../core/groups.h ../../core/loadavg.h
init.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
init.o: ../../functions/functions.h ../../functions/functionbase.h
init.o: ../../core/item.h ../../core/system.h ../../core/notify.h
init.o: ../../templatesnotify/templatesnotify.h ../../../ezc/src/ezc.h
init.o: ../../core/mount.h ../../core/locale.h ../../templates/misc.h
init.o: ../../templates/localefilter.h ../../core/locale.h
init.o: ../../functions/functionparser.h ../../functions/adduser.h
init.o: ../../functions/cat.h ../../functions/chmod.h
init.o: ../../functions/privchanger.h ../../functions/chown.h
init.o: ../../functions/ckeditor.h ../../functions/cp.h
init.o: ../../functions/createthread.h ../../functions/createticket.h
init.o: ../../functions/default.h ../../functions/download.h
init.o: ../../functions/editticket.h ../../functions/emacs.h
init.o: ../../functions/last.h ../../functions/login.h
init.o: ../../functions/logout.h ../../functions/ls.h ../../functions/mkdir.h
init.o: ../../functions/mv.h ../../functions/node.h ../../functions/priv.h
init.o: ../../functions/reload.h ../../functions/rm.h ../../functions/run.h
init.o: ../../functions/subject.h ../../functions/funthread.h
init.o: ../../core/thread.h ../../functions/funticket.h ../../core/ticket.h
init.o: ../../core/dircontainer.h ../../core/mounts.h ../../core/mount.h
init.o: ../../core/mountparser.h ../../core/users.h ../../core/ugcontainer.h
init.o: ../../core/lastcontainer.h ../../core/groups.h ../../core/group.h
init.o: ../../core/loadavg.h ../../core/sessionmanager.h
init.o: ../../core/sessioncontainer.h ../../functions/functions.h
init.o: ../../functions/functionbase.h ../../core/system.h
init.o: ../../core/notify.h ../../templatesnotify/templatesnotify.h
init.o: ../../../ezc/src/ezc.h ../../core/mount.h ../../core/locale.h
init.o: ../../templates/misc.h ../../templates/localefilter.h
init.o: ../../core/locale.h ../../functions/functionparser.h
init.o: ../../functions/adduser.h ../../functions/cat.h
init.o: ../../functions/chmod.h ../../functions/privchanger.h
init.o: ../../functions/chown.h ../../functions/ckeditor.h
init.o: ../../functions/cp.h ../../functions/createthread.h
init.o: ../../functions/createticket.h ../../functions/default.h
init.o: ../../functions/download.h ../../functions/editticket.h
init.o: ../../functions/emacs.h ../../functions/last.h
init.o: ../../functions/login.h ../../functions/logout.h ../../functions/ls.h
init.o: ../../functions/mkdir.h ../../functions/mv.h ../../functions/node.h
init.o: ../../functions/priv.h ../../functions/reload.h ../../functions/rm.h
init.o: ../../functions/run.h ../../functions/subject.h
init.o: ../../functions/funthread.h ../../functions/funticket.h
init.o: ../../functions/template.h ../../functions/tinymce.h
init.o: ../../functions/uname.h ../../functions/upload.h
init.o: ../../functions/uptime.h ../../functions/who.h
@ -46,16 +49,19 @@ templates.o: templates.h ../../core/plugin.h ../../core/pluginmsg.h
templates.o: ../../core/log.h ../../core/plugindata.h ../../core/config.h
templates.o: ../../core/confparser.h ../../core/htmlfilter.h
templates.o: ../../core/request.h ../../core/system.h ../../core/dirs.h
templates.o: ../../core/item.h ../../core/dircontainer.h ../../core/db.h
templates.o: ../../core/mounts.h ../../core/mount.h ../../core/error.h
templates.o: ../../core/mountparser.h ../../core/users.h ../../core/user.h
templates.o: ../../core/ugcontainer.h ../../core/lastcontainer.h
templates.o: ../../core/groups.h ../../core/group.h ../../core/rebus.h
templates.o: ../../core/loadavg.h ../../core/sessionmanager.h
templates.o: ../../core/sessioncontainer.h ../../core/session.h
templates.o: ../../functions/functions.h ../../functions/functionbase.h
templates.o: ../../core/item.h ../../core/db.h ../../core/thread.h
templates.o: ../../core/ticket.h ../../core/request.h
templates.o: ../../core/item.h ../../core/dircontainer.h ../../db/db.h
templates.o: ../../db/dbbase.h ../../db/dbconn.h ../../db/dbtextstream.h
templates.o: ../../core/textstream.h ../../db/dbitemquery.h ../../core/item.h
templates.o: ../../db/dbitemcolumns.h ../../core/user.h ../../core/group.h
templates.o: ../../core/thread.h ../../core/error.h ../../core/dircontainer.h
templates.o: ../../core/ugcontainer.h ../../core/ticket.h ../../core/mounts.h
templates.o: ../../core/mount.h ../../core/error.h ../../core/mountparser.h
templates.o: ../../core/users.h ../../core/user.h ../../core/ugcontainer.h
templates.o: ../../core/lastcontainer.h ../../core/groups.h
templates.o: ../../core/group.h ../../core/rebus.h ../../core/loadavg.h
templates.o: ../../core/sessionmanager.h ../../core/sessioncontainer.h
templates.o: ../../core/session.h ../../functions/functions.h
templates.o: ../../functions/functionbase.h ../../core/request.h
templates.o: ../../core/requesttypes.h ../../core/config.h
templates.o: ../../core/system.h ../../core/notify.h
templates.o: ../../templatesnotify/templatesnotify.h ../../../ezc/src/ezc.h
@ -74,8 +80,7 @@ templates.o: ../../functions/mkdir.h ../../functions/mv.h
templates.o: ../../functions/node.h ../../functions/priv.h
templates.o: ../../functions/reload.h ../../functions/rm.h
templates.o: ../../functions/run.h ../../functions/subject.h
templates.o: ../../functions/funthread.h ../../core/thread.h
templates.o: ../../functions/funticket.h ../../core/ticket.h
templates.o: ../../functions/funthread.h ../../functions/funticket.h
templates.o: ../../functions/template.h ../../functions/tinymce.h
templates.o: ../../functions/uname.h ../../functions/upload.h
templates.o: ../../functions/uptime.h ../../functions/who.h

View File

@ -11,7 +11,7 @@
#include "core/log.h"
#include "core/request.h"
#include "core/config.h"
#include "core/db.h"
#include "db/db.h"
#include "bot.h"
#include "stats.h"
@ -148,7 +148,7 @@ void RemoveFile(PluginInfo & info)
void RemoveDir(PluginInfo & info)
{
Db::ItemQuery query;
DbItemQuery query;
std::vector<long> items;
size_t i;

View File

@ -7,11 +7,15 @@ adduser.o: indexpatterns.h ../core/locale.h ../core/config.h
adduser.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
adduser.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
adduser.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
adduser.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
adduser.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
adduser.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
adduser.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
adduser.o: ../core/group.h ../core/thread.h ../core/error.h
adduser.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
adduser.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
adduser.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
adduser.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
adduser.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h
adduser.o: ../core/request.h ../core/mounts.h ../core/mount.h
adduser.o: ../core/mountparser.h ../core/users.h ../core/ugcontainer.h
adduser.o: ../core/lastcontainer.h ../core/groups.h ../core/group.h
adduser.o: ../core/loadavg.h ../core/sessionmanager.h
adduser.o: ../core/sessioncontainer.h ../core/system.h
dir.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
@ -20,15 +24,19 @@ dir.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
dir.o: indexpatterns.h ../core/locale.h ../core/config.h ../core/htmlfilter.h
dir.o: ../core/request.h ../core/requesttypes.h ../core/session.h
dir.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
dir.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
dir.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
dir.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h ../core/dirs.h
dir.o: ../core/db.h ../core/request.h ../core/mounts.h ../core/mount.h
dir.o: ../core/mountparser.h ../core/users.h ../core/lastcontainer.h
dir.o: ../core/groups.h ../core/loadavg.h ../core/sessionmanager.h
dir.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
dir.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
dir.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
dir.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
dir.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
dir.o: ../core/ticket.h ../core/system.h ../core/dirs.h
dir.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
dir.o: ../core/mount.h ../core/mountparser.h ../core/users.h
dir.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
dir.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
dir.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
dir.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
dir.o: ../core/notify.h ../templatesnotify/templatesnotify.h ../core/mount.h
dir.o: ../functions/functions.h ../functions/functionbase.h ../core/notify.h
dir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
dir.o: ../templates/misc.h ../functions/functionparser.h
dir.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
dir.o: ../functions/privchanger.h ../functions/chown.h
@ -39,22 +47,26 @@ dir.o: ../functions/last.h ../functions/login.h ../functions/logout.h
dir.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
dir.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
dir.o: ../functions/rm.h ../functions/run.h ../functions/subject.h
dir.o: ../functions/funthread.h ../core/thread.h ../functions/funticket.h
dir.o: ../core/ticket.h ../functions/template.h ../functions/tinymce.h
dir.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
dir.o: ../functions/who.h ../core/htmlfilter.h
dir.o: ../functions/funthread.h ../functions/funticket.h
dir.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
dir.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
dir.o: ../core/htmlfilter.h
doc.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
doc.o: localefilter.h ../core/locale.h ../core/confparser.h
doc.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
doc.o: indexpatterns.h ../core/locale.h ../core/config.h ../core/htmlfilter.h
doc.o: ../core/request.h ../core/requesttypes.h ../core/session.h
doc.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
doc.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
doc.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
doc.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h ../core/dirs.h
doc.o: ../core/db.h ../core/request.h ../core/mounts.h ../core/mount.h
doc.o: ../core/mountparser.h ../core/users.h ../core/lastcontainer.h
doc.o: ../core/groups.h ../core/loadavg.h ../core/sessionmanager.h
doc.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
doc.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
doc.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
doc.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
doc.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
doc.o: ../core/ticket.h ../core/system.h ../core/dirs.h
doc.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
doc.o: ../core/mount.h ../core/mountparser.h ../core/users.h
doc.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
doc.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
doc.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
doc.o: ../core/misc.h
indexpatterns.o: indexpatterns.h ../../ezc/src/ezc.h localefilter.h
@ -67,13 +79,17 @@ item.o: indexpatterns.h ../core/locale.h ../core/config.h
item.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
item.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
item.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
item.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
item.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
item.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
item.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
item.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
item.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
item.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
item.o: ../core/ticket.h ../core/system.h ../core/dirs.h
item.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
item.o: ../core/mount.h ../core/mountparser.h ../core/users.h
item.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
item.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
item.o: ../core/request.h ../core/misc.h ../core/bbcodeparser.h
item.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
item.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
item.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
item.o: ../core/misc.h ../core/bbcodeparser.h
last.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
last.o: localefilter.h ../core/locale.h ../core/confparser.h
last.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -81,13 +97,17 @@ last.o: indexpatterns.h ../core/locale.h ../core/config.h
last.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
last.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
last.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
last.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
last.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
last.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
last.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
last.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
last.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
last.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
last.o: ../core/ticket.h ../core/system.h ../core/dirs.h
last.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
last.o: ../core/mount.h ../core/mountparser.h ../core/users.h
last.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
last.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
last.o: ../core/lastcontainer.h ../core/request.h ../core/misc.h
last.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
last.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
last.o: ../core/sessioncontainer.h ../core/system.h ../core/lastcontainer.h
last.o: ../core/request.h ../core/misc.h
localefilter.o: localefilter.h ../core/locale.h ../core/confparser.h
localefilter.o: ../../ezc/src/ezc.h ../core/misc.h ../core/item.h
ls.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
@ -96,12 +116,15 @@ ls.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
ls.o: indexpatterns.h ../core/locale.h ../core/config.h ../core/htmlfilter.h
ls.o: ../core/request.h ../core/requesttypes.h ../core/session.h
ls.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
ls.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
ls.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
ls.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
ls.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h
ls.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h ../core/user.h
ls.o: ../core/group.h ../core/thread.h ../core/error.h ../core/dircontainer.h
ls.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h ../core/dirs.h
ls.o: ../core/db.h ../core/request.h ../core/mounts.h ../core/mount.h
ls.o: ../core/mountparser.h ../core/users.h ../core/lastcontainer.h
ls.o: ../core/groups.h ../core/loadavg.h ../core/sessionmanager.h
ls.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
ls.o: ../core/mount.h ../core/mountparser.h ../core/users.h
ls.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
ls.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
ls.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
misc.o: ../core/misc.h ../core/item.h ../core/request.h templates.h
misc.o: ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
@ -110,13 +133,17 @@ misc.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
misc.o: indexpatterns.h ../core/locale.h ../core/config.h
misc.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
misc.o: ../core/session.h ../core/error.h ../core/log.h ../core/user.h
misc.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
misc.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
misc.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
misc.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
misc.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
misc.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
misc.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
misc.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
misc.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
misc.o: ../core/ticket.h ../core/system.h ../core/dirs.h
misc.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
misc.o: ../core/mount.h ../core/mountparser.h ../core/users.h
misc.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
misc.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
misc.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
misc.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
misc.o: ../core/sessioncontainer.h ../core/system.h
mount.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
mount.o: misc.h localefilter.h ../core/locale.h ../core/confparser.h
mount.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -124,11 +151,15 @@ mount.o: indexpatterns.h ../core/locale.h ../core/config.h
mount.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
mount.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
mount.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
mount.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
mount.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
mount.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
mount.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
mount.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
mount.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
mount.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
mount.o: ../core/mount.h ../core/mountparser.h ../core/users.h
mount.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
mount.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
mount.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
mount.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
mount.o: ../core/groups.h ../core/group.h ../core/loadavg.h
mount.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
mount.o: ../core/misc.h
patterncacher.o: patterncacher.h ../core/item.h ../../ezc/src/ezc.h
@ -140,15 +171,19 @@ priv.o: indexpatterns.h ../core/locale.h ../core/config.h
priv.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
priv.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
priv.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
priv.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
priv.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
priv.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
priv.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
priv.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
priv.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
priv.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
priv.o: ../core/ticket.h ../core/system.h ../core/dirs.h
priv.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
priv.o: ../core/mount.h ../core/mountparser.h ../core/users.h
priv.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
priv.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
priv.o: ../core/misc.h ../functions/functions.h ../functions/functionbase.h
priv.o: ../core/item.h ../core/notify.h ../templatesnotify/templatesnotify.h
priv.o: ../core/mount.h ../templates/misc.h ../functions/functionparser.h
priv.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
priv.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
priv.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
priv.o: ../functions/functions.h ../functions/functionbase.h ../core/notify.h
priv.o: ../templatesnotify/templatesnotify.h ../core/mount.h
priv.o: ../templates/misc.h ../functions/functionparser.h
priv.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
priv.o: ../functions/privchanger.h ../functions/chown.h
priv.o: ../functions/ckeditor.h ../functions/cp.h ../functions/createthread.h
@ -158,8 +193,8 @@ priv.o: ../functions/emacs.h ../functions/last.h ../functions/login.h
priv.o: ../functions/logout.h ../functions/ls.h ../functions/mkdir.h
priv.o: ../functions/mv.h ../functions/node.h ../functions/priv.h
priv.o: ../functions/reload.h ../functions/rm.h ../functions/run.h
priv.o: ../functions/subject.h ../functions/funthread.h ../core/thread.h
priv.o: ../functions/funticket.h ../core/ticket.h ../functions/template.h
priv.o: ../functions/subject.h ../functions/funthread.h
priv.o: ../functions/funticket.h ../functions/template.h
priv.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
priv.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
rebus.o: ../core/request.h templates.h ../../ezc/src/ezc.h patterncacher.h
@ -169,11 +204,15 @@ rebus.o: ../core/log.h indexpatterns.h ../core/locale.h ../core/config.h
rebus.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
rebus.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
rebus.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
rebus.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
rebus.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
rebus.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
rebus.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
rebus.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
rebus.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
rebus.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
rebus.o: ../core/mount.h ../core/mountparser.h ../core/users.h
rebus.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
rebus.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
rebus.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
rebus.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
rebus.o: ../core/groups.h ../core/group.h ../core/loadavg.h
rebus.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
sys.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
sys.o: localefilter.h ../core/locale.h ../core/confparser.h
@ -181,12 +220,16 @@ sys.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
sys.o: indexpatterns.h ../core/locale.h ../core/config.h ../core/htmlfilter.h
sys.o: ../core/request.h ../core/requesttypes.h ../core/session.h
sys.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
sys.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
sys.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
sys.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h ../core/dirs.h
sys.o: ../core/db.h ../core/request.h ../core/mounts.h ../core/mount.h
sys.o: ../core/mountparser.h ../core/users.h ../core/lastcontainer.h
sys.o: ../core/groups.h ../core/loadavg.h ../core/sessionmanager.h
sys.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
sys.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
sys.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
sys.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
sys.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
sys.o: ../core/ticket.h ../core/system.h ../core/dirs.h
sys.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
sys.o: ../core/mount.h ../core/mountparser.h ../core/users.h
sys.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
sys.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
sys.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
sys.o: ../core/version.h
template.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
@ -196,11 +239,15 @@ template.o: indexpatterns.h ../core/locale.h ../core/config.h
template.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
template.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
template.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
template.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
template.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
template.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
template.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
template.o: ../core/group.h ../core/thread.h ../core/error.h
template.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
template.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
template.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
template.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
template.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h
template.o: ../core/request.h ../core/mounts.h ../core/mount.h
template.o: ../core/mountparser.h ../core/users.h ../core/ugcontainer.h
template.o: ../core/lastcontainer.h ../core/groups.h ../core/group.h
template.o: ../core/loadavg.h ../core/sessionmanager.h
template.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
templates.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
@ -210,19 +257,23 @@ templates.o: indexpatterns.h ../core/locale.h ../core/config.h
templates.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
templates.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
templates.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
templates.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
templates.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
templates.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
templates.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
templates.o: ../core/group.h ../core/thread.h ../core/error.h
templates.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
templates.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
templates.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
templates.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
templates.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h
templates.o: ../core/request.h ../core/mounts.h ../core/mount.h
templates.o: ../core/mountparser.h ../core/users.h ../core/ugcontainer.h
templates.o: ../core/lastcontainer.h ../core/groups.h ../core/group.h
templates.o: ../core/loadavg.h ../core/sessionmanager.h
templates.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
templates.o: ../core/plugin.h ../core/pluginmsg.h ../core/sessionmanager.h
templates.o: ../functions/functions.h ../functions/functionbase.h
templates.o: ../core/item.h ../core/notify.h
templates.o: ../templatesnotify/templatesnotify.h ../core/mount.h
templates.o: ../templates/misc.h ../functions/functionparser.h
templates.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
templates.o: ../core/notify.h ../templatesnotify/templatesnotify.h
templates.o: ../core/mount.h ../templates/misc.h
templates.o: ../functions/functionparser.h ../functions/adduser.h
templates.o: ../functions/cat.h ../functions/chmod.h
templates.o: ../functions/privchanger.h ../functions/chown.h
templates.o: ../functions/ckeditor.h ../functions/cp.h
templates.o: ../functions/createthread.h ../functions/createticket.h
@ -232,8 +283,7 @@ templates.o: ../functions/last.h ../functions/login.h ../functions/logout.h
templates.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
templates.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
templates.o: ../functions/rm.h ../functions/run.h ../functions/subject.h
templates.o: ../functions/funthread.h ../core/thread.h
templates.o: ../functions/funticket.h ../core/ticket.h
templates.o: ../functions/funthread.h ../functions/funticket.h
templates.o: ../functions/template.h ../functions/tinymce.h
templates.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
templates.o: ../functions/who.h ../core/htmlfilter.h ../templates/templates.h
@ -244,16 +294,20 @@ thread.o: indexpatterns.h ../core/locale.h ../core/config.h
thread.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
thread.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
thread.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
thread.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
thread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
thread.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
thread.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
thread.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
thread.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
thread.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
thread.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
thread.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
thread.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
thread.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
thread.o: ../core/loadavg.h ../core/sessionmanager.h
thread.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
thread.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
thread.o: ../core/notify.h ../templatesnotify/templatesnotify.h
thread.o: ../core/mount.h ../templates/misc.h ../functions/functionparser.h
thread.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
thread.o: ../core/groups.h ../core/group.h ../core/loadavg.h
thread.o: ../core/sessionmanager.h ../core/sessioncontainer.h
thread.o: ../core/system.h ../core/misc.h ../functions/functions.h
thread.o: ../functions/functionbase.h ../core/notify.h
thread.o: ../templatesnotify/templatesnotify.h ../core/mount.h
thread.o: ../templates/misc.h ../functions/functionparser.h
thread.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
thread.o: ../functions/privchanger.h ../functions/chown.h
thread.o: ../functions/ckeditor.h ../functions/cp.h
@ -264,10 +318,9 @@ thread.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
thread.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
thread.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
thread.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
thread.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
thread.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
thread.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
thread.o: ../core/htmlfilter.h
thread.o: ../functions/funticket.h ../functions/template.h
thread.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
thread.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
ticket.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
ticket.o: misc.h localefilter.h ../core/locale.h ../core/confparser.h
ticket.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -275,16 +328,20 @@ ticket.o: indexpatterns.h ../core/locale.h ../core/config.h
ticket.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
ticket.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
ticket.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
ticket.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
ticket.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
ticket.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
ticket.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
ticket.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
ticket.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
ticket.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
ticket.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
ticket.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
ticket.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
ticket.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
ticket.o: ../core/loadavg.h ../core/sessionmanager.h
ticket.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
ticket.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
ticket.o: ../core/notify.h ../templatesnotify/templatesnotify.h
ticket.o: ../core/mount.h ../templates/misc.h ../functions/functionparser.h
ticket.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
ticket.o: ../core/groups.h ../core/group.h ../core/loadavg.h
ticket.o: ../core/sessionmanager.h ../core/sessioncontainer.h
ticket.o: ../core/system.h ../core/misc.h ../functions/functions.h
ticket.o: ../functions/functionbase.h ../core/notify.h
ticket.o: ../templatesnotify/templatesnotify.h ../core/mount.h
ticket.o: ../templates/misc.h ../functions/functionparser.h
ticket.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
ticket.o: ../functions/privchanger.h ../functions/chown.h
ticket.o: ../functions/ckeditor.h ../functions/cp.h
@ -295,10 +352,9 @@ ticket.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
ticket.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
ticket.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
ticket.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
ticket.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
ticket.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
ticket.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
ticket.o: ../core/htmlfilter.h
ticket.o: ../functions/funticket.h ../functions/template.h
ticket.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
ticket.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
upload.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
upload.o: misc.h localefilter.h ../core/locale.h ../core/confparser.h
upload.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -306,13 +362,17 @@ upload.o: indexpatterns.h ../core/locale.h ../core/config.h
upload.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
upload.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
upload.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
upload.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
upload.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
upload.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
upload.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
upload.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
upload.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
upload.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
upload.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
upload.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
upload.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
upload.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
upload.o: ../core/loadavg.h ../core/sessionmanager.h
upload.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
upload.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
upload.o: ../core/groups.h ../core/group.h ../core/loadavg.h
upload.o: ../core/sessionmanager.h ../core/sessioncontainer.h
upload.o: ../core/system.h ../core/request.h
uptime.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
uptime.o: misc.h localefilter.h ../core/locale.h ../core/confparser.h
uptime.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -320,13 +380,17 @@ uptime.o: indexpatterns.h ../core/locale.h ../core/config.h
uptime.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
uptime.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
uptime.o: ../core/user.h ../core/plugindata.h ../core/rebus.h
uptime.o: ../core/config.h ../core/db.h ../core/group.h ../core/thread.h
uptime.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
uptime.o: ../core/system.h ../core/dirs.h ../core/db.h ../core/request.h
uptime.o: ../core/config.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
uptime.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
uptime.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
uptime.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
uptime.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
uptime.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
uptime.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
uptime.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
uptime.o: ../core/loadavg.h ../core/sessionmanager.h
uptime.o: ../core/sessioncontainer.h ../core/system.h
uptime.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
uptime.o: ../core/groups.h ../core/group.h ../core/loadavg.h
uptime.o: ../core/sessionmanager.h ../core/sessioncontainer.h
uptime.o: ../core/system.h
user.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
user.o: localefilter.h ../core/locale.h ../core/confparser.h
user.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
@ -334,25 +398,33 @@ user.o: indexpatterns.h ../core/locale.h ../core/config.h
user.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
user.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
user.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
user.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
user.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
user.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
user.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
user.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
user.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
user.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
user.o: ../core/ticket.h ../core/system.h ../core/dirs.h
user.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
user.o: ../core/mount.h ../core/mountparser.h ../core/users.h
user.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
user.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
user.o: ../core/request.h ../core/misc.h
user.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
user.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
user.o: ../core/sessioncontainer.h ../core/system.h ../core/request.h
user.o: ../core/misc.h
who.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h misc.h
who.o: localefilter.h ../core/locale.h ../core/confparser.h
who.o: ckeditorgetparser.h ../core/httpsimpleparser.h ../core/log.h
who.o: indexpatterns.h ../core/locale.h ../core/config.h ../core/htmlfilter.h
who.o: ../core/request.h ../core/requesttypes.h ../core/session.h
who.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
who.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../core/db.h
who.o: ../core/group.h ../core/thread.h ../core/dircontainer.h
who.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h ../core/dirs.h
who.o: ../core/db.h ../core/request.h ../core/mounts.h ../core/mount.h
who.o: ../core/mountparser.h ../core/users.h ../core/lastcontainer.h
who.o: ../core/groups.h ../core/loadavg.h ../core/sessionmanager.h
who.o: ../core/plugindata.h ../core/rebus.h ../core/config.h ../db/db.h
who.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
who.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
who.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h ../core/thread.h
who.o: ../core/error.h ../core/dircontainer.h ../core/ugcontainer.h
who.o: ../core/ticket.h ../core/system.h ../core/dirs.h
who.o: ../core/dircontainer.h ../core/request.h ../core/mounts.h
who.o: ../core/mount.h ../core/mountparser.h ../core/users.h
who.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
who.o: ../core/group.h ../core/loadavg.h ../core/sessionmanager.h
who.o: ../core/sessioncontainer.h ../core/system.h ../core/misc.h
winix.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
winix.o: misc.h localefilter.h ../core/locale.h ../core/confparser.h
@ -361,13 +433,17 @@ winix.o: indexpatterns.h ../core/locale.h ../core/config.h
winix.o: ../core/htmlfilter.h ../core/request.h ../core/requesttypes.h
winix.o: ../core/session.h ../core/item.h ../core/error.h ../core/log.h
winix.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/config.h
winix.o: ../core/db.h ../core/group.h ../core/thread.h ../core/dircontainer.h
winix.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
winix.o: ../core/textstream.h ../db/dbitemquery.h ../core/item.h
winix.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
winix.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
winix.o: ../core/ugcontainer.h ../core/ticket.h ../core/system.h
winix.o: ../core/dirs.h ../core/db.h ../core/request.h ../core/mounts.h
winix.o: ../core/mount.h ../core/mountparser.h ../core/users.h
winix.o: ../core/lastcontainer.h ../core/groups.h ../core/loadavg.h
winix.o: ../core/dirs.h ../core/dircontainer.h ../core/request.h
winix.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
winix.o: ../core/users.h ../core/ugcontainer.h ../core/lastcontainer.h
winix.o: ../core/groups.h ../core/group.h ../core/loadavg.h
winix.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
winix.o: ../functions/functions.h ../functions/functionbase.h ../core/item.h
winix.o: ../functions/functions.h ../functions/functionbase.h
winix.o: ../core/notify.h ../templatesnotify/templatesnotify.h
winix.o: ../core/mount.h ../templates/misc.h ../functions/functionparser.h
winix.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
@ -380,7 +456,6 @@ winix.o: ../functions/login.h ../functions/logout.h ../functions/ls.h
winix.o: ../functions/mkdir.h ../functions/mv.h ../functions/node.h
winix.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
winix.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
winix.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
winix.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
winix.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
winix.o: ../core/htmlfilter.h
winix.o: ../functions/funticket.h ../functions/template.h
winix.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
winix.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h

View File

@ -275,6 +275,7 @@ void Templates::CreateFunctions()
ezc_functions.Insert("user_name", user_name);
ezc_functions.Insert("user_logged", user_logged);
ezc_functions.Insert("user_super_user", user_super_user);
ezc_functions.Insert("user_is_in_group", user_is_in_group);
ezc_functions.Insert("user_can_use_html", user_can_use_html);
ezc_functions.Insert("user_can_use_bbcode", user_can_use_bbcode);
ezc_functions.Insert("user_can_use_raw", user_can_use_raw);

View File

@ -19,7 +19,7 @@
#include "indexpatterns.h"
#include "core/config.h"
#include "core/request.h"
#include "core/db.h"
#include "db/db.h"
#include "core/system.h"
#include "core/locale.h"
#include "core/sessionmanager.h"
@ -238,6 +238,7 @@ namespace TemplatesFunctions
void user_name(Info & i);
void user_logged(Info & i);
void user_super_user(Info & i);
void user_is_in_group(Info & i);
void user_can_use_html(Info & i);
void user_can_use_bbcode(Info & i);
void user_can_use_raw(Info & i);

View File

@ -34,6 +34,17 @@ void user_name(Info & i)
}
void user_is_in_group(Info & i)
{
long gid = system->groups.GetGroupId(i.par);
if( !request->session->puser || gid == -1 )
return;
i.res = request->session->puser->IsMemberOf(gid);
}
void user_super_user(Info & i)
{

View File

@ -8,11 +8,14 @@ notify.o: ../templatesnotify/templatesnotify.h ../core/request.h
notify.o: ../core/requesttypes.h ../core/session.h ../core/item.h
notify.o: ../core/error.h ../core/log.h ../core/user.h ../core/plugindata.h
notify.o: ../core/rebus.h ../core/config.h ../core/system.h ../core/dirs.h
notify.o: ../core/dircontainer.h ../core/db.h ../core/group.h
notify.o: ../core/thread.h ../core/ugcontainer.h ../core/ticket.h
notify.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
notify.o: ../core/users.h ../core/lastcontainer.h ../core/groups.h
notify.o: ../core/loadavg.h
notify.o: ../core/dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
notify.o: ../db/dbtextstream.h ../core/textstream.h ../db/dbitemquery.h
notify.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
notify.o: ../core/thread.h ../core/error.h ../core/dircontainer.h
notify.o: ../core/ugcontainer.h ../core/ticket.h ../core/mounts.h
notify.o: ../core/mount.h ../core/mountparser.h ../core/users.h
notify.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/groups.h
notify.o: ../core/group.h ../core/loadavg.h
templatesnotify.o: templatesnotify.h ../../ezc/src/ezc.h ../core/mount.h
templatesnotify.o: ../core/locale.h ../core/confparser.h ../core/config.h
templatesnotify.o: ../core/htmlfilter.h ../templates/misc.h