added: issues ticket system
added functions: ticket, createticket, editticket (there is no 'rm' function working for tickets yet) changed: mount parser and mount points now we have more parameters (arguments in parameters) some refactoring in functions 'emacs' and 'mkdir' git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@554 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
356e93914b
commit
89daf6489d
|
@ -1,177 +1,250 @@
|
||||||
# DO NOT DELETE
|
# DO NOT DELETE
|
||||||
|
|
||||||
cat.o: content.h ../core/item.h ../templates/templates.h
|
cat.o: content.h ../core/item.h ../templates/templates.h
|
||||||
cat.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
cat.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
cat.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
cat.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
cat.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
cat.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
cat.o: ../core/function.h ../core/thread.h ../core/compress.h
|
cat.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
cat.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
cat.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
cat.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
cat.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
cat.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
content.o: content.h ../core/item.h ../templates/templates.h
|
content.o: content.h ../core/item.h ../templates/templates.h
|
||||||
content.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
content.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
content.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
content.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
content.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
content.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
content.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
content.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
content.o: ../core/compress.h ../core/acceptencodingparser.h
|
content.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
content.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
content.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
content.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
content.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
content.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
content.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
content.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
content.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
|
||||||
content.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
content.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||||
content.o: ../core/mount.h ../core/misc.h ../core/plugin.h ../core/request.h
|
content.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
content.o: ../core/data.h ../core/pluginmsg.h
|
content.o: ../core/misc.h ../core/plugin.h ../core/request.h ../core/data.h
|
||||||
|
content.o: ../core/pluginmsg.h
|
||||||
createthread.o: content.h ../core/item.h ../templates/templates.h
|
createthread.o: content.h ../core/item.h ../templates/templates.h
|
||||||
createthread.o: ../templates/patterncacher.h ../core/thread.h
|
createthread.o: ../templates/patterncacher.h ../core/thread.h
|
||||||
createthread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
createthread.o: ../core/ticket.h ../core/done.h ../core/request.h
|
||||||
createthread.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
createthread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
createthread.o: ../core/user.h ../core/rebus.h ../core/function.h
|
createthread.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||||
createthread.o: ../core/thread.h ../core/compress.h
|
createthread.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||||
createthread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
createthread.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
createthread.o: ../core/htmlfilter.h ../core/postmultiparser.h
|
createthread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
createthread.o: ../core/error.h ../core/db.h ../core/group.h
|
createthread.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
createthread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/mount.h
|
createthread.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
createthread.o: ../core/data.h ../core/dirs.h ../core/users.h
|
createthread.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
|
||||||
createthread.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
createthread.o: ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
createthread.o: ../core/mounts.h ../core/mount.h
|
createthread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
createthread.o: ../core/mount.h
|
||||||
|
createticket.o: content.h ../core/item.h ../templates/templates.h
|
||||||
|
createticket.o: ../templates/patterncacher.h ../core/thread.h
|
||||||
|
createticket.o: ../core/ticket.h ../core/done.h ../core/request.h
|
||||||
|
createticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
|
createticket.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||||
|
createticket.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||||
|
createticket.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
|
createticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
createticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
|
createticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
|
createticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
|
||||||
|
createticket.o: ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
|
createticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
createticket.o: ../core/mount.h
|
||||||
default.o: content.h ../core/item.h ../templates/templates.h
|
default.o: content.h ../core/item.h ../templates/templates.h
|
||||||
default.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
default.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
default.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
default.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
default.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
default.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
default.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
default.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
default.o: ../core/compress.h ../core/acceptencodingparser.h
|
default.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
default.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
default.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
default.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
default.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
default.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
default.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
default.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
default.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
|
||||||
default.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
default.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||||
default.o: ../core/mount.h
|
default.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
|
editticket.o: content.h ../core/item.h ../templates/templates.h
|
||||||
|
editticket.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
|
editticket.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
|
editticket.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
|
editticket.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
|
editticket.o: ../core/thread.h ../core/compress.h
|
||||||
|
editticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||||
|
editticket.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||||
|
editticket.o: ../core/error.h ../core/db.h ../core/group.h
|
||||||
|
editticket.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/mount.h
|
||||||
|
editticket.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
|
editticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
editticket.o: ../core/mount.h
|
||||||
emacs.o: content.h ../core/item.h ../templates/templates.h
|
emacs.o: content.h ../core/item.h ../templates/templates.h
|
||||||
emacs.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
emacs.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
emacs.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
emacs.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
emacs.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
emacs.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
emacs.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
emacs.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
emacs.o: ../core/compress.h ../core/acceptencodingparser.h
|
emacs.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
emacs.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
emacs.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
emacs.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
emacs.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
emacs.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
emacs.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
emacs.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
emacs.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||||
emacs.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
emacs.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||||
emacs.o: ../core/mount.h ../core/notify.h
|
emacs.o: ../core/mounts.h ../core/mount.h ../core/notify.h
|
||||||
emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h ../core/misc.h
|
emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h ../core/misc.h
|
||||||
last.o: content.h ../core/item.h ../templates/templates.h
|
last.o: content.h ../core/item.h ../templates/templates.h
|
||||||
last.o: ../templates/patterncacher.h ../core/thread.h
|
last.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
|
last.o: ../core/done.h
|
||||||
login.o: content.h ../core/item.h ../templates/templates.h
|
login.o: content.h ../core/item.h ../templates/templates.h
|
||||||
login.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
login.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
login.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
login.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
login.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
login.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
login.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
login.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
login.o: ../core/compress.h ../core/acceptencodingparser.h
|
login.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
login.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
login.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
login.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
login.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
login.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
login.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
login.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
login.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||||
login.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
login.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||||
login.o: ../core/mount.h
|
login.o: ../core/mounts.h ../core/mount.h
|
||||||
logout.o: content.h ../core/item.h ../templates/templates.h
|
logout.o: content.h ../core/item.h ../templates/templates.h
|
||||||
logout.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
logout.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
logout.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
logout.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
logout.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
logout.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
logout.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
logout.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
logout.o: ../core/compress.h ../core/acceptencodingparser.h
|
logout.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
logout.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
logout.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
logout.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
logout.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||||
logout.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
logout.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||||
logout.o: ../core/groups.h ../core/group.h ../core/functions.h
|
logout.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
logout.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
logout.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
logout.o: ../core/mount.h
|
||||||
ls.o: content.h ../core/item.h ../templates/templates.h
|
ls.o: content.h ../core/item.h ../templates/templates.h
|
||||||
ls.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
ls.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
ls.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
ls.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
ls.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
ls.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
ls.o: ../core/function.h ../core/thread.h ../core/compress.h
|
ls.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
ls.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
ls.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
ls.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/db.h
|
ls.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
ls.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
ls.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h ../core/group.h
|
||||||
|
ls.o: ../core/dircontainer.h ../core/ugcontainer.h
|
||||||
|
misc_item.o: content.h ../core/item.h ../templates/templates.h
|
||||||
|
misc_item.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
|
misc_item.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
|
misc_item.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
|
misc_item.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
|
misc_item.o: ../core/thread.h ../core/compress.h
|
||||||
|
misc_item.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||||
|
misc_item.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||||
|
misc_item.o: ../core/misc.h ../core/db.h ../core/group.h
|
||||||
|
misc_item.o: ../core/dircontainer.h ../core/ugcontainer.h
|
||||||
|
misc_specialfile.o: content.h ../core/item.h ../templates/templates.h
|
||||||
|
misc_specialfile.o: ../templates/patterncacher.h ../core/thread.h
|
||||||
|
misc_specialfile.o: ../core/ticket.h ../core/done.h ../core/request.h
|
||||||
|
misc_specialfile.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
|
misc_specialfile.o: ../core/item.h ../core/error.h ../core/log.h
|
||||||
|
misc_specialfile.o: ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
|
misc_specialfile.o: ../core/thread.h ../core/compress.h
|
||||||
|
misc_specialfile.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||||
|
misc_specialfile.o: ../core/htmlfilter.h ../core/postmultiparser.h
|
||||||
|
misc_specialfile.o: ../core/ticket.h ../core/data.h ../core/dirs.h
|
||||||
|
misc_specialfile.o: ../core/dircontainer.h ../core/users.h
|
||||||
|
misc_specialfile.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
|
misc_specialfile.o: ../core/functions.h ../core/lastcontainer.h
|
||||||
|
misc_specialfile.o: ../core/mounts.h ../core/mount.h
|
||||||
mkdir.o: content.h ../core/item.h ../templates/templates.h
|
mkdir.o: content.h ../core/item.h ../templates/templates.h
|
||||||
mkdir.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
mkdir.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
mkdir.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
mkdir.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
mkdir.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
mkdir.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
mkdir.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
mkdir.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
mkdir.o: ../core/compress.h ../core/acceptencodingparser.h
|
mkdir.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
mkdir.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
mkdir.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
mkdir.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
mkdir.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
mkdir.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
mkdir.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
mkdir.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
mkdir.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||||
mkdir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
mkdir.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||||
mkdir.o: ../core/mount.h ../core/notify.h
|
mkdir.o: ../core/mounts.h ../core/mount.h ../core/notify.h
|
||||||
mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
|
mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
|
||||||
node.o: content.h ../core/item.h ../templates/templates.h
|
node.o: content.h ../core/item.h ../templates/templates.h
|
||||||
node.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
node.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
node.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
node.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
node.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
node.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
node.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
node.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
node.o: ../core/compress.h ../core/acceptencodingparser.h
|
node.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
node.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
node.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
node.o: ../core/postmultiparser.h
|
node.o: ../core/postmultiparser.h ../core/ticket.h
|
||||||
priv.o: content.h ../core/item.h ../templates/templates.h
|
priv.o: content.h ../core/item.h ../templates/templates.h
|
||||||
priv.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
priv.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
priv.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
priv.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
priv.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
priv.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
priv.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
priv.o: ../core/compress.h ../core/acceptencodingparser.h
|
priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
priv.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
priv.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||||
priv.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||||
priv.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||||
priv.o: ../core/mount.h
|
priv.o: ../core/mounts.h ../core/mount.h
|
||||||
reload.o: content.h ../core/item.h ../templates/templates.h
|
reload.o: content.h ../core/item.h ../templates/templates.h
|
||||||
reload.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
reload.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
reload.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
reload.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
reload.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
reload.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
reload.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
reload.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
reload.o: ../core/compress.h ../core/acceptencodingparser.h
|
reload.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
reload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
reload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
reload.o: ../core/postmultiparser.h ../core/error.h
|
reload.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
rm.o: content.h ../core/item.h ../templates/templates.h
|
rm.o: content.h ../core/item.h ../templates/templates.h
|
||||||
rm.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
rm.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
rm.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
rm.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
rm.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
rm.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
rm.o: ../core/function.h ../core/thread.h ../core/compress.h
|
rm.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
rm.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
rm.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
rm.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
rm.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
rm.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
rm.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h ../core/db.h
|
||||||
rm.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
rm.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||||
rm.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
rm.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
rm.o: ../core/mounts.h ../core/mount.h
|
rm.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
rm.o: ../core/mount.h
|
||||||
run.o: content.h ../core/item.h ../templates/templates.h
|
run.o: content.h ../core/item.h ../templates/templates.h
|
||||||
run.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
run.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
run.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
run.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
run.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
run.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
run.o: ../core/function.h ../core/thread.h ../core/compress.h
|
run.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
run.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
run.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
run.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
run.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
run.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||||
thread.o: content.h ../core/item.h ../templates/templates.h
|
thread.o: content.h ../core/item.h ../templates/templates.h
|
||||||
thread.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
thread.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
thread.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
thread.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
thread.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
thread.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
thread.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
thread.o: ../core/compress.h ../core/acceptencodingparser.h
|
thread.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
thread.o: ../core/postmultiparser.h ../core/db.h ../core/group.h
|
thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
|
||||||
thread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
|
thread.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||||
thread.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
|
thread.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
thread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
thread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
thread.o: ../core/mount.h
|
thread.o: ../core/mount.h ../core/mount.h
|
||||||
|
ticket.o: content.h ../core/item.h ../templates/templates.h
|
||||||
|
ticket.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
|
ticket.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
|
ticket.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
|
ticket.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
|
ticket.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
|
ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
|
||||||
|
ticket.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||||
|
ticket.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||||
|
ticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
ticket.o: ../core/mount.h ../core/mount.h
|
||||||
upload.o: content.h ../core/item.h ../templates/templates.h
|
upload.o: content.h ../core/item.h ../templates/templates.h
|
||||||
upload.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
upload.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
upload.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
upload.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||||
upload.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
upload.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
upload.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
upload.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||||
upload.o: ../core/compress.h ../core/acceptencodingparser.h
|
upload.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
upload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
upload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
upload.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
upload.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||||
upload.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
upload.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||||
upload.o: ../core/groups.h ../core/group.h ../core/functions.h
|
upload.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
upload.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
upload.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
upload.o: ../core/mount.h
|
||||||
who.o: content.h ../core/item.h ../templates/templates.h
|
who.o: content.h ../core/item.h ../templates/templates.h
|
||||||
who.o: ../templates/patterncacher.h ../core/thread.h
|
who.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||||
|
who.o: ../core/done.h
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
o = cat.o content.o createthread.o default.o emacs.o last.o login.o logout.o ls.o mkdir.o node.o priv.o reload.o rm.o run.o thread.o upload.o who.o
|
o = cat.o content.o createthread.o createticket.o default.o editticket.o emacs.o last.o login.o logout.o ls.o misc_item.o misc_specialfile.o mkdir.o node.o priv.o reload.o rm.o run.o thread.o ticket.o upload.o who.o
|
||||||
|
|
|
@ -72,7 +72,7 @@ void Content::SetDefaultFunctionForDir()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
if( data.mounts.pmount->type == Mount::thread )
|
||||||
{
|
{
|
||||||
request.pfunction = data.functions.GetFunction(FUN_THREAD);
|
request.pfunction = data.functions.GetFunction(FUN_THREAD);
|
||||||
|
|
||||||
|
@ -80,6 +80,14 @@ void Content::SetDefaultFunctionForDir()
|
||||||
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( data.mounts.pmount->type == Mount::ticket )
|
||||||
|
{
|
||||||
|
request.pfunction = data.functions.GetFunction(FUN_TICKET);
|
||||||
|
|
||||||
|
if( request.pfunction )
|
||||||
|
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// cms
|
// cms
|
||||||
request.pfunction = data.functions.GetFunction(FUN_LS);
|
request.pfunction = data.functions.GetFunction(FUN_LS);
|
||||||
|
@ -184,6 +192,15 @@ void Content::MakeStandardFunction()
|
||||||
else
|
else
|
||||||
if( request.pfunction->code == FUN_UPLOAD )
|
if( request.pfunction->code == FUN_UPLOAD )
|
||||||
FunUpload();
|
FunUpload();
|
||||||
|
else
|
||||||
|
if( request.pfunction->code == FUN_CREATETICKET )
|
||||||
|
FunCreateTicket();
|
||||||
|
else
|
||||||
|
if( request.pfunction->code == FUN_EDITTICKET )
|
||||||
|
FunEditTicket();
|
||||||
|
else
|
||||||
|
if( request.pfunction->code == FUN_TICKET )
|
||||||
|
FunTicket();
|
||||||
else
|
else
|
||||||
request.status = Error::permission_denied;
|
request.status = Error::permission_denied;
|
||||||
|
|
||||||
|
@ -245,6 +262,14 @@ void Content::MakePost()
|
||||||
PostFunUpload();
|
PostFunUpload();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FUN_CREATETICKET:
|
||||||
|
PostFunCreateTicket();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FUN_EDITTICKET:
|
||||||
|
PostFunEditTicket();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log << log1 << "Content: unknown post function" << logend;
|
log << log1 << "Content: unknown post function" << logend;
|
||||||
break;
|
break;
|
||||||
|
@ -388,16 +413,37 @@ Item * pdir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::RedirectToLastDir()
|
||||||
|
{
|
||||||
|
RedirectTo( *request.dir_table.back() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Content::ReadAdditionalInfo()
|
void Content::ReadAdditionalInfo()
|
||||||
{
|
{
|
||||||
if( request.dir_table.empty() )
|
if( request.dir_table.empty() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
if( data.mounts.pmount->type == Mount::thread )
|
||||||
{
|
{
|
||||||
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == Error::ok )
|
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == Error::ok )
|
||||||
request.is_thread = true;
|
request.is_thread = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if( data.mounts.pmount->type == Mount::ticket )
|
||||||
|
{
|
||||||
|
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == Error::ok )
|
||||||
|
{
|
||||||
|
request.is_ticket = true;
|
||||||
|
|
||||||
|
if( !request.is_item && (!request.pfunction || request.pfunction->code == FUN_TICKET) )
|
||||||
|
{
|
||||||
|
db.GetItemById(request.ticket.item_id, request.item);
|
||||||
|
// don't set request.is_item here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -407,7 +453,7 @@ void Content::PrepareUrl(Item & item)
|
||||||
TrimWhite(item.url);
|
TrimWhite(item.url);
|
||||||
|
|
||||||
if( item.url.empty() )
|
if( item.url.empty() )
|
||||||
item.url = item.subject; // if the subject is empty then the url will be corrected by CorrectUrl()
|
item.url = item.subject; // if the subject is empty then the url will be corrected by CorrectUrlOnlyAllowedChar()
|
||||||
|
|
||||||
CorrectUrlOnlyAllowedChar(item.url);
|
CorrectUrlOnlyAllowedChar(item.url);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
#include "../core/item.h"
|
#include "../core/item.h"
|
||||||
#include "../templates/templates.h"
|
#include "../templates/templates.h"
|
||||||
#include "../core/thread.h"
|
#include "../core/thread.h"
|
||||||
|
#include "../core/ticket.h"
|
||||||
|
#include "../core/done.h"
|
||||||
|
|
||||||
|
|
||||||
class Content
|
class Content
|
||||||
|
@ -67,16 +68,29 @@ class Content
|
||||||
static bool FunThreadSort(const Thread & t1, const Thread & t2);
|
static bool FunThreadSort(const Thread & t1, const Thread & t2);
|
||||||
void FunThread();
|
void FunThread();
|
||||||
void FunCreateThread();
|
void FunCreateThread();
|
||||||
|
|
||||||
|
bool FunUploadCheckAccess();
|
||||||
void FunUpload();
|
void FunUpload();
|
||||||
|
|
||||||
bool PostFunSetUrlSubject();
|
bool ReadItemUrlSubject(Item & item, Item::Type item_type);
|
||||||
|
bool ReadItem(Item & item, Item::Type item_type);
|
||||||
|
|
||||||
|
void CheckAccessToItems();
|
||||||
|
|
||||||
void PostFunLogin();
|
void PostFunLogin();
|
||||||
|
|
||||||
void SetContentType();
|
|
||||||
|
void ReadItemContentWithType(Item & item);
|
||||||
|
bool FunEmacsCheckAccess();
|
||||||
void PostFunEmacsAdd();
|
void PostFunEmacsAdd();
|
||||||
void PostFunEmacsEdit(bool with_url);
|
void PostFunEmacsEdit(bool with_url);
|
||||||
|
bool PostEmacsCheckAbuse(bool adding);
|
||||||
|
void PostFunEmacsModifyMountPoint(bool adding);
|
||||||
void PostFunEmacs();
|
void PostFunEmacs();
|
||||||
void PostFunMkdir(bool add_to_dir_table = false, int mask = 0755 );
|
|
||||||
|
bool FunMkdirCheckAccess();
|
||||||
|
void PostFunMkdir(bool add_to_dir_table = false, int privileges = 0755 );
|
||||||
|
void Mkdir(Item & item, bool add_to_dir_table);
|
||||||
long PostFunDefaultParsePath();
|
long PostFunDefaultParsePath();
|
||||||
void PostFunDefault();
|
void PostFunDefault();
|
||||||
void PostFunPriv();
|
void PostFunPriv();
|
||||||
|
@ -84,11 +98,42 @@ class Content
|
||||||
|
|
||||||
bool FunCreateThreadCheckAccess();
|
bool FunCreateThreadCheckAccess();
|
||||||
bool FunCreateThreadCheckAbuse();
|
bool FunCreateThreadCheckAbuse();
|
||||||
|
void ReadThread(Thread & thread);
|
||||||
|
void AddThread();
|
||||||
|
void PostFunCreateThreadLogAndRedirect();
|
||||||
void PostFunCreateThread();
|
void PostFunCreateThread();
|
||||||
|
|
||||||
|
void UploadSaveFile();
|
||||||
void PostFunUpload();
|
void PostFunUpload();
|
||||||
|
|
||||||
|
bool FunCreateTicketCheckAccess();
|
||||||
|
void FunCreateTicket();
|
||||||
|
bool FunCreateTicketCheckAbuse(const Done & done);
|
||||||
|
void PostFunCreateTicketLogAndRedirect();
|
||||||
|
void PostFunCreateTicket();
|
||||||
|
void FunTicket();
|
||||||
|
void TicketDeleteFirst();
|
||||||
|
|
||||||
|
bool FunEditTicketCheckAccess();
|
||||||
|
void PostFunEditTicketLogAndRedirect();
|
||||||
|
void EditTicketModTicket();
|
||||||
|
void EditTicketModDir();
|
||||||
|
void EditTicketModFirstItem();
|
||||||
|
void PostFunEditTicket();
|
||||||
|
void FunEditTicket();
|
||||||
|
|
||||||
|
void AddTicket();
|
||||||
|
void ReadTicket(Ticket & ticket);
|
||||||
|
void ReadTicketType(Ticket & ticket);
|
||||||
|
void ReadTicketStatus(Ticket & ticket);
|
||||||
|
void ReadTicketPriority(Ticket & ticket);
|
||||||
|
void ReadTicketCategory(Ticket & ticket);
|
||||||
|
void ReadTicketExpected(Ticket & ticket);
|
||||||
|
void ReadTicketProgress(Ticket & ticket);
|
||||||
|
|
||||||
void RedirectTo(const Item & item);
|
void RedirectTo(const Item & item);
|
||||||
void RedirectTo(long item_id);
|
void RedirectTo(long item_id);
|
||||||
|
void RedirectToLastDir();
|
||||||
|
|
||||||
void CheckGetPostTimes(time_t difference = 10);
|
void CheckGetPostTimes(time_t difference = 10);
|
||||||
// bool CreateFile(const std::string & path, const std::string & content);
|
// bool CreateFile(const std::string & path, const std::string & content);
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include "../core/data.h"
|
#include "../core/data.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Content::FunCreateThreadCheckAccess()
|
bool Content::FunCreateThreadCheckAccess()
|
||||||
{
|
{
|
||||||
if( !request.CanCreateThread() )
|
if( !request.CanCreateThread() )
|
||||||
|
@ -28,6 +30,7 @@ return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Content::FunCreateThreadCheckAbuse()
|
bool Content::FunCreateThreadCheckAbuse()
|
||||||
{
|
{
|
||||||
if( !CheckRebus() )
|
if( !CheckRebus() )
|
||||||
|
@ -55,49 +58,74 @@ return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadThread(Thread & thread)
|
||||||
|
{
|
||||||
|
thread.parent_id = request.dir_table.back()->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::AddThread()
|
||||||
|
{
|
||||||
|
request.thread.dir_id = request.dir_table.back()->id;
|
||||||
|
request.thread.closed = false;
|
||||||
|
request.thread.items = 1;
|
||||||
|
request.thread.last_item = request.item; // set by PostFunEmacsAdd()
|
||||||
|
|
||||||
|
request.session->done_status = db.AddThread(request.thread);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunCreateThreadLogAndRedirect()
|
||||||
|
{
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
{
|
||||||
|
request.session->done = Done::added_thread;
|
||||||
|
|
||||||
|
log << log2 << "Content: added a new thread" << logend;
|
||||||
|
RedirectToLastDir();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log << log1 << "Content: problem with adding a new thread, error code:"
|
||||||
|
<< request.session->done_status << logend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Content::PostFunCreateThread()
|
void Content::PostFunCreateThread()
|
||||||
{
|
{
|
||||||
if( !FunCreateThreadCheckAccess() )
|
if( !FunCreateThreadCheckAccess() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
ReadItem(request.item, Item::dir);
|
||||||
|
ReadThread(request.thread);
|
||||||
|
request.item.privileges = 0777; // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
||||||
|
|
||||||
if( !FunCreateThreadCheckAbuse() )
|
if( !FunCreateThreadCheckAbuse() )
|
||||||
{
|
{
|
||||||
request.PostVar("url", request.item.url);
|
ReadItemContentWithType(request.item); // for correctly displaying the form
|
||||||
request.PostVar("subject", request.item.subject);
|
|
||||||
request.PostVar("content", request.item.content);
|
|
||||||
SetContentType();
|
|
||||||
SetUser(request.item);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
request.post_table.insert( std::make_pair(std::string("url"), std::string()) ); // !! tymczasowo, zrobic aby mkdir i emacs nie rzucaly wyjatkiem gdy nie ma url zdefiniowanego
|
Mkdir(request.item, true);
|
||||||
|
|
||||||
request.thread.parent_id = request.dir_table.back()->id;
|
|
||||||
PostFunMkdir(true, 0777); // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
{
|
||||||
PostFunEmacs();
|
ReadItemContentWithType(request.item);
|
||||||
|
request.item.type = Item::file;
|
||||||
|
request.item.privileges = 0644; // !! tymczasowo
|
||||||
|
request.item.parent_id = request.dir_table.back()->id;
|
||||||
|
PostFunEmacsAdd();
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
AddThread();
|
||||||
request.thread.dir_id = request.dir_table.back()->id;
|
|
||||||
request.thread.closed = false;
|
|
||||||
request.thread.items = 1;
|
|
||||||
request.thread.last_item = request.item; // set by PostFunEmacs()
|
|
||||||
|
|
||||||
request.session->done_status = db.AddThread(request.thread);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
|
||||||
{
|
|
||||||
request.session->done = Done::added_thread;
|
|
||||||
|
|
||||||
log << log2 << "Content: added a new thread" << logend;
|
|
||||||
RedirectTo(*request.dir_table.back());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PostFunCreateThreadLogAndRedirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,229 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "content.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/error.h"
|
||||||
|
#include "../core/db.h"
|
||||||
|
#include "../core/mount.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Content::FunCreateTicketCheckAccess()
|
||||||
|
{
|
||||||
|
if( !request.CanCreateTicket() )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Content::FunCreateTicketCheckAbuse(const Done & done)
|
||||||
|
{
|
||||||
|
if( !CheckRebus() )
|
||||||
|
{
|
||||||
|
request.status = Error::incorrect_rebus;
|
||||||
|
request.session->done = done;
|
||||||
|
request.session->done_status = Error::incorrect_rebus;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckGetPostTimes();
|
||||||
|
|
||||||
|
if( request.session->spam_score > 0 )
|
||||||
|
{
|
||||||
|
request.status = Error::spam;
|
||||||
|
request.session->done = done;
|
||||||
|
request.session->done_status = Error::spam;
|
||||||
|
|
||||||
|
log << log1 << "Content: ignoring due to suspected spamming" << logend;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketType(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("type", temp);
|
||||||
|
ticket.type = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( ticket.type >= data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||||
|
ticket.type = data.mounts.pmount->param[Mount::par_ticket_type].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketStatus(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("status", temp);
|
||||||
|
ticket.status = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( ticket.status >= data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||||
|
ticket.status = data.mounts.pmount->param[Mount::par_ticket_status].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketPriority(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("priority", temp);
|
||||||
|
ticket.priority = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( ticket.priority >= data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||||
|
ticket.priority = data.mounts.pmount->param[Mount::par_ticket_priority].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketCategory(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("category", temp);
|
||||||
|
ticket.category = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( ticket.category >= data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||||
|
ticket.category = data.mounts.pmount->param[Mount::par_ticket_category].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketExpected(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("expected", temp);
|
||||||
|
ticket.expected = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( ticket.expected >= data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||||
|
ticket.expected = data.mounts.pmount->param[Mount::par_ticket_expected].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicketProgress(Ticket & ticket)
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.PostVar("progress", temp);
|
||||||
|
int p = atoi(temp.c_str());
|
||||||
|
|
||||||
|
if( p < 0 )
|
||||||
|
p = 0;
|
||||||
|
|
||||||
|
if( p > 100 )
|
||||||
|
p = 100;
|
||||||
|
|
||||||
|
ticket.progress = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadTicket(Ticket & ticket)
|
||||||
|
{
|
||||||
|
ticket.parent_id = request.dir_table.back()->id;
|
||||||
|
|
||||||
|
ReadTicketType(ticket);
|
||||||
|
ReadTicketStatus(ticket);
|
||||||
|
ReadTicketPriority(ticket);
|
||||||
|
ReadTicketCategory(ticket);
|
||||||
|
ReadTicketExpected(ticket);
|
||||||
|
ReadTicketProgress(ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::AddTicket()
|
||||||
|
{
|
||||||
|
static std::string temp;
|
||||||
|
|
||||||
|
request.ticket.dir_id = request.dir_table.back()->id; // a new directory created by Mkdir()
|
||||||
|
request.ticket.item_id = request.item.id; // this id is set by PostFunEmacsAdd()
|
||||||
|
|
||||||
|
request.session->done_status = db.AddTicket(request.ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunCreateTicketLogAndRedirect()
|
||||||
|
{
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
{
|
||||||
|
request.session->done = Done::added_ticket;
|
||||||
|
|
||||||
|
log << log2 << "Content: added a new ticket" << logend;
|
||||||
|
RedirectToLastDir();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log << log1 << "Content: problem with adding a new ticket, error code:"
|
||||||
|
<< request.session->done_status << logend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunCreateTicket()
|
||||||
|
{
|
||||||
|
if( !FunCreateTicketCheckAccess() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ReadItem(request.item, Item::dir);
|
||||||
|
ReadTicket(request.ticket);
|
||||||
|
request.item.privileges = 0777; // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
||||||
|
|
||||||
|
if( !FunCreateTicketCheckAbuse(Done::added_ticket) )
|
||||||
|
{
|
||||||
|
ReadItemContentWithType(request.item); // for correctly displaying the form
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Mkdir(request.item, true);
|
||||||
|
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
{
|
||||||
|
ReadItemContentWithType(request.item);
|
||||||
|
request.item.type = Item::file;
|
||||||
|
request.item.privileges = 0644; // !! tymczasowo
|
||||||
|
request.item.parent_id = request.dir_table.back()->id;
|
||||||
|
PostFunEmacsAdd();
|
||||||
|
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
AddTicket();
|
||||||
|
}
|
||||||
|
|
||||||
|
PostFunCreateTicketLogAndRedirect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::FunCreateTicket()
|
||||||
|
{
|
||||||
|
FunCreateTicketCheckAccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "content.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/error.h"
|
||||||
|
#include "../core/db.h"
|
||||||
|
#include "../core/mount.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Content::FunEditTicketCheckAccess()
|
||||||
|
{
|
||||||
|
if( !request.CanEditTicket() )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::EditTicketModTicket()
|
||||||
|
{
|
||||||
|
if( request.session->done_status != Error::ok )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket ticket;
|
||||||
|
ReadTicket(ticket);
|
||||||
|
|
||||||
|
request.ticket.type = ticket.type;
|
||||||
|
request.ticket.status = ticket.status;
|
||||||
|
request.ticket.priority = ticket.priority;
|
||||||
|
request.ticket.category = ticket.category;
|
||||||
|
request.ticket.expected = ticket.expected;
|
||||||
|
request.ticket.progress = ticket.progress;
|
||||||
|
|
||||||
|
request.session->done_status = db.EditTicketById(request.ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::EditTicketModDir()
|
||||||
|
{
|
||||||
|
if( request.session->done_status != Error::ok )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// we don't modify the url
|
||||||
|
|
||||||
|
Item & dir = *request.dir_table.back();
|
||||||
|
bool edit_dir_subject = (dir.subject != request.item.subject);
|
||||||
|
|
||||||
|
if( edit_dir_subject )
|
||||||
|
{
|
||||||
|
dir.subject = request.item.subject;
|
||||||
|
request.session->done_status = db.EditItemById(dir, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::EditTicketModFirstItem()
|
||||||
|
{
|
||||||
|
if( request.session->done_status != Error::ok )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// modyfing the first item (the one with content)
|
||||||
|
ReadItemContentWithType(request.item);
|
||||||
|
|
||||||
|
Item item;
|
||||||
|
db.GetItemById(request.ticket.item_id, item);
|
||||||
|
item.subject = request.item.subject;
|
||||||
|
item.content = request.item.content;
|
||||||
|
item.content_type = request.item.content_type;
|
||||||
|
// the url doesn't matter
|
||||||
|
|
||||||
|
db.EditItemById(item, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunEditTicketLogAndRedirect()
|
||||||
|
{
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
{
|
||||||
|
request.session->done = Done::edited_ticket;
|
||||||
|
|
||||||
|
log << log2 << "Content: edited a ticket" << logend;
|
||||||
|
RedirectToLastDir();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log << log1 << "Content: problem with editing a ticket, error code:"
|
||||||
|
<< request.session->done_status << logend;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunEditTicket()
|
||||||
|
{
|
||||||
|
if( !FunEditTicketCheckAccess() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
ReadItem(request.item, Item::dir);
|
||||||
|
|
||||||
|
if( !FunCreateTicketCheckAbuse(Done::edited_ticket) )
|
||||||
|
{
|
||||||
|
ReadItemContentWithType(request.item); // for correctly displaying the form
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) != Error::ok )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
EditTicketModTicket();
|
||||||
|
EditTicketModDir();
|
||||||
|
EditTicketModFirstItem();
|
||||||
|
PostFunEditTicketLogAndRedirect();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::FunEditTicket()
|
||||||
|
{
|
||||||
|
FunEditTicketCheckAccess();
|
||||||
|
|
||||||
|
db.GetItemById(request.ticket.item_id, request.item);
|
||||||
|
|
||||||
|
// the subject we get from the last directory
|
||||||
|
request.item.subject = request.dir_table.back()->subject;
|
||||||
|
}
|
||||||
|
|
|
@ -17,46 +17,31 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Content::FunEmacsCheckAccess()
|
||||||
void Content::CheckSpecialFile()
|
|
||||||
{
|
{
|
||||||
static std::string fstab = "fstab";
|
if( !request.is_item )
|
||||||
|
|
||||||
Item * etc = data.dirs.GetEtcDir();
|
|
||||||
|
|
||||||
if( !etc )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( request.item.parent_id != etc->id )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( request.item.url == fstab )
|
|
||||||
{
|
{
|
||||||
log << log3 << "Content: reloading mount points" << logend;
|
// adding a new item
|
||||||
data.mounts.ReadMounts(request.item.content);
|
if( !request.CanUseEmacs(*request.dir_table.back()) )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // editing an existing item
|
||||||
|
if( !request.CanUseEmacs(request.item) )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Content::PostFunEmacsAdd()
|
void Content::PostFunEmacsAdd()
|
||||||
{
|
{
|
||||||
request.session->done = Done::added_item;
|
request.session->done = Done::added_item;
|
||||||
|
|
||||||
request.is_item = true;
|
|
||||||
|
|
||||||
SetUser(request.item);
|
|
||||||
|
|
||||||
request.item.group_id = -1;
|
|
||||||
request.item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
|
||||||
request.item.parent_id = request.dir_table.back()->id;
|
|
||||||
request.item.type = Item::file;
|
|
||||||
|
|
||||||
// dates (creation and modification) is set by request.item.Clear() at the beginning
|
|
||||||
|
|
||||||
if( !request.CanUseEmacs(*request.dir_table.back() ) )
|
|
||||||
throw Error(Error::permission_denied);
|
|
||||||
|
|
||||||
request.session->done_status = db.AddItem(request.item);
|
request.session->done_status = db.AddItem(request.item);
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
|
@ -70,14 +55,8 @@ void Content::PostFunEmacsAdd()
|
||||||
|
|
||||||
void Content::PostFunEmacsEdit(bool with_url)
|
void Content::PostFunEmacsEdit(bool with_url)
|
||||||
{
|
{
|
||||||
request.session->done = Done::edited_item;
|
request.item.SetDateModifyToNow();
|
||||||
|
request.session->done = Done::edited_item;
|
||||||
if( !request.CanUseEmacs(request.item) )
|
|
||||||
throw Error(Error::permission_denied);
|
|
||||||
|
|
||||||
time_t t = std::time(0);
|
|
||||||
request.item.date_modification = *std::localtime( &t );
|
|
||||||
|
|
||||||
request.session->done_status = db.EditItemById(request.item, with_url);
|
request.session->done_status = db.EditItemById(request.item, with_url);
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
|
@ -90,79 +69,53 @@ void Content::PostFunEmacsEdit(bool with_url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// returning true if the 'url' has to be change
|
bool Content::PostEmacsCheckAbuse(bool adding)
|
||||||
bool Content::PostFunSetUrlSubject()
|
|
||||||
{
|
{
|
||||||
bool with_url = false;
|
if( !CheckRebus() )
|
||||||
|
|
||||||
std::string * new_url = request.PostVar("url");
|
|
||||||
std::string * new_subject = request.PostVar("subject");
|
|
||||||
|
|
||||||
if( request.is_item )
|
|
||||||
{
|
{
|
||||||
// editing an item
|
request.status = Error::incorrect_rebus;
|
||||||
if( new_url && *new_url != request.item.url )
|
request.session->done = (adding)? Done::added_item : Done::edited_item;
|
||||||
with_url = true;
|
request.session->done_status = Error::incorrect_rebus;
|
||||||
}
|
|
||||||
else
|
return false;
|
||||||
{
|
|
||||||
// adding a new item
|
|
||||||
with_url = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( new_url )
|
// !! is tested in createthread once
|
||||||
request.item.url = *new_url;
|
CheckGetPostTimes();
|
||||||
|
|
||||||
if( new_subject )
|
if( request.session->spam_score > 0 )
|
||||||
request.item.subject = *new_subject;
|
|
||||||
|
|
||||||
|
|
||||||
if( request.item.subject.empty() )
|
|
||||||
{
|
{
|
||||||
request.item.subject = request.dir_table.back()->subject;
|
request.status = Error::spam;
|
||||||
request.item.subject += "_msg_";
|
request.session->done = (adding)? Done::added_item : Done::edited_item;
|
||||||
request.item.subject += ToStr(db.Size(request.dir_table.back()->id, Item::file));
|
request.session->done_status = Error::spam;
|
||||||
|
|
||||||
|
log << log1 << "Content: ignoring due to suspected spamming" << logend;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if request.item.url is empty then it will be set from request.item.subject
|
return true;
|
||||||
PrepareUrl(request.item);
|
|
||||||
|
|
||||||
return with_url;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Content::SetContentType()
|
|
||||||
|
void Content::PostFunEmacsModifyMountPoint(bool adding)
|
||||||
{
|
{
|
||||||
request.item.content_type = Item::ct_formatted_text; // formatted text default
|
if( data.mounts.pmount->type == Mount::thread )
|
||||||
request.PostVar("contenttype", temp);
|
|
||||||
|
|
||||||
if( temp == "text" )
|
|
||||||
request.item.content_type = Item::ct_text;
|
|
||||||
else
|
|
||||||
if( temp == "formatted text" )
|
|
||||||
request.item.content_type = Item::ct_formatted_text;
|
|
||||||
|
|
||||||
if( !request.session->puser )
|
|
||||||
return;
|
|
||||||
|
|
||||||
long user_id = request.session->puser->id;
|
|
||||||
|
|
||||||
if( temp == "html" )
|
|
||||||
{
|
{
|
||||||
if( request.CanUseHtml(user_id) )
|
if( adding )
|
||||||
request.item.content_type = Item::ct_html;
|
db.EditThreadAddItem(request.dir_table.back()->id, request.item.id);
|
||||||
|
|
||||||
|
RedirectToLastDir();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( temp == "bbcode" )
|
if( data.mounts.pmount->type == Mount::ticket )
|
||||||
{
|
{
|
||||||
if( request.CanUseBBCode(user_id) )
|
RedirectToLastDir();
|
||||||
request.item.content_type = Item::ct_bbcode;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( temp == "raw" )
|
|
||||||
{
|
{
|
||||||
if( request.CanUseRaw(user_id) )
|
// Mount::cms
|
||||||
request.item.content_type = Item::ct_raw;
|
RedirectTo(request.item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,103 +123,47 @@ void Content::SetContentType()
|
||||||
|
|
||||||
void Content::PostFunEmacs()
|
void Content::PostFunEmacs()
|
||||||
{
|
{
|
||||||
bool adding = !request.is_item;
|
if( !FunEmacsCheckAccess() )
|
||||||
|
return;
|
||||||
|
|
||||||
try
|
bool adding = !request.is_item;
|
||||||
|
bool edit_with_url = ReadItem(request.item, Item::file);
|
||||||
|
request.session->done_status = Error::ok;
|
||||||
|
|
||||||
|
if( !PostEmacsCheckAbuse(adding) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
if( adding )
|
||||||
{
|
{
|
||||||
bool with_url = PostFunSetUrlSubject();
|
request.is_item = true;
|
||||||
request.PostVar("content", request.item.content);
|
request.item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||||
SetContentType();
|
PostFunEmacsAdd();
|
||||||
|
|
||||||
if( !CheckRebus() )
|
|
||||||
{
|
|
||||||
request.status = Error::spam;
|
|
||||||
SetUser(request.item);
|
|
||||||
request.session->done = (adding)? Done::added_item : Done::edited_item;
|
|
||||||
request.session->done_status = Error::incorrect_rebus;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// !! is tested in createthread once
|
|
||||||
CheckGetPostTimes();
|
|
||||||
|
|
||||||
if( request.session->spam_score > 0 )
|
|
||||||
{
|
|
||||||
request.status = Error::spam;
|
|
||||||
SetUser(request.item);
|
|
||||||
request.session->done = (adding)? Done::added_item : Done::edited_item;
|
|
||||||
request.session->done_status = Error::spam;
|
|
||||||
|
|
||||||
log << log1 << "Content: ignoring due to suspected spamming" << logend;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( adding )
|
|
||||||
PostFunEmacsAdd();
|
|
||||||
else
|
|
||||||
PostFunEmacsEdit(with_url);
|
|
||||||
|
|
||||||
CheckSpecialFile();
|
|
||||||
}
|
}
|
||||||
catch(const Error & e)
|
else
|
||||||
{
|
{
|
||||||
request.session->done_status = e;
|
PostFunEmacsEdit(edit_with_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
{
|
||||||
request.session->item = request.item;
|
PostFunEmacsModifyMountPoint(adding);
|
||||||
|
CheckSpecialFile();
|
||||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
|
||||||
{
|
|
||||||
if( adding )
|
|
||||||
db.EditThreadAddItem(request.dir_table.back()->id, request.item.id);
|
|
||||||
|
|
||||||
|
|
||||||
// request.session->item = request.item;
|
|
||||||
// request.session->done_timer = 2;
|
|
||||||
RedirectTo(*request.dir_table.back());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
request.session->item = request.item;
|
|
||||||
request.session->done_timer = 2;
|
|
||||||
RedirectTo(request.item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log << log1 << "Content: PostFunEmacs: Error: " << request.session->done_status << logend;
|
log << log1 << "Content: PostFunEmacs: Error: "
|
||||||
|
<< request.session->done_status << logend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Content::FunEmacs()
|
void Content::FunEmacs()
|
||||||
{
|
{
|
||||||
if( !request.is_item )
|
FunEmacsCheckAccess();
|
||||||
{
|
|
||||||
// adding a new item
|
|
||||||
if( !request.CanUseEmacs(*request.dir_table.back()) )
|
|
||||||
request.status = Error::permission_denied;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// editing an existing item
|
|
||||||
if( !request.CanUseEmacs(request.item) )
|
|
||||||
{
|
|
||||||
request.status = Error::permission_denied;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,143 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "content.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/misc.h"
|
||||||
|
#include "../core/db.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// returning true if the 'url' has to be changed
|
||||||
|
bool Content::ReadItemUrlSubject(Item & item, Item::Type item_type)
|
||||||
|
{
|
||||||
|
bool with_url = false;
|
||||||
|
|
||||||
|
std::string * new_url = request.PostVar("url");
|
||||||
|
std::string * new_subject = request.PostVar("subject");
|
||||||
|
|
||||||
|
if( item_type == Item::file )
|
||||||
|
{
|
||||||
|
if( !request.is_item || (new_url && *new_url != item.url) )
|
||||||
|
with_url = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
with_url = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( new_url )
|
||||||
|
item.url = *new_url;
|
||||||
|
|
||||||
|
if( new_subject )
|
||||||
|
item.subject = *new_subject;
|
||||||
|
|
||||||
|
|
||||||
|
if( item.subject.empty() )
|
||||||
|
{
|
||||||
|
item.subject = request.dir_table.back()->subject;
|
||||||
|
item.subject += "_msg_";
|
||||||
|
item.subject += ToStr(db.Size(request.dir_table.back()->id, Item::file));
|
||||||
|
}
|
||||||
|
|
||||||
|
// if item.url is empty then it will be set from item.subject
|
||||||
|
PrepareUrl(item);
|
||||||
|
|
||||||
|
return with_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Content::ReadItemContentWithType(Item & item)
|
||||||
|
{
|
||||||
|
item.content_type = Item::ct_formatted_text; // default is formatted text
|
||||||
|
request.PostVar("content", request.item.content);
|
||||||
|
request.PostVar("contenttype", temp);
|
||||||
|
|
||||||
|
// ct_text and ct_formatted_text can use everyone
|
||||||
|
|
||||||
|
if( temp == "0" )
|
||||||
|
item.content_type = Item::ct_text;
|
||||||
|
else
|
||||||
|
if( temp == "1" )
|
||||||
|
item.content_type = Item::ct_formatted_text;
|
||||||
|
|
||||||
|
|
||||||
|
// those below need special privileges
|
||||||
|
|
||||||
|
if( !request.session->puser )
|
||||||
|
return;
|
||||||
|
|
||||||
|
long user_id = request.session->puser->id;
|
||||||
|
|
||||||
|
|
||||||
|
if( temp == "2" )
|
||||||
|
{
|
||||||
|
if( request.CanUseHtml(user_id) )
|
||||||
|
item.content_type = Item::ct_html;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( temp == "3" )
|
||||||
|
{
|
||||||
|
if( request.CanUseBBCode(user_id) )
|
||||||
|
item.content_type = Item::ct_bbcode;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( temp == "4" )
|
||||||
|
{
|
||||||
|
if( request.CanUseRaw(user_id) )
|
||||||
|
item.content_type = Item::ct_raw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// item_type - the type of an item you are expecting to read
|
||||||
|
// returns true if the url has to be changed
|
||||||
|
// at the moment this is only checked for Item::file - for Item::dir it returns always true
|
||||||
|
bool Content::ReadItem(Item & item, Item::Type item_type)
|
||||||
|
{
|
||||||
|
if( item_type == Item::none )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
item.type = item_type;
|
||||||
|
item.parent_id = request.dir_table.back()->id;
|
||||||
|
|
||||||
|
bool edit_with_url = ReadItemUrlSubject(item, item_type);
|
||||||
|
|
||||||
|
SetUser(item);
|
||||||
|
|
||||||
|
if( item_type == Item::file )
|
||||||
|
ReadItemContentWithType(item);
|
||||||
|
|
||||||
|
return edit_with_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// if we don't have access we only remove the item from the table
|
||||||
|
void Content::CheckAccessToItems()
|
||||||
|
{
|
||||||
|
size_t i = 0;
|
||||||
|
|
||||||
|
while( i < request.item_table.size() )
|
||||||
|
{
|
||||||
|
if( !request.HasReadAccess(request.item_table[i]) )
|
||||||
|
{
|
||||||
|
request.item_table.erase(request.item_table.begin() + i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "content.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::CheckSpecialFile()
|
||||||
|
{
|
||||||
|
static std::string fstab = "fstab";
|
||||||
|
|
||||||
|
Item * etc = data.dirs.GetEtcDir();
|
||||||
|
|
||||||
|
if( !etc )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( request.item.parent_id != etc->id )
|
||||||
|
return;
|
||||||
|
|
||||||
|
if( request.item.url == fstab )
|
||||||
|
{
|
||||||
|
log << log3 << "Content: reloading mount points" << logend;
|
||||||
|
|
||||||
|
request.session->done = Done::edited_fstab;
|
||||||
|
request.session->done_status = data.mounts.ReadMounts(request.item.content);
|
||||||
|
request.session->done_timer = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -17,55 +17,49 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Content::PostFunMkdir(bool add_to_dir_table, int mask)
|
bool Content::FunMkdirCheckAccess()
|
||||||
{
|
{
|
||||||
if( !request.CanUseMkdir(*request.dir_table.back()) )
|
if( request.is_item || !request.CanUseMkdir(*request.dir_table.back()) )
|
||||||
{
|
{
|
||||||
request.status = Error::permission_denied;
|
request.status = Error::permission_denied;
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item item;
|
return true;
|
||||||
request.session->done = Done::added_dir;
|
}
|
||||||
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
item.type = Item::dir;
|
void Content::Mkdir(Item & item, bool add_to_dir_table)
|
||||||
request.PostVar("subject", item.subject);
|
{
|
||||||
request.PostVar("url", item.url);
|
request.session->done_status = db.AddItem(item);
|
||||||
item.parent_id = request.dir_table.back()->id;
|
|
||||||
|
|
||||||
SetUser(item);
|
|
||||||
|
|
||||||
item.group_id = -1;
|
|
||||||
item.privileges = mask;
|
|
||||||
item.default_item = -1;
|
|
||||||
|
|
||||||
// dates (creation and modification) is set by the Item() constructor
|
|
||||||
|
|
||||||
PrepareUrl(item);
|
|
||||||
|
|
||||||
request.session->done_status = db.AddItem(item);
|
|
||||||
|
|
||||||
/* }
|
|
||||||
catch(const Error & e)
|
|
||||||
{
|
|
||||||
request.session->done_status = e;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
{
|
||||||
Item * pdir = data.dirs.AddDir(item);
|
Item * pdir = data.dirs.AddDir(item);
|
||||||
|
|
||||||
if( add_to_dir_table )
|
if( add_to_dir_table )
|
||||||
request.dir_table.push_back(pdir);
|
request.dir_table.push_back(pdir);
|
||||||
|
}
|
||||||
request.session->item = item;
|
}
|
||||||
request.session->done_timer = 2;
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::PostFunMkdir(bool add_to_dir_table, int privileges)
|
||||||
|
{
|
||||||
|
if( !FunMkdirCheckAccess() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ReadItem(request.item, Item::dir);
|
||||||
|
request.item.privileges = privileges;
|
||||||
|
request.session->done = Done::added_dir;
|
||||||
|
|
||||||
|
Mkdir(request.item, add_to_dir_table);
|
||||||
|
|
||||||
|
if( request.session->done_status == Error::ok )
|
||||||
|
{
|
||||||
request.notify_code |= CMSLU_NOTIFY_DIR_ADD;
|
request.notify_code |= CMSLU_NOTIFY_DIR_ADD;
|
||||||
|
RedirectTo(request.item);
|
||||||
RedirectTo(item);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -78,13 +72,7 @@ void Content::PostFunMkdir(bool add_to_dir_table, int mask)
|
||||||
|
|
||||||
void Content::FunMkdir()
|
void Content::FunMkdir()
|
||||||
{
|
{
|
||||||
// !! what about an item? (is_item)
|
FunMkdirCheckAccess();
|
||||||
if( !request.CanUseMkdir(*request.dir_table.back()) )
|
|
||||||
{
|
|
||||||
request.status = Error::permission_denied;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ void Content::FunRm()
|
||||||
log << log2 << "Content: deleted item: subject: " << request.item.subject << ", id: " << request.item.id << logend;
|
log << log2 << "Content: deleted item: subject: " << request.item.subject << ", id: " << request.item.id << logend;
|
||||||
TemplatesFunctions::pattern_cacher.DeletePattern(request.item);
|
TemplatesFunctions::pattern_cacher.DeletePattern(request.item);
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
if( data.mounts.pmount->type == Mount::thread )
|
||||||
db.EditThreadRemoveItem(request.item.parent_id);
|
db.EditThreadRemoveItem(request.item.parent_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -33,14 +33,22 @@ bool Content::FunThreadSort(const Thread & t1, const Thread & t2)
|
||||||
|
|
||||||
void Content::FunThread()
|
void Content::FunThread()
|
||||||
{
|
{
|
||||||
|
if( request.is_item )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool asc = true;
|
bool asc = true;
|
||||||
|
|
||||||
if( data.mounts.CurrentMountIsParam(Mount::desc) )
|
if( data.mounts.pmount->IsArg(Mount::par_thread, "sort_desc") )
|
||||||
asc = false;
|
asc = false;
|
||||||
|
|
||||||
|
|
||||||
db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, true, true, asc);
|
db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, true, true, asc);
|
||||||
db.GetThreads(request.dir_table.back()->id, request.thread_tab);
|
db.GetThreads(request.dir_table.back()->id, request.thread_tab);
|
||||||
|
|
||||||
|
CheckAccessToItems();
|
||||||
std::sort(request.thread_tab.begin(), request.thread_tab.end(), FunThreadSort);
|
std::sort(request.thread_tab.begin(), request.thread_tab.end(), FunThreadSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "content.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/db.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
#include "../core/mount.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::TicketDeleteFirst()
|
||||||
|
{
|
||||||
|
if( !request.is_ticket )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(size_t i=0 ; i<request.item_table.size() ; ++i)
|
||||||
|
{
|
||||||
|
if( request.item_table[i].id == request.ticket.item_id )
|
||||||
|
{
|
||||||
|
// this is the first item with the content for the ticket
|
||||||
|
|
||||||
|
if( !request.HasReadAccess(request.item_table[i]) )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
}
|
||||||
|
|
||||||
|
request.item_table.erase(request.item_table.begin() + i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::FunTicket()
|
||||||
|
{
|
||||||
|
if( request.is_item || data.mounts.pmount->type != Mount::ticket )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, true, true, true);
|
||||||
|
db.GetTickets(request.dir_table.back()->id, request.ticket_tab);
|
||||||
|
|
||||||
|
TicketDeleteFirst();
|
||||||
|
CheckAccessToItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,72 +7,106 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <cstdio>
|
||||||
#include "content.h"
|
#include "content.h"
|
||||||
#include "../core/request.h"
|
#include "../core/request.h"
|
||||||
#include "../core/data.h"
|
#include "../core/data.h"
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
|
|
||||||
void Content::FunUpload()
|
|
||||||
|
|
||||||
|
bool Content::FunUploadCheckAccess()
|
||||||
{
|
{
|
||||||
if( request.is_item || !request.CanUseUpload(*request.dir_table.back()) )
|
if( request.is_item || !request.CanUseUpload(*request.dir_table.back()) )
|
||||||
{
|
{
|
||||||
request.status = Error::permission_denied;
|
request.status = Error::permission_denied;
|
||||||
return;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// !! in the future the 'upload' can be used everywhere
|
||||||
|
if( data.mounts.pmount->type != Mount::cms )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Content::UploadSaveFile()
|
||||||
|
{
|
||||||
|
static std::string path;
|
||||||
|
struct stat sb;
|
||||||
|
|
||||||
|
request.MakePath(path);
|
||||||
|
|
||||||
|
if( stat(path.c_str(), &sb) < 0 )
|
||||||
|
{
|
||||||
|
if( !request.MakeDirsOnFS() )
|
||||||
|
{
|
||||||
|
request.status = Error::permission_denied;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() != Mount::cms )
|
path += '/';
|
||||||
|
path += request.item.url;
|
||||||
|
const std::string & tmp_filename = request.post_file_table.begin()->second.tmp_filename;
|
||||||
|
|
||||||
|
if( rename(tmp_filename.c_str(), path.c_str()) == 0 )
|
||||||
|
{
|
||||||
|
log << log1 << "Content: uploaded a new file: " << path << logend;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
|
// !! skasowac takze plik z bazy danych
|
||||||
|
log << log1 << "Content: can't move the tmp file from: " << tmp_filename;
|
||||||
|
log << log1 << ", to: " << path << logend;
|
||||||
request.status = Error::permission_denied;
|
request.status = Error::permission_denied;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Content::PostFunUpload()
|
void Content::PostFunUpload()
|
||||||
{
|
{
|
||||||
if( request.is_item || !request.CanUseUpload(*request.dir_table.back()) )
|
if( !FunUploadCheckAccess() )
|
||||||
{
|
|
||||||
request.status = Error::permission_denied;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() != Mount::cms )
|
|
||||||
{
|
|
||||||
request.status = Error::permission_denied;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( request.post_file_table.empty() )
|
if( request.post_file_table.empty() )
|
||||||
{
|
{
|
||||||
request.status = Error::permission_denied;
|
request.status = Error::permission_denied;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// !! moze request.session->done_status trzeba ustawic na Error::ok na poczatku? (i podobnie w innych metodach, mkdir, emacs ...)
|
||||||
|
ReadItem(request.item, Item::file);
|
||||||
|
|
||||||
|
// !! sprawdzanie rebusa?
|
||||||
|
|
||||||
// !! tutaj w zaleznosci od rozszerzenia dobrac odpowiedni static_auth
|
// !! tutaj w zaleznosci od rozszerzenia dobrac odpowiedni static_auth
|
||||||
request.item.static_auth = Item::static_other;
|
request.item.static_auth = Item::static_other;
|
||||||
|
|
||||||
PostFunEmacs();
|
PostFunEmacsAdd(); // always adding a new item
|
||||||
|
|
||||||
|
|
||||||
if( request.session->done_status == Error::ok )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
UploadSaveFile();
|
||||||
std::string path;
|
|
||||||
|
|
||||||
if( request.MakeDirsOnFS(path) )
|
if( request.session->done_status == Error::ok )
|
||||||
{
|
RedirectTo(request.item);
|
||||||
path += '/';
|
}
|
||||||
path += request.item.url;
|
|
||||||
const std::string & tmp_filename = request.post_file_table.begin()->second.tmp_filename;
|
|
||||||
|
|
||||||
if( rename(tmp_filename.c_str(), path.c_str()) < 0 )
|
|
||||||
{
|
|
||||||
// !! skasowac takze plik z bazy danych
|
void Content::FunUpload()
|
||||||
log << log1 << "Content: can't move the tmp file from: " << tmp_filename;
|
{
|
||||||
log << log1 << ", to: " << path << logend;
|
FunUploadCheckAccess();
|
||||||
request.status = Error::permission_denied;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,21 +4,21 @@ acceptbaseparser.o: acceptbaseparser.h
|
||||||
compress.o: compress.h log.h
|
compress.o: compress.h log.h
|
||||||
config.o: config.h ../confparser/confparser.h log.h data.h dirs.h item.h
|
config.o: config.h ../confparser/confparser.h log.h data.h dirs.h item.h
|
||||||
config.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
|
config.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
|
||||||
config.o: functions.h function.h lastcontainer.h mounts.h mount.h rebus.h
|
config.o: functions.h function.h lastcontainer.h mounts.h mount.h error.h
|
||||||
config.o: plugin.h request.h requesttypes.h session.h done.h error.h thread.h
|
config.o: rebus.h plugin.h request.h requesttypes.h session.h done.h thread.h
|
||||||
config.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
config.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
||||||
config.o: postmultiparser.h pluginmsg.h misc.h
|
config.o: postmultiparser.h ticket.h pluginmsg.h misc.h
|
||||||
data.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
|
data.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
|
||||||
data.o: log.h groups.h group.h functions.h function.h lastcontainer.h
|
data.o: log.h groups.h group.h functions.h function.h lastcontainer.h
|
||||||
data.o: mounts.h mount.h rebus.h
|
data.o: mounts.h mount.h error.h rebus.h
|
||||||
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
|
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
|
||||||
db.o: ugcontainer.h misc.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: db.h item.h user.h group.h thread.h error.h log.h
|
||||||
db_itemcolumns.o: dircontainer.h ugcontainer.h
|
db_itemcolumns.o: dircontainer.h ugcontainer.h ticket.h
|
||||||
dircontainer.o: dircontainer.h item.h log.h
|
dircontainer.o: dircontainer.h item.h log.h
|
||||||
dirs.o: dirs.h item.h dircontainer.h error.h log.h db.h user.h group.h
|
dirs.o: dirs.h item.h dircontainer.h error.h log.h db.h user.h group.h
|
||||||
dirs.o: thread.h ugcontainer.h data.h users.h groups.h functions.h function.h
|
dirs.o: thread.h ugcontainer.h ticket.h data.h users.h groups.h functions.h
|
||||||
dirs.o: lastcontainer.h mounts.h mount.h rebus.h
|
dirs.o: function.h lastcontainer.h mounts.h mount.h rebus.h
|
||||||
done.o: done.h
|
done.o: done.h
|
||||||
error.o: error.h log.h
|
error.o: error.h log.h
|
||||||
function.o: function.h item.h
|
function.o: function.h item.h
|
||||||
|
@ -26,39 +26,39 @@ functioncodeparser.o: functioncodeparser.h item.h function.h log.h
|
||||||
functionparser.o: functionparser.h requesttypes.h log.h item.h error.h data.h
|
functionparser.o: functionparser.h requesttypes.h log.h item.h error.h data.h
|
||||||
functionparser.o: dirs.h dircontainer.h users.h user.h ugcontainer.h groups.h
|
functionparser.o: dirs.h dircontainer.h users.h user.h ugcontainer.h groups.h
|
||||||
functionparser.o: group.h functions.h function.h lastcontainer.h mounts.h
|
functionparser.o: group.h functions.h function.h lastcontainer.h mounts.h
|
||||||
functionparser.o: mount.h rebus.h db.h thread.h request.h session.h done.h
|
functionparser.o: mount.h rebus.h db.h thread.h ticket.h request.h session.h
|
||||||
functionparser.o: compress.h acceptencodingparser.h acceptbaseparser.h
|
functionparser.o: done.h compress.h acceptencodingparser.h acceptbaseparser.h
|
||||||
functionparser.o: htmlfilter.h postmultiparser.h
|
functionparser.o: htmlfilter.h postmultiparser.h
|
||||||
functions.o: functions.h function.h item.h
|
functions.o: functions.h function.h item.h
|
||||||
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.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
|
groups.o: error.h dircontainer.h ticket.h
|
||||||
htmlfilter.o: htmlfilter.h
|
htmlfilter.o: htmlfilter.h
|
||||||
httpsimpleparser.o: httpsimpleparser.h
|
httpsimpleparser.o: httpsimpleparser.h
|
||||||
lastcontainer.o: lastcontainer.h log.h
|
lastcontainer.o: lastcontainer.h log.h
|
||||||
log.o: log.h
|
log.o: log.h
|
||||||
misc.o: misc.h item.h log.h data.h dirs.h dircontainer.h users.h user.h
|
misc.o: misc.h item.h log.h data.h dirs.h dircontainer.h users.h user.h
|
||||||
misc.o: ugcontainer.h groups.h group.h functions.h function.h lastcontainer.h
|
misc.o: ugcontainer.h groups.h group.h functions.h function.h lastcontainer.h
|
||||||
misc.o: mounts.h mount.h rebus.h
|
misc.o: mounts.h mount.h error.h rebus.h
|
||||||
mount.o: mount.h
|
mount.o: mount.h
|
||||||
mountparser.o: mountparser.h mount.h item.h error.h log.h data.h dirs.h
|
mountparser.o: mountparser.h mount.h item.h error.h log.h data.h dirs.h
|
||||||
mountparser.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
|
mountparser.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
|
||||||
mountparser.o: functions.h function.h lastcontainer.h mounts.h rebus.h
|
mountparser.o: functions.h function.h lastcontainer.h mounts.h rebus.h misc.h
|
||||||
mounts.o: mounts.h mount.h data.h dirs.h item.h dircontainer.h users.h user.h
|
mounts.o: mounts.h mount.h error.h log.h data.h dirs.h item.h dircontainer.h
|
||||||
mounts.o: ugcontainer.h log.h groups.h group.h functions.h function.h
|
mounts.o: users.h user.h ugcontainer.h groups.h group.h functions.h
|
||||||
mounts.o: lastcontainer.h rebus.h request.h requesttypes.h session.h done.h
|
mounts.o: function.h lastcontainer.h rebus.h request.h requesttypes.h
|
||||||
mounts.o: error.h thread.h compress.h acceptencodingparser.h
|
mounts.o: session.h done.h thread.h compress.h acceptencodingparser.h
|
||||||
mounts.o: acceptbaseparser.h htmlfilter.h postmultiparser.h mountparser.h
|
mounts.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
|
||||||
mounts.o: db.h
|
mounts.o: mountparser.h db.h
|
||||||
notify.o: log.h notify.h ../templatesnotify/templatesnotify.h ../core/mount.h
|
notify.o: log.h notify.h ../templatesnotify/templatesnotify.h ../core/mount.h
|
||||||
notify.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
|
notify.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
|
||||||
notify.o: groups.h group.h functions.h function.h lastcontainer.h mounts.h
|
notify.o: groups.h group.h functions.h function.h lastcontainer.h mounts.h
|
||||||
notify.o: mount.h rebus.h misc.h request.h requesttypes.h session.h done.h
|
notify.o: mount.h error.h rebus.h misc.h request.h requesttypes.h session.h
|
||||||
notify.o: error.h thread.h compress.h acceptencodingparser.h
|
notify.o: done.h thread.h compress.h acceptencodingparser.h
|
||||||
notify.o: acceptbaseparser.h htmlfilter.h postmultiparser.h
|
notify.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
|
||||||
plugin.o: plugin.h request.h requesttypes.h session.h done.h item.h error.h
|
plugin.o: plugin.h request.h requesttypes.h session.h done.h item.h error.h
|
||||||
plugin.o: log.h user.h rebus.h function.h thread.h compress.h
|
plugin.o: log.h user.h rebus.h function.h thread.h compress.h
|
||||||
plugin.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
plugin.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
||||||
plugin.o: postmultiparser.h data.h dirs.h dircontainer.h users.h
|
plugin.o: postmultiparser.h ticket.h data.h dirs.h dircontainer.h users.h
|
||||||
plugin.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h mounts.h
|
plugin.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h mounts.h
|
||||||
plugin.o: mount.h pluginmsg.h
|
plugin.o: mount.h pluginmsg.h
|
||||||
postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h data.h
|
postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h data.h
|
||||||
|
@ -69,20 +69,21 @@ rebus.o: log.h rebus.h misc.h item.h
|
||||||
request.o: request.h requesttypes.h session.h done.h item.h error.h log.h
|
request.o: request.h requesttypes.h session.h done.h item.h error.h log.h
|
||||||
request.o: user.h rebus.h function.h thread.h compress.h
|
request.o: user.h rebus.h function.h thread.h compress.h
|
||||||
request.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
request.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
|
||||||
request.o: postmultiparser.h getparser.h httpsimpleparser.h postparser.h
|
request.o: postmultiparser.h ticket.h getparser.h httpsimpleparser.h
|
||||||
request.o: cookieparser.h data.h dirs.h dircontainer.h users.h ugcontainer.h
|
request.o: postparser.h cookieparser.h data.h dirs.h dircontainer.h users.h
|
||||||
request.o: groups.h group.h functions.h lastcontainer.h mounts.h mount.h
|
request.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h
|
||||||
request.o: plugin.h pluginmsg.h misc.h
|
request.o: mounts.h mount.h plugin.h pluginmsg.h misc.h db.h
|
||||||
requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h
|
requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h
|
||||||
requestcontroller.o: ../templates/templates.h ../templates/patterncacher.h
|
requestcontroller.o: ../templates/templates.h ../templates/patterncacher.h
|
||||||
requestcontroller.o: ../core/thread.h sessionmanager.h sessioncontainer.h
|
requestcontroller.o: ../core/thread.h ../core/ticket.h ../core/done.h
|
||||||
requestcontroller.o: session.h done.h item.h error.h log.h user.h rebus.h
|
requestcontroller.o: sessionmanager.h sessioncontainer.h session.h done.h
|
||||||
requestcontroller.o: functionparser.h requesttypes.h data.h dirs.h
|
requestcontroller.o: item.h error.h log.h user.h rebus.h functionparser.h
|
||||||
requestcontroller.o: dircontainer.h users.h ugcontainer.h groups.h group.h
|
requestcontroller.o: requesttypes.h data.h dirs.h dircontainer.h users.h
|
||||||
requestcontroller.o: functions.h function.h lastcontainer.h mounts.h mount.h
|
requestcontroller.o: ugcontainer.h groups.h group.h functions.h function.h
|
||||||
requestcontroller.o: request.h thread.h compress.h acceptencodingparser.h
|
requestcontroller.o: lastcontainer.h mounts.h mount.h request.h thread.h
|
||||||
requestcontroller.o: acceptbaseparser.h htmlfilter.h postmultiparser.h
|
requestcontroller.o: compress.h acceptencodingparser.h acceptbaseparser.h
|
||||||
requestcontroller.o: postparser.h httpsimpleparser.h cookieparser.h notify.h
|
requestcontroller.o: htmlfilter.h postmultiparser.h ticket.h postparser.h
|
||||||
|
requestcontroller.o: httpsimpleparser.h cookieparser.h notify.h
|
||||||
requestcontroller.o: ../templatesnotify/templatesnotify.h ../core/mount.h
|
requestcontroller.o: ../templatesnotify/templatesnotify.h ../core/mount.h
|
||||||
session.o: session.h done.h item.h error.h log.h user.h rebus.h
|
session.o: session.h done.h item.h error.h log.h user.h rebus.h
|
||||||
sessioncontainer.o: sessioncontainer.h session.h done.h item.h error.h log.h
|
sessioncontainer.o: sessioncontainer.h session.h done.h item.h error.h log.h
|
||||||
|
@ -92,8 +93,8 @@ sessioncontainer.o: lastcontainer.h mounts.h mount.h
|
||||||
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h done.h item.h
|
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h done.h item.h
|
||||||
sessionmanager.o: error.h log.h user.h rebus.h request.h requesttypes.h
|
sessionmanager.o: error.h log.h user.h rebus.h request.h requesttypes.h
|
||||||
sessionmanager.o: function.h thread.h compress.h acceptencodingparser.h
|
sessionmanager.o: function.h thread.h compress.h acceptencodingparser.h
|
||||||
sessionmanager.o: acceptbaseparser.h htmlfilter.h postmultiparser.h data.h
|
sessionmanager.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
|
||||||
sessionmanager.o: dirs.h dircontainer.h users.h ugcontainer.h groups.h
|
sessionmanager.o: data.h dirs.h dircontainer.h users.h ugcontainer.h groups.h
|
||||||
sessionmanager.o: group.h functions.h lastcontainer.h mounts.h mount.h
|
sessionmanager.o: group.h functions.h lastcontainer.h mounts.h mount.h
|
||||||
sessionmanager.o: sessionparser.h
|
sessionmanager.o: sessionparser.h
|
||||||
sessionparser.o: sessionparser.h session.h done.h item.h error.h log.h user.h
|
sessionparser.o: sessionparser.h session.h done.h item.h error.h log.h user.h
|
||||||
|
@ -101,4 +102,4 @@ sessionparser.o: rebus.h sessioncontainer.h data.h dirs.h dircontainer.h
|
||||||
sessionparser.o: users.h ugcontainer.h groups.h group.h functions.h
|
sessionparser.o: users.h ugcontainer.h groups.h group.h functions.h
|
||||||
sessionparser.o: function.h lastcontainer.h mounts.h mount.h
|
sessionparser.o: function.h lastcontainer.h mounts.h mount.h
|
||||||
users.o: users.h user.h ugcontainer.h log.h db.h item.h group.h thread.h
|
users.o: users.h user.h ugcontainer.h log.h db.h item.h group.h thread.h
|
||||||
users.o: error.h dircontainer.h
|
users.o: error.h dircontainer.h ticket.h
|
||||||
|
|
237
core/db.cpp
237
core/db.cpp
|
@ -935,6 +935,42 @@ Error Db::GetItem(long parent_id, const std::string & url, Item & item)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Error Db::GetItemById(long item_id, Item & item)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
Error result = Error::ok;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "select * from core.item left join core.content on item.content_id = content.id where item.id='" << item_id << "';";
|
||||||
|
|
||||||
|
r = AssertQuery( query.str() );
|
||||||
|
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
|
int rows = PQntuples(r);
|
||||||
|
|
||||||
|
if( rows == 0 )
|
||||||
|
throw Error(Error::no_item);
|
||||||
|
|
||||||
|
ItemColumns col;
|
||||||
|
col.SetColumns(r);
|
||||||
|
col.SetItem(r, 0, item);
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
result = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long Db::GetItemId(long parent_id, const std::string & url, Item::Type type)
|
long Db::GetItemId(long parent_id, const std::string & url, Item::Type type)
|
||||||
{
|
{
|
||||||
|
@ -1443,7 +1479,10 @@ Error Db::GetThreadByDirId(long dir_id, Thread & thread)
|
||||||
AssertConnection();
|
AssertConnection();
|
||||||
|
|
||||||
std::ostringstream query;
|
std::ostringstream query;
|
||||||
query << "select thread.id, thread.parent_id, thread.dir_id, thread.closed, thread.items, thread.last_item, item.date_modification, item.user_id from core.thread left join core.item on thread.last_item = item.id where thread.dir_id = '" << dir_id << "';";
|
query << "select thread.id, thread.parent_id, thread.dir_id, thread.closed, thread.items, "
|
||||||
|
"thread.last_item, item.date_modification, item.user_id "
|
||||||
|
"from core.thread left join core.item on thread.last_item = item.id "
|
||||||
|
"where thread.dir_id = '" << dir_id << "';";
|
||||||
|
|
||||||
r = AssertQuery( query.str() );
|
r = AssertQuery( query.str() );
|
||||||
AssertResultStatus(r, PGRES_TUPLES_OK);
|
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||||
|
@ -1513,7 +1552,7 @@ Error Db::GetThreads(long parent_id, std::vector<Thread> & thread_tab)
|
||||||
int cclosed = AssertColumn(r, "closed");
|
int cclosed = AssertColumn(r, "closed");
|
||||||
int citems = AssertColumn(r, "items");
|
int citems = AssertColumn(r, "items");
|
||||||
int clast_item = AssertColumn(r, "last_item");
|
int clast_item = AssertColumn(r, "last_item");
|
||||||
int cdate_modification = PQfnumber(r, "date_modification");
|
int cdate_modification = PQfnumber(r, "date_modification"); // !! czemu tutaj jest pqfnumber zamiast assertcolumn?
|
||||||
int cuser_id = PQfnumber(r, "user_id");
|
int cuser_id = PQfnumber(r, "user_id");
|
||||||
int cguest_name = PQfnumber(r, "guest_name");
|
int cguest_name = PQfnumber(r, "guest_name");
|
||||||
|
|
||||||
|
@ -1676,3 +1715,197 @@ Error Db::RemoveThread(long dir_id)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error Db::GetTicketByDirId(long dir_id, Ticket & ticket)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
Error status = Error::ok;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "select ticket.id, ticket.dir_id, ticket.parent_id, ticket.type, ticket.status, ticket.priority, "
|
||||||
|
"ticket.category, ticket.expected, ticket.progress, ticket.item_id "
|
||||||
|
"from core.ticket "
|
||||||
|
"where ticket.dir_id = '" << dir_id << "';";
|
||||||
|
|
||||||
|
r = AssertQuery( query.str() );
|
||||||
|
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
|
int rows = PQntuples(r);
|
||||||
|
|
||||||
|
if( rows > 1 )
|
||||||
|
log << log1 << "Db: there is more than one ticket with dir_id: " << dir_id << logend;
|
||||||
|
else
|
||||||
|
if( rows == 0 )
|
||||||
|
throw Error(Error::no_ticket);
|
||||||
|
|
||||||
|
TicketColumns tc;
|
||||||
|
|
||||||
|
tc.SetColumns(r);
|
||||||
|
tc.SetTicket(r, 0, ticket);
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error Db::GetTickets(long parent_id, std::vector<Ticket> & ticket_tab)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
Error status = Error::ok;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "select ticket.id, ticket.dir_id, ticket.parent_id, ticket.type, ticket.status, ticket.priority, "
|
||||||
|
"ticket.category, ticket.expected, ticket.progress, ticket.item_id "
|
||||||
|
"from core.ticket "
|
||||||
|
"where ticket.parent_id = '" << parent_id << "';";
|
||||||
|
|
||||||
|
r = AssertQuery( query.str() );
|
||||||
|
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
|
int rows = PQntuples(r);
|
||||||
|
Ticket ticket;
|
||||||
|
TicketColumns tc;
|
||||||
|
|
||||||
|
tc.SetColumns(r);
|
||||||
|
|
||||||
|
for(int i=0 ; i<rows ; ++i)
|
||||||
|
{
|
||||||
|
tc.SetTicket(r, i, ticket);
|
||||||
|
ticket_tab.push_back(ticket);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
bool Db::IsTicket(long dir_id)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
bool is_ticket = false;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "select ticket.id from core.ticket "
|
||||||
|
"where ticket.dir_id = '" << dir_id << "';";
|
||||||
|
|
||||||
|
r = AssertQuery( query.str() );
|
||||||
|
AssertResultStatus(r, PGRES_TUPLES_OK);
|
||||||
|
|
||||||
|
is_ticket = (PQntuples(r) == 1);
|
||||||
|
}
|
||||||
|
catch(const Error &)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
return is_ticket;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Error Db::AddTicket(Ticket & ticket)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
Error status = Error::ok;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "insert into core.ticket (dir_id, parent_id, type, status, priority, category, expected, progress, item_id) values (";
|
||||||
|
query << '\'' << ticket.dir_id << "', ";
|
||||||
|
query << '\'' << ticket.parent_id << "', ";
|
||||||
|
query << '\'' << ticket.type << "', ";
|
||||||
|
query << '\'' << ticket.status << "', ";
|
||||||
|
query << '\'' << ticket.priority << "', ";
|
||||||
|
query << '\'' << ticket.category << "', ";
|
||||||
|
query << '\'' << ticket.expected << "', ";
|
||||||
|
query << '\'' << ticket.progress << "', ";
|
||||||
|
query << '\'' << ticket.item_id << "');";
|
||||||
|
|
||||||
|
r = AssertQuery(query.str());
|
||||||
|
AssertResultStatus(r, PGRES_COMMAND_OK);
|
||||||
|
|
||||||
|
ticket.id = AssertCurrval("core.ticket_id_seq");
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Error Db::EditTicketById(Ticket & ticket)
|
||||||
|
{
|
||||||
|
PGresult * r = 0;
|
||||||
|
Error status = Error::ok;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
AssertConnection();
|
||||||
|
std::ostringstream query;
|
||||||
|
query << "update core.ticket set (dir_id, parent_id, type, status, priority, category, expected, progress, item_id) = (";
|
||||||
|
query << '\'' << ticket.dir_id << "', ";
|
||||||
|
query << '\'' << ticket.parent_id << "', ";
|
||||||
|
query << '\'' << ticket.type << "', ";
|
||||||
|
query << '\'' << ticket.status << "', ";
|
||||||
|
query << '\'' << ticket.priority << "', ";
|
||||||
|
query << '\'' << ticket.category << "', ";
|
||||||
|
query << '\'' << ticket.expected << "', ";
|
||||||
|
query << '\'' << ticket.progress << "', ";
|
||||||
|
query << '\'' << ticket.item_id << "') ";
|
||||||
|
query << "where id='" << ticket.id << "';";
|
||||||
|
|
||||||
|
r = AssertQuery(query.str());
|
||||||
|
AssertResultStatus(r, PGRES_COMMAND_OK);
|
||||||
|
}
|
||||||
|
catch(const Error & e)
|
||||||
|
{
|
||||||
|
status = e;
|
||||||
|
}
|
||||||
|
|
||||||
|
ClearResult(r);
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
18
core/db.h
18
core/db.h
|
@ -27,7 +27,7 @@
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "dircontainer.h"
|
#include "dircontainer.h"
|
||||||
#include "ugcontainer.h"
|
#include "ugcontainer.h"
|
||||||
|
#include "ticket.h"
|
||||||
|
|
||||||
|
|
||||||
class Db
|
class Db
|
||||||
|
@ -67,6 +67,7 @@ public:
|
||||||
// !! nowy interfejs
|
// !! nowy interfejs
|
||||||
long Size(long parent_id, Item::Type type = Item::none);
|
long Size(long parent_id, Item::Type type = Item::none);
|
||||||
|
|
||||||
|
Error GetItemById(long item_id, Item & item);
|
||||||
Error GetItem(long parent_id, const std::string & url, Item & item);
|
Error GetItem(long parent_id, const std::string & url, Item & item);
|
||||||
Error EditDefaultItem(long id, long new_default_item);
|
Error EditDefaultItem(long id, long new_default_item);
|
||||||
|
|
||||||
|
@ -89,6 +90,13 @@ public:
|
||||||
Error EditThreadRemoveItem(long dir_id);
|
Error EditThreadRemoveItem(long dir_id);
|
||||||
Error RemoveThread(long dir_id);
|
Error RemoveThread(long dir_id);
|
||||||
|
|
||||||
|
|
||||||
|
Error GetTicketByDirId(long dir_id, Ticket & ticket);
|
||||||
|
Error GetTickets(long parent_id, std::vector<Ticket> & ticket_tab);
|
||||||
|
//bool IsTicket(long dir_id);
|
||||||
|
Error AddTicket(Ticket & ticket);
|
||||||
|
Error EditTicketById(Ticket & ticket);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
PGconn * pg_conn;
|
PGconn * pg_conn;
|
||||||
|
@ -137,6 +145,14 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct TicketColumns
|
||||||
|
{
|
||||||
|
int id, dir_id, parent_id, type, status, priority, category, expected, progress, item_id;
|
||||||
|
|
||||||
|
void SetColumns(PGresult * r);
|
||||||
|
void SetTicket(PGresult * r, long row, Ticket & ticket);
|
||||||
|
};
|
||||||
|
|
||||||
}; // class Db
|
}; // class Db
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,5 +59,35 @@ void Db::ItemColumns::SetItem(PGresult * r, long row, Item & item)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,11 @@ public:
|
||||||
privileged_item,
|
privileged_item,
|
||||||
added_dir,
|
added_dir,
|
||||||
added_thread,
|
added_thread,
|
||||||
|
added_ticket,
|
||||||
|
edited_ticket,
|
||||||
defaulted_dir,
|
defaulted_dir,
|
||||||
reloaded_templates,
|
reloaded_templates,
|
||||||
|
edited_fstab,
|
||||||
loggedout
|
loggedout
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ public:
|
||||||
input_too_large,
|
input_too_large,
|
||||||
cant_create_file,
|
cant_create_file,
|
||||||
|
|
||||||
|
no_ticket,
|
||||||
|
|
||||||
unknown = 1000
|
unknown = 1000
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,24 +14,27 @@
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
|
|
||||||
#define FUN_NONE 0
|
#define FUN_NONE 0
|
||||||
#define FUN_LS 1
|
#define FUN_LS 1
|
||||||
#define FUN_CAT 2
|
#define FUN_CAT 2
|
||||||
#define FUN_NODE 3
|
#define FUN_NODE 3
|
||||||
#define FUN_EMACS 4
|
#define FUN_EMACS 4
|
||||||
#define FUN_MKDIR 5
|
#define FUN_MKDIR 5
|
||||||
#define FUN_DEFAULT 6
|
#define FUN_DEFAULT 6
|
||||||
#define FUN_PRIV 7
|
#define FUN_PRIV 7
|
||||||
#define FUN_RM 8
|
#define FUN_RM 8
|
||||||
#define FUN_LOGIN 9
|
#define FUN_LOGIN 9
|
||||||
#define FUN_LOGOUT 10
|
#define FUN_LOGOUT 10
|
||||||
#define FUN_RUN 11
|
#define FUN_RUN 11
|
||||||
#define FUN_WHO 12
|
#define FUN_WHO 12
|
||||||
#define FUN_LAST 13
|
#define FUN_LAST 13
|
||||||
#define FUN_CREATETHREAD 14
|
#define FUN_CREATETHREAD 14
|
||||||
#define FUN_THREAD 15
|
#define FUN_THREAD 15
|
||||||
#define FUN_RELOAD 16
|
#define FUN_RELOAD 16
|
||||||
#define FUN_UPLOAD 17
|
#define FUN_UPLOAD 17
|
||||||
|
#define FUN_CREATETICKET 18
|
||||||
|
#define FUN_EDITTICKET 19
|
||||||
|
#define FUN_TICKET 20
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,19 @@ void Functions::ReadFunctions()
|
||||||
f.item.url = "upload";
|
f.item.url = "upload";
|
||||||
table.insert( std::make_pair(f.item.url, f) );
|
table.insert( std::make_pair(f.item.url, f) );
|
||||||
|
|
||||||
|
f.code = FUN_CREATETICKET;
|
||||||
|
f.item.url = "createticket";
|
||||||
|
table.insert( std::make_pair(f.item.url, f) );
|
||||||
|
|
||||||
|
f.code = FUN_EDITTICKET;
|
||||||
|
f.item.url = "editticket";
|
||||||
|
table.insert( std::make_pair(f.item.url, f) );
|
||||||
|
|
||||||
|
f.code = FUN_TICKET;
|
||||||
|
f.item.url = "ticket";
|
||||||
|
table.insert( std::make_pair(f.item.url, f) );
|
||||||
|
|
||||||
|
|
||||||
// functions which need more privileges
|
// functions which need more privileges
|
||||||
|
|
||||||
f.code = FUN_RELOAD;
|
f.code = FUN_RELOAD;
|
||||||
|
|
18
core/item.h
18
core/item.h
|
@ -88,6 +88,20 @@ Item()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetDateToNow()
|
||||||
|
{
|
||||||
|
time_t t = std::time(0);
|
||||||
|
date_creation = *std::localtime( &t );
|
||||||
|
date_modification = date_creation;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SetDateModifyToNow()
|
||||||
|
{
|
||||||
|
time_t t = std::time(0);
|
||||||
|
date_modification = *std::localtime( &t );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
|
@ -113,9 +127,7 @@ void Clear()
|
||||||
|
|
||||||
static_auth = static_none;
|
static_auth = static_none;
|
||||||
|
|
||||||
time_t t = std::time(0);
|
SetDateToNow();
|
||||||
date_creation = *std::localtime( &t );
|
|
||||||
date_modification = date_creation;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include "item.h"
|
#include "item.h"
|
||||||
|
|
||||||
|
// !! wrzucic do pliku version.h i dodac przedrostek typu WINIX_
|
||||||
|
// albo dac nazwy typu WINIX_VER_MAJOR
|
||||||
#define MAJOR_VER 0
|
#define MAJOR_VER 0
|
||||||
#define MINOR_VER 2
|
#define MINOR_VER 2
|
||||||
#define REVISION_VER 0
|
#define REVISION_VER 0
|
||||||
|
|
173
core/mount.cpp
173
core/mount.cpp
|
@ -14,15 +14,17 @@
|
||||||
|
|
||||||
Mount::Mount()
|
Mount::Mount()
|
||||||
{
|
{
|
||||||
type = cms;
|
type = cms;
|
||||||
dir_id = -1;
|
dir_id = -1;
|
||||||
|
|
||||||
|
param.resize(par_none);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const char * Mount::TypeToStr()
|
const char * Mount::TypeToStr()
|
||||||
{
|
{
|
||||||
static char buffer[30];
|
static char buffer[30];
|
||||||
|
|
||||||
switch( type )
|
switch( type )
|
||||||
{
|
{
|
||||||
|
@ -34,8 +36,12 @@ const char * Mount::TypeToStr()
|
||||||
sprintf(buffer, "thread");
|
sprintf(buffer, "thread");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ticket:
|
||||||
|
sprintf(buffer, "ticket");
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sprintf(buffer, "the name is not set");
|
sprintf(buffer, "unknown");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,82 +49,105 @@ return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Mount::ParseStrParam(const std::string & param, const std::vector<int> & args)
|
|
||||||
|
Mount::ParamCode Mount::ParseParam(const char * param_name)
|
||||||
{
|
{
|
||||||
Param p = none;
|
struct ParName
|
||||||
|
|
||||||
if( param == "asc" )
|
|
||||||
p = asc;
|
|
||||||
else
|
|
||||||
if( param == "desc" )
|
|
||||||
p = desc;
|
|
||||||
else
|
|
||||||
if( param == "withheader" )
|
|
||||||
p = withheader;
|
|
||||||
else
|
|
||||||
if( param == "withinfo" )
|
|
||||||
p = withinfo;
|
|
||||||
else
|
|
||||||
if( param == "thread_with_header" )
|
|
||||||
p = thread_with_header;
|
|
||||||
else
|
|
||||||
if( param == "thread_with_info" )
|
|
||||||
p = thread_with_info;
|
|
||||||
else
|
|
||||||
if( param == "restrictcreatethread" )
|
|
||||||
p = restrictcreatethread;
|
|
||||||
else
|
|
||||||
if( param == "only_root_can_remove" )
|
|
||||||
p = only_root_can_remove;
|
|
||||||
else
|
|
||||||
if( param == "can_use_emacs_on" )
|
|
||||||
p = can_use_emacs_on;
|
|
||||||
else
|
|
||||||
if( param == "can_use_mkdir_on" )
|
|
||||||
p = can_use_mkdir_on;
|
|
||||||
else
|
|
||||||
if( param == "none" )
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
param_table.insert( std::make_pair(p, args) );
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Mount::IsParam(Param p)
|
|
||||||
{
|
|
||||||
ParamTable::iterator i = param_table.find(p);
|
|
||||||
|
|
||||||
if( i == param_table.end() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Mount::IsParam(Param p, int * first_arg)
|
|
||||||
{
|
|
||||||
ParamTable::iterator i = param_table.find(p);
|
|
||||||
|
|
||||||
if( i == param_table.end() )
|
|
||||||
{
|
{
|
||||||
*first_arg = -1;
|
ParamCode param_code;
|
||||||
return false;
|
const char * name;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ParName par_name_tab[] = {
|
||||||
|
{ par_page, "page" },
|
||||||
|
{ par_thread, "thread" },
|
||||||
|
{ par_ticket, "ticket" },
|
||||||
|
{ par_ticket_type, "ticket_type" },
|
||||||
|
{ par_ticket_type_default, "ticket_type_default" },
|
||||||
|
{ par_ticket_status, "ticket_status" },
|
||||||
|
{ par_ticket_status_default, "ticket_status_default" },
|
||||||
|
{ par_ticket_priority, "ticket_priority" },
|
||||||
|
{ par_ticket_priority_default, "ticket_priority_default" },
|
||||||
|
{ par_ticket_category, "ticket_category" },
|
||||||
|
{ par_ticket_category_default, "ticket_category_default" },
|
||||||
|
{ par_ticket_expected, "ticket_expected" },
|
||||||
|
{ par_ticket_expected_default, "ticket_expected_default" },
|
||||||
|
{ par_createthread_on, "createthread_on" },
|
||||||
|
{ par_createticket_on, "createticket_on" },
|
||||||
|
{ par_only_root_remove, "only_root_remove" },
|
||||||
|
{ par_emacs_on, "emacs_on" },
|
||||||
|
{ par_mkdir_on, "mkdir_on" }
|
||||||
|
};
|
||||||
|
|
||||||
|
size_t i, len = sizeof(par_name_tab) / sizeof(ParName);
|
||||||
|
|
||||||
|
for(i=0 ; i<len ; ++i)
|
||||||
|
{
|
||||||
|
if( strcmp(par_name_tab[i].name, param_name) == 0 )
|
||||||
|
return par_name_tab[i].param_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !i->second.empty() )
|
return par_none;
|
||||||
*first_arg = i->second[0];
|
|
||||||
else
|
|
||||||
*first_arg = -1;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Mount::ClearParams()
|
void Mount::ClearParams()
|
||||||
{
|
{
|
||||||
param_table.clear();
|
size_t i;
|
||||||
|
|
||||||
|
for(i=0 ; i<param.size() ; ++i)
|
||||||
|
param[i].Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Mount::IsPar(Mount::ParamCode code)
|
||||||
|
{
|
||||||
|
if( !param[code].defined )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Mount::IsArg(Mount::ParamCode code, const char * arg)
|
||||||
|
{
|
||||||
|
ParamArg::iterator i;
|
||||||
|
|
||||||
|
if( !param[code].defined )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for(i=param[code].arg.begin() ; i!=param[code].arg.end() ; ++i)
|
||||||
|
{
|
||||||
|
if( *i == arg )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Mount::IsArg(Mount::ParamCode code, const std::string & arg)
|
||||||
|
{
|
||||||
|
return IsArg(code, arg.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool Mount::IsArg(Mount::ParamCode code, int arg)
|
||||||
|
{
|
||||||
|
ParamArg::iterator i;
|
||||||
|
|
||||||
|
if( !param[code].defined )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for(i=param[code].arg.begin() ; i!=param[code].arg.end() ; ++i)
|
||||||
|
{
|
||||||
|
if( atoi(i->c_str()) == arg )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
79
core/mount.h
79
core/mount.h
|
@ -16,6 +16,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Mount
|
class Mount
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -24,42 +26,71 @@ public:
|
||||||
enum Type
|
enum Type
|
||||||
{
|
{
|
||||||
cms = 0,
|
cms = 0,
|
||||||
thread
|
thread,
|
||||||
|
ticket
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
enum Param
|
// the first should be with 0 index
|
||||||
|
// the last should be 'none'
|
||||||
|
enum ParamCode
|
||||||
{
|
{
|
||||||
none = 0,
|
par_page = 0,
|
||||||
asc,
|
par_thread,
|
||||||
desc,
|
par_ticket,
|
||||||
withheader,
|
par_ticket_type,
|
||||||
withinfo,
|
par_ticket_type_default,
|
||||||
thread_with_header,
|
par_ticket_status,
|
||||||
thread_with_info,
|
par_ticket_status_default,
|
||||||
restrictcreatethread,
|
par_ticket_priority,
|
||||||
only_root_can_remove,
|
par_ticket_priority_default,
|
||||||
can_use_emacs_on,
|
par_ticket_category,
|
||||||
can_use_mkdir_on
|
par_ticket_category_default,
|
||||||
|
par_ticket_expected,
|
||||||
|
par_ticket_expected_default,
|
||||||
|
par_createthread_on,
|
||||||
|
par_createticket_on,
|
||||||
|
par_only_root_remove,
|
||||||
|
par_emacs_on,
|
||||||
|
par_mkdir_on,
|
||||||
|
|
||||||
|
par_none
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef std::vector<std::string> ParamArg;
|
||||||
|
|
||||||
long dir_id;
|
|
||||||
|
struct ParamRow
|
||||||
|
{
|
||||||
|
bool defined;
|
||||||
|
ParamArg arg;
|
||||||
|
|
||||||
|
ParamRow() { defined = false; }
|
||||||
|
void Clear() { defined = false; arg.clear(); }
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef std::vector<ParamRow> Param;
|
||||||
|
Param param;
|
||||||
|
|
||||||
|
long dir_id;
|
||||||
Type type;
|
Type type;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mount();
|
Mount();
|
||||||
const char * TypeToStr();
|
const char * TypeToStr();
|
||||||
bool ParseStrParam(const std::string & param, const std::vector<int> & args);
|
static ParamCode ParseParam(const char * param);
|
||||||
bool IsParam(Param p);
|
|
||||||
bool IsParam(Param p, int * first_arg);
|
|
||||||
void ClearParams();
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef std::map<Param, std::vector<int> > ParamTable;
|
|
||||||
ParamTable param_table;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
void ClearParams();
|
||||||
|
|
||||||
|
|
||||||
|
bool IsPar(Mount::ParamCode code);
|
||||||
|
|
||||||
|
bool IsArg(Mount::ParamCode code, const char * arg);
|
||||||
|
bool IsArg(Mount::ParamCode code, const std::string & arg);
|
||||||
|
bool IsArg(Mount::ParamCode code, int arg);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "mountparser.h"
|
#include "mountparser.h"
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "misc.h"
|
||||||
|
|
||||||
|
|
||||||
bool MountParser::IsWhite(int c)
|
bool MountParser::IsWhite(int c)
|
||||||
|
@ -39,11 +39,38 @@ void MountParser::SkipLine()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MountParser::ReadWordQuote(std::string & res)
|
||||||
void MountParser::ReadWord(std::string & res)
|
{
|
||||||
|
++pinput;
|
||||||
|
|
||||||
|
while( *pinput && *pinput!=10 && *pinput!='\"' )
|
||||||
|
{
|
||||||
|
if( pinput[0]=='\\' && pinput[1]=='\"' )
|
||||||
|
{
|
||||||
|
res += '\"';
|
||||||
|
pinput += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if( pinput[0]=='\\' && pinput[1]=='\\' )
|
||||||
|
{
|
||||||
|
res += '\\';
|
||||||
|
pinput += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
res += *pinput;
|
||||||
|
pinput += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( *pinput == '"' )
|
||||||
|
++pinput;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// a white character is the separator
|
||||||
|
void MountParser::ReadWordWhite(std::string & res)
|
||||||
{
|
{
|
||||||
res.clear();
|
|
||||||
|
|
||||||
while( *pinput && *pinput!=10 && !IsWhite(*pinput) )
|
while( *pinput && *pinput!=10 && !IsWhite(*pinput) )
|
||||||
{
|
{
|
||||||
res += *pinput;
|
res += *pinput;
|
||||||
|
@ -52,64 +79,71 @@ void MountParser::ReadWord(std::string & res)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MountParser::ReadParamArg(int & out)
|
// the comma or the second bracket ')' are the separators
|
||||||
|
void MountParser::ReadWordComma(std::string & res)
|
||||||
{
|
{
|
||||||
SkipWhite();
|
while( *pinput && *pinput!=10 && *pinput!=',' && *pinput!=')' )
|
||||||
|
{
|
||||||
char * new_pos;
|
res += *pinput;
|
||||||
long temp = strtol(pinput, &new_pos, 10);
|
++pinput;
|
||||||
|
}
|
||||||
|
|
||||||
if( pinput == new_pos )
|
// trimming last white characters
|
||||||
return false;
|
// (white characters can be in the middle of the string)
|
||||||
|
TrimWhite(res);
|
||||||
pinput = new_pos;
|
|
||||||
SkipWhite();
|
|
||||||
|
|
||||||
// here can we make a test whether the temp is greater from 'int' type
|
|
||||||
out = (int)temp;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MountParser::ReadParamArgs(std::vector<int> & args)
|
void MountParser::ReadWord(std::string & res, bool comma_bracket_separator)
|
||||||
{
|
{
|
||||||
int arg;
|
res.clear();
|
||||||
|
SkipWhite();
|
||||||
|
|
||||||
while( ReadParamArg(arg) )
|
if( *pinput == '"' )
|
||||||
{
|
{
|
||||||
args.push_back(arg);
|
ReadWordQuote(res);
|
||||||
|
}
|
||||||
log << log3 << "MP: mount param arg: " << arg << logend;
|
else
|
||||||
|
if( comma_bracket_separator )
|
||||||
|
{
|
||||||
|
ReadWordComma(res);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ReadWordWhite(res);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MountParser::ReadParamArgsLoop(Mount::ParamArg & args)
|
||||||
|
{
|
||||||
|
SkipWhite();
|
||||||
|
|
||||||
|
while( *pinput && *pinput!=10 && *pinput!=')' )
|
||||||
|
{
|
||||||
|
ReadWord(temp_arg, true);
|
||||||
|
|
||||||
|
if( !temp_arg.empty() )
|
||||||
|
args.push_back(temp_arg);
|
||||||
|
|
||||||
if( *pinput == ',' )
|
if( *pinput == ',' )
|
||||||
++pinput;
|
++pinput;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MountParser::ReadParam(std::string & res, std::vector<int> & args)
|
void MountParser::ReadParamArgs(Mount::ParamArg & args)
|
||||||
{
|
{
|
||||||
SkipWhite();
|
SkipWhite();
|
||||||
res.clear();
|
|
||||||
args.clear();
|
args.clear();
|
||||||
|
|
||||||
while( *pinput && *pinput!=10 && *pinput!=',' && *pinput!='(' && !IsWhite(*pinput) )
|
|
||||||
{
|
|
||||||
res += *pinput;
|
|
||||||
++pinput;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( res.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
// reading arguments
|
|
||||||
SkipWhite();
|
|
||||||
if( *pinput == '(' )
|
if( *pinput == '(' )
|
||||||
{
|
{
|
||||||
++pinput;
|
++pinput;
|
||||||
ReadParamArgs(args);
|
ReadParamArgsLoop(args);
|
||||||
|
|
||||||
if( *pinput != ')' )
|
if( *pinput != ')' )
|
||||||
{
|
{
|
||||||
|
@ -121,16 +155,42 @@ void MountParser::ReadParam(std::string & res, std::vector<int> & args)
|
||||||
++pinput;
|
++pinput;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MountParser::ReadParamName(std::string & res)
|
||||||
|
{
|
||||||
|
SkipWhite();
|
||||||
|
res.clear();
|
||||||
|
|
||||||
|
while( *pinput && *pinput!=10 && *pinput!=',' && *pinput!='(' && !IsWhite(*pinput) )
|
||||||
|
{
|
||||||
|
res += *pinput;
|
||||||
|
++pinput;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void MountParser::ReadParam(std::string & res, Mount::ParamArg & args)
|
||||||
|
{
|
||||||
|
ReadParamName(res);
|
||||||
|
|
||||||
|
if( res.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
ReadParamArgs(args);
|
||||||
|
|
||||||
|
SkipWhite();
|
||||||
|
|
||||||
if( *pinput == ',' )
|
if( *pinput == ',' )
|
||||||
++pinput;
|
++pinput;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MountParser::ReadMountType()
|
void MountParser::ReadMountType()
|
||||||
{
|
{
|
||||||
SkipWhite();
|
|
||||||
ReadWord(temp);
|
ReadWord(temp);
|
||||||
|
|
||||||
if( temp.empty() )
|
if( temp.empty() )
|
||||||
|
@ -151,6 +211,12 @@ void MountParser::ReadMountType()
|
||||||
log << log3 << "MP: mount type: thread" << logend;
|
log << log3 << "MP: mount type: thread" << logend;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
if( temp == "ticket" )
|
||||||
|
{
|
||||||
|
mount.type = Mount::ticket;
|
||||||
|
log << log3 << "MP: mount type: ticket" << logend;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
err = Error::mount_unknown;
|
err = Error::mount_unknown;
|
||||||
log << log1 << "MP: unknown mount type: " << temp << logend;
|
log << log1 << "MP: unknown mount type: " << temp << logend;
|
||||||
|
@ -161,9 +227,6 @@ void MountParser::ReadMountType()
|
||||||
|
|
||||||
void MountParser::ReadMountPoint()
|
void MountParser::ReadMountPoint()
|
||||||
{
|
{
|
||||||
SkipWhite();
|
|
||||||
|
|
||||||
// !! narazie bez cudzyslowow
|
|
||||||
ReadWord(temp);
|
ReadWord(temp);
|
||||||
|
|
||||||
pdir = data.dirs.GetDir(temp);
|
pdir = data.dirs.GetDir(temp);
|
||||||
|
@ -182,21 +245,41 @@ void MountParser::ReadMountPoint()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void MountParser::LogMountParams()
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
log << log3 << "MP: mount param: " << temp << "(";
|
||||||
|
|
||||||
|
for(i=0 ; i<param_args.size() ; ++i)
|
||||||
|
{
|
||||||
|
log << param_args[i];
|
||||||
|
|
||||||
|
if( i != param_args.size()-1 )
|
||||||
|
log << ",";
|
||||||
|
}
|
||||||
|
|
||||||
|
log << ")" << logend;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MountParser::ReadMountParams()
|
void MountParser::ReadMountParams()
|
||||||
{
|
{
|
||||||
mount.ClearParams();
|
mount.ClearParams();
|
||||||
|
|
||||||
for( ReadParam(temp, param_args) ; !temp.empty() ; ReadParam(temp, param_args) )
|
for( ReadParam(temp, param_args) ; !temp.empty() ; ReadParam(temp, param_args) )
|
||||||
{
|
{
|
||||||
if( !mount.ParseStrParam(temp, param_args) )
|
Mount::ParamCode p = Mount::ParseParam(temp.c_str());
|
||||||
|
|
||||||
|
if( p != Mount::par_none )
|
||||||
{
|
{
|
||||||
log << log1 << "MP: unknown mount param: " << temp << logend;
|
mount.param[p].defined = true;
|
||||||
err = Error::mount_no_param;
|
mount.param[p].arg = param_args;
|
||||||
return;
|
LogMountParams();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log << log3 << "MP: mount param: " << temp << logend;
|
log << log1 << "MP: unknown mount param: " << temp << " (skipped)" << logend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,8 +304,13 @@ void MountParser::ReadRow(std::map<long, Mount> & output)
|
||||||
ReadMountParams();
|
ReadMountParams();
|
||||||
|
|
||||||
if( err == Error::ok )
|
if( err == Error::ok )
|
||||||
output.insert( std::make_pair(mount.dir_id, mount) );
|
{
|
||||||
|
std::pair<std::map<long, Mount>::iterator, bool> res = output.insert( std::make_pair(mount.dir_id, mount) );
|
||||||
|
|
||||||
|
if( !res.second )
|
||||||
|
log << log1 << "MP: this mount point exists (skipped)" << logend;
|
||||||
|
}
|
||||||
|
|
||||||
SkipLine();
|
SkipLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,18 +34,24 @@ private:
|
||||||
bool IsWhite(int c);
|
bool IsWhite(int c);
|
||||||
void SkipWhite();
|
void SkipWhite();
|
||||||
void SkipLine();
|
void SkipLine();
|
||||||
void ReadWord(std::string & res);
|
void ReadWordQuote(std::string & res);
|
||||||
bool ReadParamArg(int & out);
|
void ReadWordWhite(std::string & res);
|
||||||
void ReadParamArgs(std::vector<int> & args);
|
void ReadWordComma(std::string & res);
|
||||||
void ReadParam(std::string & res, std::vector<int> & args);
|
void ReadWord(std::string & res, bool comma_bracket_separator = false);
|
||||||
|
void ReadParamArgsLoop(Mount::ParamArg & args);
|
||||||
|
void ReadParamArgs(Mount::ParamArg & args);
|
||||||
|
void ReadParamName(std::string & res);
|
||||||
|
void ReadParam(std::string & res, Mount::ParamArg & args);
|
||||||
void ReadMountType();
|
void ReadMountType();
|
||||||
void ReadMountPoint();
|
void ReadMountPoint();
|
||||||
|
void LogMountParams();
|
||||||
void ReadMountParams();
|
void ReadMountParams();
|
||||||
void ReadRow(std::map<long, Mount> & output);
|
void ReadRow(std::map<long, Mount> & output);
|
||||||
|
|
||||||
const char * pinput;
|
const char * pinput;
|
||||||
std::string temp;
|
std::string temp;
|
||||||
std::vector<int> param_args;
|
std::string temp_arg;
|
||||||
|
Mount::ParamArg param_args;
|
||||||
|
|
||||||
|
|
||||||
Mount mount;
|
Mount mount;
|
||||||
|
|
|
@ -16,23 +16,34 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Mounts::Mounts()
|
||||||
|
{
|
||||||
|
pmount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// reading from 'mounts'
|
// reading from 'mounts'
|
||||||
void Mounts::ReadMounts(const std::string & mounts)
|
Error Mounts::ReadMounts(const std::string & mounts)
|
||||||
{
|
{
|
||||||
MountParser mp;
|
MountParser mp;
|
||||||
Error err = mp.Parse(mounts, mount_table);
|
Error err = mp.Parse(mounts, mount_tab);
|
||||||
|
|
||||||
if( err != Error::ok )
|
if( err != Error::ok )
|
||||||
{
|
{
|
||||||
log << log1 << "M: some problems with mountpoints (mountpoints table will be empty)" << logend;
|
log << log1 << "M: some problems with mountpoints (mountpoints table will be empty)" << logend;
|
||||||
mount_table.clear();
|
mount_tab.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CalcCurMount();
|
||||||
|
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// reading from /etc/fstab
|
// reading from /etc/fstab
|
||||||
void Mounts::ReadMounts()
|
Error Mounts::ReadMounts()
|
||||||
{
|
{
|
||||||
static std::string file = "fstab";
|
static std::string file = "fstab";
|
||||||
|
|
||||||
|
@ -41,7 +52,7 @@ void Mounts::ReadMounts()
|
||||||
if( !etc )
|
if( !etc )
|
||||||
{
|
{
|
||||||
log << log1 << "M: there is no /etc directory" << logend;
|
log << log1 << "M: there is no /etc directory" << logend;
|
||||||
return;
|
return Error::no_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
Item fstab;
|
Item fstab;
|
||||||
|
@ -50,81 +61,63 @@ void Mounts::ReadMounts()
|
||||||
if( err == Error::no_item )
|
if( err == Error::no_item )
|
||||||
{
|
{
|
||||||
log << log1 << "M: there is no /etc/fstab file" << logend;
|
log << log1 << "M: there is no /etc/fstab file" << logend;
|
||||||
return;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( err != Error::ok )
|
if( err != Error::ok )
|
||||||
{
|
{
|
||||||
log << log1 << "M: cannot read /etc/fstab" << logend;
|
log << log1 << "M: cannot read /etc/fstab" << logend;
|
||||||
return;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadMounts(fstab.content);
|
return ReadMounts(fstab.content);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
Mount Mounts::GetCurrentMountPoint()
|
|
||||||
{
|
|
||||||
return current_dir;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
Mount::Type Mounts::CurrentMountType()
|
|
||||||
{
|
|
||||||
return current_dir.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Mounts::CurrentMountIsParam(Mount::Param p)
|
|
||||||
{
|
|
||||||
return current_dir.IsParam(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Mounts::CurrentMountIsParam(Mount::Param p, int * first_arg)
|
|
||||||
{
|
|
||||||
return current_dir.IsParam(p, first_arg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Mounts::MountCmsForRoot()
|
void Mounts::MountCmsForRoot()
|
||||||
{
|
{
|
||||||
current_dir.type = Mount::cms;
|
Mount mount;
|
||||||
|
mount.type = Mount::cms;
|
||||||
|
|
||||||
Item * proot = data.dirs.GetRootDir();
|
Item * proot = data.dirs.GetRootDir();
|
||||||
|
|
||||||
if( proot )
|
if( proot )
|
||||||
current_dir.dir_id = proot->id;
|
mount.dir_id = proot->id;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
current_dir.dir_id = -1;
|
mount.dir_id = -1;
|
||||||
log << log1 << "M: there is no a root dir" << logend;
|
log << log1 << "M: there is no a root dir" << logend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::pair<MountTab::iterator, bool> res = mount_tab.insert( std::make_pair(mount.dir_id, mount) );
|
||||||
|
pmount = &(res.first->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Mounts::CalculateCurrentMountType()
|
void Mounts::CalcCurMount()
|
||||||
{
|
{
|
||||||
std::vector<Item*>::reverse_iterator i;
|
std::vector<Item*>::reverse_iterator i;
|
||||||
|
|
||||||
|
// when the program starts (when the dir_table is empty()
|
||||||
|
// we don't want to call MountCmsForRoot()
|
||||||
|
if( request.dir_table.empty() )
|
||||||
|
return;
|
||||||
|
|
||||||
for(i = request.dir_table.rbegin() ; i!=request.dir_table.rend() ; ++i)
|
for(i = request.dir_table.rbegin() ; i!=request.dir_table.rend() ; ++i)
|
||||||
{
|
{
|
||||||
std::map<long, Mount>::iterator m = mount_table.find( (*i)->id );
|
std::map<long, Mount>::iterator m = mount_tab.find( (*i)->id );
|
||||||
|
|
||||||
if( m != mount_table.end() )
|
if( m != mount_tab.end() )
|
||||||
{
|
{
|
||||||
current_dir = m->second;
|
pmount = &(m->second);
|
||||||
log << log2 << "M: current mount point is: " << current_dir.TypeToStr() << logend;
|
log << log2 << "M: current mount point is: " << pmount->TypeToStr() << logend;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if nothing was found
|
||||||
// we assume that 'cms' mount point is used
|
// we assume that 'cms' mount point is used
|
||||||
MountCmsForRoot();
|
MountCmsForRoot();
|
||||||
log << log2 << "M: current mount point is: cms (default)" << logend;
|
log << log2 << "M: current mount point is: cms (default)" << logend;
|
||||||
|
|
|
@ -15,36 +15,32 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "mount.h"
|
#include "mount.h"
|
||||||
|
#include "error.h"
|
||||||
|
|
||||||
|
|
||||||
class Mounts
|
class Mounts
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
void ReadMounts(const std::string & mounts);
|
Mounts();
|
||||||
void ReadMounts();
|
Error ReadMounts(const std::string & mounts);
|
||||||
|
Error ReadMounts();
|
||||||
|
|
||||||
|
void CalcCurMount();
|
||||||
|
|
||||||
void CalculateCurrentMountType();
|
|
||||||
|
|
||||||
// !! nie lepiej aby zwracal tutaj referencje albo wskaznik na biezacy punkt?
|
|
||||||
// !! w Mount mamy strukture std::set
|
|
||||||
//Mount GetCurrentMountPoint();
|
|
||||||
|
|
||||||
Mount::Type CurrentMountType();
|
|
||||||
bool CurrentMountIsParam(Mount::Param p);
|
|
||||||
bool CurrentMountIsParam(Mount::Param p, int * first_arg);
|
|
||||||
|
|
||||||
void MountCmsForRoot();
|
|
||||||
|
|
||||||
|
|
||||||
|
// current mount point
|
||||||
|
// will not be null after calling CalcCurMount() or ReadMounts([...])
|
||||||
|
Mount * pmount;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Mount current_dir;
|
|
||||||
|
|
||||||
// dir_id, mount_point
|
// dir_id, mount_point
|
||||||
std::map<long, Mount> mount_table;
|
typedef std::map<long, Mount> MountTab;
|
||||||
|
MountTab mount_tab;
|
||||||
|
|
||||||
|
|
||||||
|
void MountCmsForRoot();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ Users::Iterator i;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
n.notify_code = notify_code;
|
n.notify_code = notify_code;
|
||||||
n.current_mount_type = data.mounts.CurrentMountType();
|
n.current_mount_type = data.mounts.pmount->type;
|
||||||
n.doc_base_url = data.base_url;
|
n.doc_base_url = data.base_url;
|
||||||
CreateItemDir(n.item_dir);
|
CreateItemDir(n.item_dir);
|
||||||
CreateItemLink(n.item_link);
|
CreateItemLink(n.item_link);
|
||||||
|
@ -214,13 +214,13 @@ Users::Iterator i;
|
||||||
{
|
{
|
||||||
sending = false;
|
sending = false;
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() == Mount::thread )
|
if( data.mounts.pmount->type == Mount::thread )
|
||||||
{
|
{
|
||||||
if( (i->thread_notify & notify_code) != 0 )
|
if( (i->thread_notify & notify_code) != 0 )
|
||||||
sending = true;
|
sending = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if( data.mounts.CurrentMountType() == Mount::cms )
|
if( data.mounts.pmount->type == Mount::cms )
|
||||||
{
|
{
|
||||||
if( (i->cms_notify & notify_code) != 0 )
|
if( (i->cms_notify & notify_code) != 0 )
|
||||||
sending = true;
|
sending = true;
|
||||||
|
|
129
core/request.cpp
129
core/request.cpp
|
@ -18,7 +18,7 @@
|
||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "db.h"
|
||||||
|
|
||||||
|
|
||||||
Request::Request() : char_empty(0)
|
Request::Request() : char_empty(0)
|
||||||
|
@ -95,6 +95,11 @@ void Request::Clear()
|
||||||
is_thread = false;
|
is_thread = false;
|
||||||
thread.Clear();
|
thread.Clear();
|
||||||
thread_tab.clear();
|
thread_tab.clear();
|
||||||
|
|
||||||
|
is_ticket = false;
|
||||||
|
ticket.Clear();
|
||||||
|
ticket_tab.clear();
|
||||||
|
|
||||||
notify_code = 0;
|
notify_code = 0;
|
||||||
browser_msie = false;
|
browser_msie = false;
|
||||||
redirect_to.clear();
|
redirect_to.clear();
|
||||||
|
@ -416,13 +421,13 @@ void Request::SendHeaders(bool compressing, Header header)
|
||||||
{
|
{
|
||||||
case h_404:
|
case h_404:
|
||||||
FCGX_PutS("Status: 404 Not Found\r\n", out);
|
FCGX_PutS("Status: 404 Not Found\r\n", out);
|
||||||
FCGX_PutS("Content-Type: Text/Html\r\n", out);
|
FCGX_PutS("Content-Type: text/html\r\n", out);
|
||||||
log << log2 << "Request: response: 404 Not Found" << logend;
|
log << log2 << "Request: response: 404 Not Found" << logend;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case h_403:
|
case h_403:
|
||||||
FCGX_PutS("Status: 403 Forbidden\r\n", out);
|
FCGX_PutS("Status: 403 Forbidden\r\n", out);
|
||||||
FCGX_PutS("Content-Type: Text/Html\r\n", out);
|
FCGX_PutS("Content-Type: text/html\r\n", out);
|
||||||
log << log2 << "Request: response: 403 Forbidden" << logend;
|
log << log2 << "Request: response: 403 Forbidden" << logend;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -430,7 +435,7 @@ void Request::SendHeaders(bool compressing, Header header)
|
||||||
FCGX_PutS("Status: 200 OK\r\n", out);
|
FCGX_PutS("Status: 200 OK\r\n", out);
|
||||||
|
|
||||||
if( role != authorizer )
|
if( role != authorizer )
|
||||||
FCGX_PutS("Content-Type: Text/Html\r\n", out);
|
FCGX_PutS("Content-Type: text/html\r\n", out);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -683,31 +688,76 @@ bool Request::CanCreateThread(bool check_root)
|
||||||
if( !HasWriteAccess(*request.dir_table.back()) )
|
if( !HasWriteAccess(*request.dir_table.back()) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( data.mounts.CurrentMountType() != Mount::thread )
|
if( !data.mounts.pmount || data.mounts.pmount->type != Mount::thread )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !check_root && session && session->puser && session->puser->super_user )
|
if( !check_root && session && session->puser && session->puser->super_user )
|
||||||
// super can create thread regardless of the restrictcreatethread option
|
// super can create thread regardless of the restrictcreatethread option
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if( !data.mounts.pmount->IsPar(Mount::par_createthread_on) )
|
||||||
|
return true;
|
||||||
|
|
||||||
// !! w przyszlosci mozna odczytywac wiecej parametrow od restrictcreatethread
|
if( data.mounts.pmount->IsArg(Mount::par_createthread_on, request.dir_table.size()) )
|
||||||
// tymczasowo wykorzystujemy tylko pierwszy
|
return true;
|
||||||
int level;
|
|
||||||
if( data.mounts.CurrentMountIsParam(Mount::restrictcreatethread, &level) )
|
|
||||||
{
|
|
||||||
if( level == -1 )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// we can only allow on a specific level
|
return false;
|
||||||
if( int(request.dir_table.size()) != level )
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// returning true if we can create a ticket in the current directory
|
||||||
|
bool Request::CanCreateTicket(bool check_root)
|
||||||
|
{
|
||||||
|
if( request.dir_table.empty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( request.is_item )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( !HasWriteAccess(*request.dir_table.back()) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( !data.mounts.pmount || data.mounts.pmount->type != Mount::ticket )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
// checking for par_createticket_on mount option
|
||||||
|
|
||||||
|
if( !check_root && session && session->puser && session->puser->super_user )
|
||||||
|
// super can create tickets regardless of the createticket_on option
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( !data.mounts.pmount->IsPar(Mount::par_createticket_on) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( data.mounts.pmount->IsArg(Mount::par_createticket_on, request.dir_table.size()) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool Request::CanEditTicket()
|
||||||
|
{
|
||||||
|
if( request.dir_table.empty() )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( request.is_item || !request.is_ticket )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( !HasWriteAccess(*request.dir_table.back()) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( !data.mounts.pmount || data.mounts.pmount->type != Mount::ticket )
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Request::CanRemove(const Item & item)
|
bool Request::CanRemove(const Item & item)
|
||||||
{
|
{
|
||||||
if( item.parent_id == -1 )
|
if( item.parent_id == -1 )
|
||||||
|
@ -729,8 +779,7 @@ bool Request::CanRemove(const Item & item)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( data.mounts.CurrentMountIsParam(Mount::only_root_can_remove) )
|
if( data.mounts.pmount->IsPar(Mount::par_only_root_remove) )
|
||||||
// this can be deleted only be a root
|
|
||||||
if( !request.session->puser || !request.session->puser->super_user )
|
if( !request.session->puser || !request.session->puser->super_user )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -747,13 +796,13 @@ bool Request::CanUseEmacs(const Item & item, bool check_root)
|
||||||
if( !request.HasWriteAccess(item) )
|
if( !request.HasWriteAccess(item) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int level;
|
if( !data.mounts.pmount->IsPar(Mount::par_emacs_on) )
|
||||||
if( data.mounts.CurrentMountIsParam(Mount::can_use_emacs_on, &level) )
|
return true;
|
||||||
if( level != int(request.dir_table.size()) )
|
|
||||||
return false;
|
if( data.mounts.pmount->IsArg(Mount::par_emacs_on, request.dir_table.size()) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -770,13 +819,13 @@ bool Request::CanUseMkdir(const Item & item, bool check_root)
|
||||||
if( !request.HasWriteAccess(item) )
|
if( !request.HasWriteAccess(item) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int level;
|
if( !data.mounts.pmount->IsPar(Mount::par_mkdir_on) )
|
||||||
if( data.mounts.CurrentMountIsParam(Mount::can_use_mkdir_on, &level) )
|
return true;
|
||||||
if( level != int(request.dir_table.size()) )
|
|
||||||
return false;
|
if( data.mounts.pmount->IsArg(Mount::par_mkdir_on, request.dir_table.size()) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -839,20 +888,32 @@ return false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// !! dobrac lepsze nazwy dla tych dwoch metod
|
||||||
|
void Request::MakePath(std::string & path)
|
||||||
bool Request::MakeDirsOnFS(std::string & path)
|
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
path = data.static_auth_dir;
|
path = data.static_auth_dir;
|
||||||
|
|
||||||
|
// skipping the first - the first is root
|
||||||
|
for(i=1 ; i<dir_table.size() ; ++i)
|
||||||
|
{
|
||||||
|
path += '/';
|
||||||
|
path += dir_table[i]->url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Request::MakeDirsOnFS()
|
||||||
|
{
|
||||||
|
size_t i;
|
||||||
|
std::string path = data.static_auth_dir;
|
||||||
|
|
||||||
// skipping the first - the first is root
|
// skipping the first - the first is root
|
||||||
for(i=1 ; i<dir_table.size() ; ++i)
|
for(i=1 ; i<dir_table.size() ; ++i)
|
||||||
{
|
{
|
||||||
path += '/';
|
path += '/';
|
||||||
path += dir_table[i]->url;
|
path += dir_table[i]->url;
|
||||||
|
|
||||||
if( mkdir(path.c_str(), 0750) < 0 )
|
if( mkdir(path.c_str(), 0755) < 0 )
|
||||||
{
|
{
|
||||||
// oops
|
// oops
|
||||||
log << log1 << "Request: can't create the directory on fs: " << path << logend;
|
log << log1 << "Request: can't create the directory on fs: " << path << logend;
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "acceptencodingparser.h"
|
#include "acceptencodingparser.h"
|
||||||
#include "htmlfilter.h"
|
#include "htmlfilter.h"
|
||||||
#include "postmultiparser.h"
|
#include "postmultiparser.h"
|
||||||
|
#include "ticket.h"
|
||||||
|
|
||||||
|
|
||||||
struct Request
|
struct Request
|
||||||
|
@ -104,6 +105,11 @@ struct Request
|
||||||
Thread thread;
|
Thread thread;
|
||||||
std::vector<Thread> thread_tab;
|
std::vector<Thread> thread_tab;
|
||||||
|
|
||||||
|
// current ticket (if exists)
|
||||||
|
bool is_ticket;
|
||||||
|
Ticket ticket;
|
||||||
|
std::vector<Ticket> ticket_tab;
|
||||||
|
|
||||||
// if not empty means an address for redirecting to
|
// if not empty means an address for redirecting to
|
||||||
std::string redirect_to;
|
std::string redirect_to;
|
||||||
|
|
||||||
|
@ -146,6 +152,8 @@ struct Request
|
||||||
bool HasReadExecAccess(const Item & item);
|
bool HasReadExecAccess(const Item & item);
|
||||||
|
|
||||||
bool CanCreateThread(bool check_root = false);
|
bool CanCreateThread(bool check_root = false);
|
||||||
|
bool CanCreateTicket(bool check_root = false);
|
||||||
|
bool CanEditTicket();
|
||||||
bool CanRemove(const Item & item);
|
bool CanRemove(const Item & item);
|
||||||
bool CanUseEmacs(const Item & item, bool check_root = false);
|
bool CanUseEmacs(const Item & item, bool check_root = false);
|
||||||
bool CanUseMkdir(const Item & item, bool check_root = false);
|
bool CanUseMkdir(const Item & item, bool check_root = false);
|
||||||
|
@ -155,7 +163,8 @@ struct Request
|
||||||
bool CanUseBBCode(long user_id);
|
bool CanUseBBCode(long user_id);
|
||||||
bool CanUseRaw(long user_id);
|
bool CanUseRaw(long user_id);
|
||||||
|
|
||||||
bool MakeDirsOnFS(std::string & path);
|
void MakePath(std::string & path);
|
||||||
|
bool MakeDirsOnFS();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ void RequestController::Loop()
|
||||||
request.session->CheckTimers();
|
request.session->CheckTimers();
|
||||||
|
|
||||||
function_parser.Parse();
|
function_parser.Parse();
|
||||||
data.mounts.CalculateCurrentMountType();
|
data.mounts.CalcCurMount();
|
||||||
|
|
||||||
content.ReadAdditionalInfo();
|
content.ReadAdditionalInfo();
|
||||||
content.Make();
|
content.Make();
|
||||||
|
|
|
@ -19,8 +19,6 @@ class Thread
|
||||||
public:
|
public:
|
||||||
|
|
||||||
long id;
|
long id;
|
||||||
|
|
||||||
// !! parent_id potrzebne w ogole jest?
|
|
||||||
long parent_id;
|
long parent_id;
|
||||||
|
|
||||||
long dir_id;
|
long dir_id;
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef headerfilecmslucoreticket
|
||||||
|
#define headerfilecmslucoreticket
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
struct Ticket
|
||||||
|
{
|
||||||
|
long id;
|
||||||
|
long dir_id;
|
||||||
|
long parent_id;
|
||||||
|
unsigned int type;
|
||||||
|
unsigned int status;
|
||||||
|
unsigned int priority;
|
||||||
|
unsigned int category;
|
||||||
|
unsigned int expected;
|
||||||
|
unsigned int progress; // 0 - 100 (percentage)
|
||||||
|
|
||||||
|
// the first item (with the content for the ticket)
|
||||||
|
long item_id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
id = -1;
|
||||||
|
dir_id = -1;
|
||||||
|
parent_id = -1;
|
||||||
|
type = 0;
|
||||||
|
status = 0;
|
||||||
|
priority = 0;
|
||||||
|
category = 0;
|
||||||
|
expected = 0;
|
||||||
|
progress = 0;
|
||||||
|
item_id = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Ticket()
|
||||||
|
{
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
main.o: ../core/requestcontroller.h ../content/content.h ../core/item.h
|
main.o: ../core/requestcontroller.h ../content/content.h ../core/item.h
|
||||||
main.o: ../templates/templates.h ../templates/patterncacher.h
|
main.o: ../templates/templates.h ../templates/patterncacher.h
|
||||||
main.o: ../core/thread.h ../core/sessionmanager.h ../core/sessioncontainer.h
|
main.o: ../core/thread.h ../core/ticket.h ../core/done.h
|
||||||
main.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
main.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/session.h
|
||||||
main.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/functionparser.h
|
main.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
||||||
|
main.o: ../core/user.h ../core/rebus.h ../core/functionparser.h
|
||||||
main.o: ../core/requesttypes.h ../core/data.h ../core/dirs.h
|
main.o: ../core/requesttypes.h ../core/data.h ../core/dirs.h
|
||||||
main.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
main.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
||||||
main.o: ../core/groups.h ../core/group.h ../core/functions.h
|
main.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||||
|
@ -12,7 +13,7 @@ main.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
main.o: ../core/mount.h ../core/log.h ../core/request.h ../core/thread.h
|
main.o: ../core/mount.h ../core/log.h ../core/request.h ../core/thread.h
|
||||||
main.o: ../core/compress.h ../core/acceptencodingparser.h
|
main.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
main.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
main.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
main.o: ../core/postmultiparser.h ../core/db.h ../core/config.h
|
main.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
|
||||||
main.o: ../confparser/confparser.h ../core/notify.h
|
main.o: ../core/config.h ../confparser/confparser.h ../core/notify.h
|
||||||
main.o: ../templatesnotify/templatesnotify.h ../core/mount.h ../core/plugin.h
|
main.o: ../templatesnotify/templatesnotify.h ../core/mount.h ../core/plugin.h
|
||||||
main.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
|
main.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
|
||||||
|
|
|
@ -5,8 +5,8 @@ dir.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||||
dir.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
dir.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||||
dir.o: ../core/function.h ../core/thread.h ../core/compress.h
|
dir.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||||
dir.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
dir.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||||
dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/data.h
|
dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||||
dir.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||||
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
dir.o: ../core/mount.h ../core/db.h ../core/log.h ../core/misc.h
|
dir.o: ../core/mount.h ../core/db.h ../core/log.h ../core/misc.h
|
||||||
|
@ -15,122 +15,134 @@ doc.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
doc.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
doc.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
doc.o: ../core/group.h ../core/functions.h ../core/function.h
|
doc.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
doc.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
doc.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
doc.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
doc.o: ../core/compress.h ../core/acceptencodingparser.h
|
doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
doc.o: ../core/postmultiparser.h ../core/misc.h
|
doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
done.o: templates.h patterncacher.h ../core/item.h ../core/request.h
|
done.o: templates.h patterncacher.h ../core/item.h ../core/request.h
|
||||||
done.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
done.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
done.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
done.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||||
done.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
done.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||||
done.o: ../core/compress.h ../core/acceptencodingparser.h
|
done.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
done.o: ../core/postmultiparser.h ../core/misc.h
|
done.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
item.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
item.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
item.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
item.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
item.o: ../core/group.h ../core/functions.h ../core/function.h
|
item.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
item.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
item.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
item.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
item.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
item.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
item.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
item.o: ../core/compress.h ../core/acceptencodingparser.h
|
item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
item.o: ../core/postmultiparser.h ../core/misc.h
|
item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
last.o: templates.h patterncacher.h ../core/item.h ../core/lastcontainer.h
|
last.o: templates.h patterncacher.h ../core/item.h ../core/lastcontainer.h
|
||||||
last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
last.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||||
last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
last.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||||
last.o: ../core/groups.h ../core/group.h ../core/functions.h
|
last.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||||
last.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
last.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
last.o: ../core/mount.h ../core/rebus.h ../core/request.h
|
last.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
last.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
last.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
last.o: ../core/error.h ../core/thread.h ../core/compress.h
|
last.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
last.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
last.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
last.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
mount.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
mount.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
mount.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
mount.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
mount.o: ../core/group.h ../core/functions.h ../core/function.h
|
mount.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
mount.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
mount.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
mount.o: ../core/rebus.h
|
mount.o: ../core/error.h ../core/rebus.h
|
||||||
patterncacher.o: patterncacher.h ../core/item.h ../core/data.h ../core/dirs.h
|
patterncacher.o: patterncacher.h ../core/item.h ../core/data.h ../core/dirs.h
|
||||||
patterncacher.o: ../core/item.h ../core/dircontainer.h ../core/users.h
|
patterncacher.o: ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
patterncacher.o: ../core/user.h ../core/ugcontainer.h ../core/log.h
|
patterncacher.o: ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||||
patterncacher.o: ../core/groups.h ../core/group.h ../core/functions.h
|
patterncacher.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||||
patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
patterncacher.o: ../core/mount.h ../core/rebus.h ../core/log.h
|
patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h
|
||||||
|
patterncacher.o: ../core/log.h
|
||||||
priv.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
priv.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
priv.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
priv.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
priv.o: ../core/group.h ../core/functions.h ../core/function.h
|
priv.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
priv.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
priv.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
priv.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
priv.o: ../core/compress.h ../core/acceptencodingparser.h
|
priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
priv.o: ../core/postmultiparser.h ../core/misc.h
|
priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
rebus.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
rebus.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||||
rebus.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
rebus.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
||||||
rebus.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h
|
rebus.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h
|
||||||
rebus.o: ../core/compress.h ../core/acceptencodingparser.h
|
rebus.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
rebus.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
rebus.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
rebus.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
rebus.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||||
rebus.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
rebus.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||||
rebus.o: ../core/groups.h ../core/group.h ../core/functions.h
|
rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
rebus.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h templates.h
|
rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
rebus.o: patterncacher.h ../core/item.h
|
rebus.o: ../core/mount.h templates.h patterncacher.h ../core/item.h
|
||||||
sys.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
sys.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
sys.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
sys.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
sys.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
sys.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
sys.o: ../core/group.h ../core/functions.h ../core/function.h
|
sys.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
sys.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
sys.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
sys.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
sys.o: ../core/compress.h ../core/acceptencodingparser.h
|
sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
sys.o: ../core/postmultiparser.h ../core/misc.h
|
sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
templates.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
templates.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
templates.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
templates.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||||
templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h
|
templates.o: ../core/users.h ../core/user.h ../core/ugcontainer.h
|
||||||
templates.o: ../core/log.h ../core/groups.h ../core/group.h
|
templates.o: ../core/log.h ../core/groups.h ../core/group.h
|
||||||
templates.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
templates.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||||
templates.o: ../core/mounts.h ../core/mount.h ../core/rebus.h
|
templates.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h
|
||||||
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||||
templates.o: ../core/done.h ../core/error.h ../core/thread.h
|
templates.o: ../core/done.h ../core/thread.h ../core/compress.h
|
||||||
templates.o: ../core/compress.h ../core/acceptencodingparser.h
|
templates.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||||
templates.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
templates.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
|
||||||
templates.o: ../core/postmultiparser.h ../core/misc.h ../core/plugin.h
|
templates.o: ../core/misc.h ../core/plugin.h ../core/request.h ../core/data.h
|
||||||
templates.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
|
templates.o: ../core/pluginmsg.h
|
||||||
thread.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
thread.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
thread.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||||
thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
thread.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||||
thread.o: ../core/groups.h ../core/group.h ../core/functions.h
|
thread.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||||
thread.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
thread.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
thread.o: ../core/mount.h ../core/rebus.h ../core/request.h
|
thread.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
thread.o: ../core/error.h ../core/thread.h ../core/compress.h
|
thread.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
|
ticket.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
|
ticket.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h
|
||||||
|
ticket.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h
|
||||||
|
ticket.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||||
|
ticket.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
||||||
|
ticket.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
|
ticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
|
ticket.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
|
ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
user.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
user.o: templates.h patterncacher.h ../core/item.h ../core/data.h
|
||||||
user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
user.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
|
||||||
user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
user.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
|
||||||
user.o: ../core/group.h ../core/functions.h ../core/function.h
|
user.o: ../core/group.h ../core/functions.h ../core/function.h
|
||||||
user.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
user.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||||
user.o: ../core/rebus.h ../core/request.h ../core/requesttypes.h
|
user.o: ../core/error.h ../core/rebus.h ../core/request.h
|
||||||
user.o: ../core/session.h ../core/done.h ../core/error.h ../core/thread.h
|
user.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||||
user.o: ../core/compress.h ../core/acceptencodingparser.h
|
user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||||
user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
user.o: ../core/postmultiparser.h ../core/misc.h
|
user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
who.o: templates.h patterncacher.h ../core/item.h ../core/sessioncontainer.h
|
who.o: templates.h patterncacher.h ../core/item.h ../core/sessioncontainer.h
|
||||||
who.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
who.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||||
who.o: ../core/log.h ../core/user.h ../core/rebus.h
|
who.o: ../core/log.h ../core/user.h ../core/rebus.h
|
||||||
who.o: ../core/requestcontroller.h ../content/content.h
|
who.o: ../core/requestcontroller.h ../content/content.h
|
||||||
who.o: ../templates/templates.h ../core/thread.h ../core/sessionmanager.h
|
who.o: ../templates/templates.h ../core/thread.h ../core/ticket.h
|
||||||
who.o: ../core/sessioncontainer.h ../core/functionparser.h
|
who.o: ../core/done.h ../core/sessionmanager.h ../core/sessioncontainer.h
|
||||||
who.o: ../core/requesttypes.h ../core/data.h ../core/dirs.h
|
who.o: ../core/functionparser.h ../core/requesttypes.h ../core/data.h
|
||||||
who.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
who.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||||
who.o: ../core/groups.h ../core/group.h ../core/functions.h
|
who.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
|
||||||
who.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
|
who.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
|
||||||
who.o: ../core/mount.h ../core/request.h ../core/thread.h ../core/compress.h
|
who.o: ../core/mounts.h ../core/mount.h ../core/request.h ../core/thread.h
|
||||||
who.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
who.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||||
who.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/misc.h
|
who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||||
|
who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
o = dir.o doc.o done.o item.o last.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o user.o who.o
|
o = dir.o doc.o done.o item.o last.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o
|
||||||
|
|
|
@ -65,28 +65,25 @@ void item_content_noescape(Info & i)
|
||||||
|
|
||||||
void item_content_type_is(Info & i)
|
void item_content_type_is(Info & i)
|
||||||
{
|
{
|
||||||
switch(request.item.content_type)
|
i.result = false;
|
||||||
{
|
|
||||||
case Item::ct_text:
|
|
||||||
i.out_string = "text";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case Item::ct_formatted_text:
|
if( !i.is )
|
||||||
i.out_string = "formatted text";
|
return;
|
||||||
break;
|
|
||||||
|
|
||||||
case Item::ct_html:
|
if( request.item.content_type == Item::ct_text && (*i.is) == "text" )
|
||||||
i.out_string = "html";
|
i.result = true;
|
||||||
break;
|
|
||||||
|
|
||||||
case Item::ct_bbcode:
|
if( request.item.content_type == Item::ct_formatted_text && (*i.is) == "formatted text" )
|
||||||
i.out_string = "bbcode";
|
i.result = true;
|
||||||
break;
|
|
||||||
|
|
||||||
case Item::ct_raw:
|
if( request.item.content_type == Item::ct_html && (*i.is) == "html" )
|
||||||
i.out_string = "raw";
|
i.result = true;
|
||||||
break;
|
|
||||||
}
|
if( request.item.content_type == Item::ct_bbcode && (*i.is) == "bbcode" )
|
||||||
|
i.result = true;
|
||||||
|
|
||||||
|
if( request.item.content_type == Item::ct_raw && (*i.is) == "raw" )
|
||||||
|
i.result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,40 +16,44 @@ namespace TemplatesFunctions
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
void mount_param_withheader(Info & i)
|
|
||||||
|
|
||||||
|
void mount_page_is(Info & i)
|
||||||
{
|
{
|
||||||
i.result = data.mounts.CurrentMountIsParam(Mount::withheader);
|
if( !i.is )
|
||||||
|
return;
|
||||||
|
|
||||||
|
i.result = data.mounts.pmount->IsArg(Mount::par_page, *i.is);
|
||||||
|
}
|
||||||
|
|
||||||
|
void mount_thread_is(Info & i)
|
||||||
|
{
|
||||||
|
if( !i.is )
|
||||||
|
return;
|
||||||
|
|
||||||
|
i.result = data.mounts.pmount->IsArg(Mount::par_thread, *i.is);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mount_type_is_thread(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->type == Mount::thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mount_type_is_ticket(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->type == Mount::ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mount_type_is_cms(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->type == Mount::cms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void mount_param_withinfo(Info & i)
|
|
||||||
{
|
|
||||||
i.result = data.mounts.CurrentMountIsParam(Mount::withinfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void mount_param_thread_with_header(Info & i)
|
|
||||||
{
|
|
||||||
i.result = data.mounts.CurrentMountIsParam(Mount::thread_with_header);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void mount_param_thread_with_info(Info & i)
|
|
||||||
{
|
|
||||||
i.result = data.mounts.CurrentMountIsParam(Mount::thread_with_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void mount_is_thread(Info & i)
|
|
||||||
{
|
|
||||||
i.result = data.mounts.CurrentMountType() == Mount::thread;
|
|
||||||
}
|
|
||||||
|
|
||||||
void mount_is_cms(Info & i)
|
|
||||||
{
|
|
||||||
i.result = data.mounts.CurrentMountType() == Mount::cms;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace TemplatesFunctions
|
} // namespace TemplatesFunctions
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ Ezc::Pattern pat_fun_thread;
|
||||||
Ezc::Pattern pat_fun_reload;
|
Ezc::Pattern pat_fun_reload;
|
||||||
Ezc::Pattern pat_fun_createthread;
|
Ezc::Pattern pat_fun_createthread;
|
||||||
Ezc::Pattern pat_fun_upload;
|
Ezc::Pattern pat_fun_upload;
|
||||||
|
Ezc::Pattern pat_fun_ticket;
|
||||||
|
Ezc::Pattern pat_fun_createticket;
|
||||||
Ezc::Pattern pat_err_item_required;
|
Ezc::Pattern pat_err_item_required;
|
||||||
Ezc::Pattern pat_err_404;
|
Ezc::Pattern pat_err_404;
|
||||||
Ezc::Pattern pat_err_per_denied;
|
Ezc::Pattern pat_err_per_denied;
|
||||||
|
@ -120,6 +122,15 @@ Ezc::Pattern * p = 0;
|
||||||
p = &pat_fun_createthread;
|
p = &pat_fun_createthread;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FUN_TICKET:
|
||||||
|
p = &pat_fun_ticket;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FUN_CREATETICKET:
|
||||||
|
case FUN_EDITTICKET:
|
||||||
|
p = &pat_fun_createticket;
|
||||||
|
break;
|
||||||
|
|
||||||
case FUN_UPLOAD:
|
case FUN_UPLOAD:
|
||||||
p = &pat_fun_upload;
|
p = &pat_fun_upload;
|
||||||
break;
|
break;
|
||||||
|
@ -217,6 +228,7 @@ void Templates::CreateFunctions()
|
||||||
functions.Insert("doc_is_error", doc_is_error);
|
functions.Insert("doc_is_error", doc_is_error);
|
||||||
functions.Insert("doc_status", doc_status);
|
functions.Insert("doc_status", doc_status);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
item
|
item
|
||||||
*/
|
*/
|
||||||
|
@ -390,15 +402,69 @@ void Templates::CreateFunctions()
|
||||||
functions.Insert("thread_can_create", thread_can_create);
|
functions.Insert("thread_can_create", thread_can_create);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
ticket
|
||||||
|
*/
|
||||||
|
functions.Insert("ticket_is", ticket_is);
|
||||||
|
functions.Insert("ticket_can_create", ticket_can_create);
|
||||||
|
functions.Insert("ticket_type", ticket_type);
|
||||||
|
functions.Insert("ticket_status", ticket_status);
|
||||||
|
functions.Insert("ticket_priority", ticket_priority);
|
||||||
|
functions.Insert("ticket_category", ticket_category);
|
||||||
|
functions.Insert("ticket_expected", ticket_expected);
|
||||||
|
functions.Insert("ticket_progress", ticket_progress);
|
||||||
|
|
||||||
|
functions.Insert("ticket_tab", ticket_tab);
|
||||||
|
functions.Insert("ticket_tab_url", ticket_tab_url);
|
||||||
|
functions.Insert("ticket_tab_subject", ticket_tab_subject);
|
||||||
|
functions.Insert("ticket_tab_subject_empty", ticket_tab_subject_empty);
|
||||||
|
functions.Insert("ticket_tab_author", ticket_tab_author);
|
||||||
|
functions.Insert("ticket_tab_type", ticket_tab_type);
|
||||||
|
functions.Insert("ticket_tab_status", ticket_tab_status);
|
||||||
|
functions.Insert("ticket_tab_priority", ticket_tab_priority);
|
||||||
|
functions.Insert("ticket_tab_category", ticket_tab_category);
|
||||||
|
functions.Insert("ticket_tab_expected", ticket_tab_expected);
|
||||||
|
functions.Insert("ticket_tab_progress", ticket_tab_progress);
|
||||||
|
|
||||||
|
functions.Insert("ticket_type_tab", ticket_type_tab);
|
||||||
|
functions.Insert("ticket_type_tab_defined", ticket_type_tab_defined);
|
||||||
|
functions.Insert("ticket_type_tab_isdefault", ticket_type_tab_isdefault);
|
||||||
|
functions.Insert("ticket_type_tab_index", ticket_type_tab_index);
|
||||||
|
functions.Insert("ticket_type_tab_name", ticket_type_tab_name);
|
||||||
|
|
||||||
|
functions.Insert("ticket_status_tab", ticket_status_tab);
|
||||||
|
functions.Insert("ticket_status_tab_defined", ticket_status_tab_defined);
|
||||||
|
functions.Insert("ticket_status_tab_isdefault", ticket_status_tab_isdefault);
|
||||||
|
functions.Insert("ticket_status_tab_index", ticket_status_tab_index);
|
||||||
|
functions.Insert("ticket_status_tab_name", ticket_status_tab_name);
|
||||||
|
|
||||||
|
functions.Insert("ticket_priority_tab", ticket_priority_tab);
|
||||||
|
functions.Insert("ticket_priority_tab_defined", ticket_priority_tab_defined);
|
||||||
|
functions.Insert("ticket_priority_tab_isdefault", ticket_priority_tab_isdefault);
|
||||||
|
functions.Insert("ticket_priority_tab_index", ticket_priority_tab_index);
|
||||||
|
functions.Insert("ticket_priority_tab_name", ticket_priority_tab_name);
|
||||||
|
|
||||||
|
functions.Insert("ticket_category_tab", ticket_category_tab);
|
||||||
|
functions.Insert("ticket_category_tab_defined", ticket_category_tab_defined);
|
||||||
|
functions.Insert("ticket_category_tab_isdefault", ticket_category_tab_isdefault);
|
||||||
|
functions.Insert("ticket_category_tab_index", ticket_category_tab_index);
|
||||||
|
functions.Insert("ticket_category_tab_name", ticket_category_tab_name);
|
||||||
|
|
||||||
|
functions.Insert("ticket_expected_tab", ticket_expected_tab);
|
||||||
|
functions.Insert("ticket_expected_tab_defined", ticket_expected_tab_defined);
|
||||||
|
functions.Insert("ticket_expected_tab_isdefault", ticket_expected_tab_isdefault);
|
||||||
|
functions.Insert("ticket_expected_tab_index", ticket_expected_tab_index);
|
||||||
|
functions.Insert("ticket_expected_tab_name", ticket_expected_tab_name);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
mount
|
mount
|
||||||
*/
|
*/
|
||||||
functions.Insert("mount_param_withheader", mount_param_withheader);
|
functions.Insert("mount_page_is", mount_page_is);
|
||||||
functions.Insert("mount_param_withinfo", mount_param_withinfo);
|
functions.Insert("mount_thread_is", mount_thread_is);
|
||||||
functions.Insert("mount_param_thread_with_header", mount_param_thread_with_header);
|
functions.Insert("mount_type_is_thread", mount_type_is_thread);
|
||||||
functions.Insert("mount_param_thread_with_info", mount_param_thread_with_info);
|
functions.Insert("mount_type_is_ticket", mount_type_is_ticket);
|
||||||
functions.Insert("mount_is_thread", mount_is_thread);
|
functions.Insert("mount_type_is_cms", mount_type_is_cms);
|
||||||
functions.Insert("mount_is_cms", mount_is_cms);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -485,6 +551,12 @@ void Templates::ReadTemplates()
|
||||||
|
|
||||||
pat_fun_upload.Directory(data.templates);
|
pat_fun_upload.Directory(data.templates);
|
||||||
pat_fun_upload.ParseFile("fun_upload.html");
|
pat_fun_upload.ParseFile("fun_upload.html");
|
||||||
|
|
||||||
|
pat_fun_ticket.Directory(data.templates);
|
||||||
|
pat_fun_ticket.ParseFile("fun_ticket.html");
|
||||||
|
|
||||||
|
pat_fun_createticket.Directory(data.templates);
|
||||||
|
pat_fun_createticket.ParseFile("fun_createticket.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace TemplatesFunctions
|
||||||
/*
|
/*
|
||||||
item
|
item
|
||||||
*/
|
*/
|
||||||
void item_is(Info & i);
|
void item_is(Info & i); // !! change to is_item lub na item_defined
|
||||||
void item_id(Info & i);
|
void item_id(Info & i);
|
||||||
void item_subject(Info & i);
|
void item_subject(Info & i);
|
||||||
void item_subject_noescape(Info & i);
|
void item_subject_noescape(Info & i);
|
||||||
|
@ -164,6 +164,7 @@ namespace TemplatesFunctions
|
||||||
|
|
||||||
void priv_privileges(Info & i);
|
void priv_privileges(Info & i);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
done
|
done
|
||||||
*/
|
*/
|
||||||
|
@ -209,7 +210,7 @@ namespace TemplatesFunctions
|
||||||
/*
|
/*
|
||||||
thread
|
thread
|
||||||
*/
|
*/
|
||||||
void thread_is(Info & i);
|
void thread_is(Info & i); // !! change to is_thread lub na thread_defined
|
||||||
void thread_tab(Info & i);
|
void thread_tab(Info & i);
|
||||||
void thread_tab_url(Info & i);
|
void thread_tab_url(Info & i);
|
||||||
void thread_tab_subject(Info & i);
|
void thread_tab_subject(Info & i);
|
||||||
|
@ -219,16 +220,70 @@ namespace TemplatesFunctions
|
||||||
void thread_tab_last_item_user(Info & i);
|
void thread_tab_last_item_user(Info & i);
|
||||||
void thread_can_create(Info & i);
|
void thread_can_create(Info & i);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
ticket
|
||||||
|
*/
|
||||||
|
void ticket_is(Info & i); // !! change to is_ticket lub na ticket_defined
|
||||||
|
void ticket_can_create(Info & i);
|
||||||
|
void ticket_type(Info & i);
|
||||||
|
void ticket_status(Info & i);
|
||||||
|
void ticket_priority(Info & i);
|
||||||
|
void ticket_category(Info & i);
|
||||||
|
void ticket_expected(Info & i);
|
||||||
|
void ticket_progress(Info & i);
|
||||||
|
|
||||||
|
void ticket_tab(Info & i);
|
||||||
|
void ticket_tab_url(Info & i);
|
||||||
|
void ticket_tab_subject(Info & i);
|
||||||
|
void ticket_tab_subject_empty(Info & i);
|
||||||
|
void ticket_tab_author(Info & i);
|
||||||
|
void ticket_tab_type(Info & i);
|
||||||
|
void ticket_tab_status(Info & i);
|
||||||
|
void ticket_tab_priority(Info & i);
|
||||||
|
void ticket_tab_category(Info & i);
|
||||||
|
void ticket_tab_expected(Info & i);
|
||||||
|
void ticket_tab_progress(Info & i);
|
||||||
|
|
||||||
|
void ticket_type_tab(Info & i);
|
||||||
|
void ticket_type_tab_defined(Info & i);
|
||||||
|
void ticket_type_tab_isdefault(Info & i);
|
||||||
|
void ticket_type_tab_index(Info & i);
|
||||||
|
void ticket_type_tab_name(Info & i);
|
||||||
|
|
||||||
|
void ticket_status_tab(Info & i);
|
||||||
|
void ticket_status_tab_defined(Info & i);
|
||||||
|
void ticket_status_tab_isdefault(Info & i);
|
||||||
|
void ticket_status_tab_index(Info & i);
|
||||||
|
void ticket_status_tab_name(Info & i);
|
||||||
|
|
||||||
|
void ticket_priority_tab(Info & i);
|
||||||
|
void ticket_priority_tab_defined(Info & i);
|
||||||
|
void ticket_priority_tab_isdefault(Info & i);
|
||||||
|
void ticket_priority_tab_index(Info & i);
|
||||||
|
void ticket_priority_tab_name(Info & i);
|
||||||
|
|
||||||
|
void ticket_category_tab(Info & i);
|
||||||
|
void ticket_category_tab_defined(Info & i);
|
||||||
|
void ticket_category_tab_isdefault(Info & i);
|
||||||
|
void ticket_category_tab_index(Info & i);
|
||||||
|
void ticket_category_tab_name(Info & i);
|
||||||
|
|
||||||
|
void ticket_expected_tab(Info & i);
|
||||||
|
void ticket_expected_tab_defined(Info & i);
|
||||||
|
void ticket_expected_tab_isdefault(Info & i);
|
||||||
|
void ticket_expected_tab_index(Info & i);
|
||||||
|
void ticket_expected_tab_name(Info & i);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
mount
|
mount
|
||||||
*/
|
*/
|
||||||
void mount_param_withheader(Info & i);
|
void mount_page_is(Info & i);
|
||||||
void mount_param_withinfo(Info & i);
|
void mount_thread_is(Info & i);
|
||||||
void mount_param_thread_with_header(Info & i);
|
void mount_type_is_thread(Info & i);
|
||||||
void mount_param_thread_with_info(Info & i);
|
void mount_type_is_ticket(Info & i);
|
||||||
void mount_is_thread(Info & i);
|
void mount_type_is_cms(Info & i);
|
||||||
void mount_is_cms(Info & i);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -0,0 +1,519 @@
|
||||||
|
/*
|
||||||
|
* This file is a part of CMSLU -- Content Management System like Unix
|
||||||
|
* and is not publicly distributed
|
||||||
|
*
|
||||||
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "templates.h"
|
||||||
|
#include "../core/data.h"
|
||||||
|
#include "../core/request.h"
|
||||||
|
#include "../core/misc.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace TemplatesFunctions
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_is(Info & i)
|
||||||
|
{
|
||||||
|
i.result = request.is_ticket;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_can_create(Info & i)
|
||||||
|
{
|
||||||
|
i.result = request.CanCreateTicket(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type(Info & i)
|
||||||
|
{
|
||||||
|
if( request.ticket.type < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[request.ticket.type]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status(Info & i)
|
||||||
|
{
|
||||||
|
if( request.ticket.status < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[request.ticket.status]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority(Info & i)
|
||||||
|
{
|
||||||
|
if( request.ticket.priority < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[request.ticket.priority]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category(Info & i)
|
||||||
|
{
|
||||||
|
if( request.ticket.category < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[request.ticket.category]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected(Info & i)
|
||||||
|
{
|
||||||
|
if( request.ticket.expected < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[request.ticket.expected]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_progress(Info & i)
|
||||||
|
{
|
||||||
|
i.out << request.ticket.progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static size_t ticket_tab_index;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_tab_index = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_tab_index < request.ticket_tab.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_url(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index < request.ticket_tab.size() )
|
||||||
|
{
|
||||||
|
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||||
|
|
||||||
|
if( dir )
|
||||||
|
{
|
||||||
|
HtmlEscape(i.out, dir->url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i.out << "<!-- unknown directory -->";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_subject(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index < request.ticket_tab.size() )
|
||||||
|
{
|
||||||
|
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||||
|
|
||||||
|
if( dir )
|
||||||
|
{
|
||||||
|
if( !dir->subject.empty() )
|
||||||
|
HtmlEscape(i.out, dir->subject);
|
||||||
|
else
|
||||||
|
HtmlEscape(i.out, dir->url);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i.out << "<!-- unknown subject -->";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_subject_empty(Info & i)
|
||||||
|
{
|
||||||
|
i.result = true;
|
||||||
|
|
||||||
|
if( ticket_tab_index < request.ticket_tab.size() )
|
||||||
|
{
|
||||||
|
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||||
|
|
||||||
|
if( dir )
|
||||||
|
i.result = dir->subject.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_author(Info & i)
|
||||||
|
{
|
||||||
|
bool unknown = true;
|
||||||
|
|
||||||
|
|
||||||
|
if( ticket_tab_index < request.ticket_tab.size() )
|
||||||
|
{
|
||||||
|
Item * dir = data.dirs.GetDir( request.ticket_tab[ticket_tab_index].dir_id );
|
||||||
|
|
||||||
|
if( dir )
|
||||||
|
{
|
||||||
|
User * puser = data.users.GetUser(dir->user_id);
|
||||||
|
unknown = false;
|
||||||
|
|
||||||
|
if( puser )
|
||||||
|
HtmlEscape(i.out, puser->name);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i.out << "~";
|
||||||
|
|
||||||
|
if( !dir->guest_name.empty() )
|
||||||
|
HtmlEscape(i.out, dir->guest_name);
|
||||||
|
else
|
||||||
|
i.out << "guest"; // !! dodac do konfiga
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if( unknown )
|
||||||
|
{
|
||||||
|
i.out << "<!-- unknown user -->";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_type(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||||
|
|
||||||
|
if( t.type < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[t.type]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_status(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||||
|
|
||||||
|
if( t.status < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[t.status]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_priority(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||||
|
|
||||||
|
if( t.priority < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[t.priority]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_category(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||||
|
|
||||||
|
if( t.category < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[t.category]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_expected(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
Ticket & t = request.ticket_tab[ticket_tab_index];
|
||||||
|
|
||||||
|
if( t.expected < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[t.expected]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_tab_progress(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_tab_index >= request.ticket_tab.size() )
|
||||||
|
return;
|
||||||
|
|
||||||
|
i.out << request.ticket_tab[ticket_tab_index].progress;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static size_t ticket_type_tab_ind;
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_type_tab_ind = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type_tab_defined(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->param[Mount::par_ticket_type].defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type_tab_isdefault(Info & i)
|
||||||
|
{
|
||||||
|
if( request.is_ticket )
|
||||||
|
{
|
||||||
|
i.result = (ticket_type_tab_ind == request.ticket.type);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_type_default];
|
||||||
|
|
||||||
|
if( !p.defined || p.arg.empty() )
|
||||||
|
return; // default false
|
||||||
|
|
||||||
|
size_t value = atoi( p.arg[0].c_str() );
|
||||||
|
i.result = (ticket_type_tab_ind == value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type_tab_index(Info & i)
|
||||||
|
{
|
||||||
|
i.out << ticket_type_tab_ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_type_tab_name(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_type_tab_ind < data.mounts.pmount->param[Mount::par_ticket_type].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_type].arg[ticket_type_tab_ind]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static size_t ticket_status_tab_ind;
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_status_tab_ind = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status_tab_defined(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->param[Mount::par_ticket_status].defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status_tab_isdefault(Info & i)
|
||||||
|
{
|
||||||
|
if( request.is_ticket )
|
||||||
|
{
|
||||||
|
i.result = (ticket_status_tab_ind == request.ticket.status);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_status_default];
|
||||||
|
|
||||||
|
if( !p.defined || p.arg.empty() )
|
||||||
|
return; // default false
|
||||||
|
|
||||||
|
size_t value = atoi( p.arg[0].c_str() );
|
||||||
|
i.result = (ticket_status_tab_ind == value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status_tab_index(Info & i)
|
||||||
|
{
|
||||||
|
i.out << ticket_status_tab_ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_status_tab_name(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_status_tab_ind < data.mounts.pmount->param[Mount::par_ticket_status].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_status].arg[ticket_status_tab_ind]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static size_t ticket_priority_tab_ind;
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_priority_tab_ind = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority_tab_defined(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->param[Mount::par_ticket_priority].defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority_tab_isdefault(Info & i)
|
||||||
|
{
|
||||||
|
if( request.is_ticket )
|
||||||
|
{
|
||||||
|
i.result = (ticket_priority_tab_ind == request.ticket.priority);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_priority_default];
|
||||||
|
|
||||||
|
if( !p.defined || p.arg.empty() )
|
||||||
|
return; // default false
|
||||||
|
|
||||||
|
size_t value = atoi( p.arg[0].c_str() );
|
||||||
|
i.result = (ticket_priority_tab_ind == value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority_tab_index(Info & i)
|
||||||
|
{
|
||||||
|
i.out << ticket_priority_tab_ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_priority_tab_name(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_priority_tab_ind < data.mounts.pmount->param[Mount::par_ticket_priority].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_priority].arg[ticket_priority_tab_ind]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static size_t ticket_category_tab_ind;
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_category_tab_ind = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category_tab_defined(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->param[Mount::par_ticket_category].defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category_tab_isdefault(Info & i)
|
||||||
|
{
|
||||||
|
if( request.is_ticket )
|
||||||
|
{
|
||||||
|
i.result = (ticket_category_tab_ind == request.ticket.category);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_category_default];
|
||||||
|
|
||||||
|
if( !p.defined || p.arg.empty() )
|
||||||
|
return; // default false
|
||||||
|
|
||||||
|
size_t value = atoi( p.arg[0].c_str() );
|
||||||
|
i.result = (ticket_category_tab_ind == value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category_tab_index(Info & i)
|
||||||
|
{
|
||||||
|
i.out << ticket_category_tab_ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_category_tab_name(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_category_tab_ind < data.mounts.pmount->param[Mount::par_ticket_category].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_category].arg[ticket_category_tab_ind]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
static size_t ticket_expected_tab_ind;
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected_tab(Info & i)
|
||||||
|
{
|
||||||
|
ticket_expected_tab_ind = i.iter;
|
||||||
|
|
||||||
|
i.result = ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected_tab_defined(Info & i)
|
||||||
|
{
|
||||||
|
i.result = data.mounts.pmount->param[Mount::par_ticket_expected].defined;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected_tab_isdefault(Info & i)
|
||||||
|
{
|
||||||
|
if( request.is_ticket )
|
||||||
|
{
|
||||||
|
i.result = (ticket_expected_tab_ind == request.ticket.expected);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mount::ParamRow & p = data.mounts.pmount->param[Mount::par_ticket_expected_default];
|
||||||
|
|
||||||
|
if( !p.defined || p.arg.empty() )
|
||||||
|
return; // default false
|
||||||
|
|
||||||
|
size_t value = atoi( p.arg[0].c_str() );
|
||||||
|
i.result = (ticket_expected_tab_ind == value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected_tab_index(Info & i)
|
||||||
|
{
|
||||||
|
i.out << ticket_expected_tab_ind;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ticket_expected_tab_name(Info & i)
|
||||||
|
{
|
||||||
|
if( ticket_expected_tab_ind < data.mounts.pmount->param[Mount::par_ticket_expected].arg.size() )
|
||||||
|
HtmlEscape(i.out, data.mounts.pmount->param[Mount::par_ticket_expected].arg[ticket_expected_tab_ind]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace TemplatesFunctions
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -50,13 +50,13 @@ void notify_to(Info & i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void notify_mount_is_thread(Info & i)
|
void notify_mount_type_is_thread(Info & i)
|
||||||
{
|
{
|
||||||
i.result = notify_msg->current_mount_type == Mount::thread;
|
i.result = notify_msg->current_mount_type == Mount::thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void notify_mount_is_cms(Info & i)
|
void notify_mount_type_is_cms(Info & i)
|
||||||
{
|
{
|
||||||
i.result = notify_msg->current_mount_type == Mount::cms;
|
i.result = notify_msg->current_mount_type == Mount::cms;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,8 @@ using namespace TemplatesNotifyFunctions;
|
||||||
functions.Insert("notify_item_deleted", notify_item_deleted);
|
functions.Insert("notify_item_deleted", notify_item_deleted);
|
||||||
functions.Insert("notify_dir_added", notify_dir_added);
|
functions.Insert("notify_dir_added", notify_dir_added);
|
||||||
functions.Insert("notify_to", notify_to);
|
functions.Insert("notify_to", notify_to);
|
||||||
functions.Insert("notify_mount_is_thread", notify_mount_is_thread);
|
functions.Insert("notify_mount_type_is_thread", notify_mount_type_is_thread);
|
||||||
functions.Insert("notify_mount_is_cms", notify_mount_is_cms);
|
functions.Insert("notify_mount_type_is_cms", notify_mount_type_is_cms);
|
||||||
functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
functions.Insert("notify_doc_base_url", notify_doc_base_url);
|
||||||
functions.Insert("notify_item_dir", notify_item_dir);
|
functions.Insert("notify_item_dir", notify_item_dir);
|
||||||
functions.Insert("notify_item_link", notify_item_link);
|
functions.Insert("notify_item_link", notify_item_link);
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace TemplatesNotifyFunctions
|
||||||
void notify_item_deleted(Info & i);
|
void notify_item_deleted(Info & i);
|
||||||
void notify_dir_added(Info & i);
|
void notify_dir_added(Info & i);
|
||||||
void notify_to(Info & i);
|
void notify_to(Info & i);
|
||||||
void notify_mount_is_thread(Info & i);
|
void notify_mount_type_is_thread(Info & i);
|
||||||
void notify_mount_is_cms(Info & i);
|
void notify_mount_type_is_cms(Info & i);
|
||||||
void notify_doc_base_url(Info & i);
|
void notify_doc_base_url(Info & i);
|
||||||
void notify_item_dir(Info & i);
|
void notify_item_dir(Info & i);
|
||||||
void notify_item_link(Info & i);
|
void notify_item_link(Info & i);
|
||||||
|
|
Loading…
Reference in New Issue