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:
@@ -1,177 +1,250 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
cat.o: content.h ../core/item.h ../templates/templates.h
|
||||
cat.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
cat.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
cat.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
cat.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
cat.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
cat.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
||||
cat.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
cat.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
cat.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
cat.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
cat.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
content.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
content.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
content.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
content.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
content.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
content.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
content.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
content.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
content.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
content.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
content.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
content.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
content.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
content.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
content.o: ../core/mount.h ../core/misc.h ../core/plugin.h ../core/request.h
|
||||
content.o: ../core/data.h ../core/pluginmsg.h
|
||||
content.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
content.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
content.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
|
||||
content.o: ../core/users.h ../core/groups.h ../core/functions.h
|
||||
content.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.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: ../templates/patterncacher.h ../core/thread.h
|
||||
createthread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
|
||||
createthread.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
|
||||
createthread.o: ../core/user.h ../core/rebus.h ../core/function.h
|
||||
createthread.o: ../core/thread.h ../core/compress.h
|
||||
createthread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
createthread.o: ../core/htmlfilter.h ../core/postmultiparser.h
|
||||
createthread.o: ../core/error.h ../core/db.h ../core/group.h
|
||||
createthread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/mount.h
|
||||
createthread.o: ../core/data.h ../core/dirs.h ../core/users.h
|
||||
createthread.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
createthread.o: ../core/mounts.h ../core/mount.h
|
||||
createthread.o: ../core/ticket.h ../core/done.h ../core/request.h
|
||||
createthread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
createthread.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
createthread.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
createthread.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
createthread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
createthread.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
createthread.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
createthread.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
|
||||
createthread.o: ../core/dirs.h ../core/users.h ../core/groups.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
default.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
default.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
default.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
default.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
default.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
default.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
default.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
default.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
default.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
default.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
default.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
default.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
default.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
default.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
default.o: ../core/mount.h
|
||||
default.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
default.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
default.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
|
||||
default.o: ../core/users.h ../core/groups.h ../core/functions.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
emacs.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
emacs.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
emacs.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
emacs.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
emacs.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
emacs.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
emacs.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
emacs.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
emacs.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
emacs.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
emacs.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
emacs.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
emacs.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
emacs.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
emacs.o: ../core/mount.h ../core/notify.h
|
||||
emacs.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
emacs.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
emacs.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||
emacs.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
emacs.o: ../core/mounts.h ../core/mount.h ../core/notify.h
|
||||
emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h ../core/misc.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
login.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
login.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
login.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
login.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
login.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
login.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
login.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
login.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
login.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
login.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
login.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
login.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
login.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
login.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
login.o: ../core/mount.h
|
||||
login.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
login.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
login.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||
login.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
login.o: ../core/mounts.h ../core/mount.h
|
||||
logout.o: content.h ../core/item.h ../templates/templates.h
|
||||
logout.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
logout.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
logout.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
logout.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
logout.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
logout.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
logout.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
logout.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
logout.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
logout.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
logout.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
logout.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
||||
logout.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
||||
logout.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
logout.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
logout.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||
logout.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
logout.o: ../core/ugcontainer.h ../core/groups.h ../core/group.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
ls.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
ls.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
ls.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
ls.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
ls.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/db.h
|
||||
ls.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
ls.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
ls.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
ls.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
ls.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
ls.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
ls.o: ../core/acceptbaseparser.h ../core/htmlfilter.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
mkdir.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
mkdir.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
mkdir.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
mkdir.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
mkdir.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
mkdir.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
mkdir.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
mkdir.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
mkdir.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
mkdir.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
mkdir.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
mkdir.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
mkdir.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
mkdir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
mkdir.o: ../core/mount.h ../core/notify.h
|
||||
mkdir.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
mkdir.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
mkdir.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||
mkdir.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
mkdir.o: ../core/mounts.h ../core/mount.h ../core/notify.h
|
||||
mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
|
||||
node.o: content.h ../core/item.h ../templates/templates.h
|
||||
node.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
node.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
node.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
node.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
node.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
node.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
node.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
node.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
node.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
node.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
priv.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
priv.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
priv.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
priv.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
priv.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
priv.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
priv.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
priv.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
priv.o: ../core/postmultiparser.h ../core/error.h ../core/db.h
|
||||
priv.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
priv.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
priv.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
|
||||
priv.o: ../core/mount.h
|
||||
priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
|
||||
priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||
priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
priv.o: ../core/mounts.h ../core/mount.h
|
||||
reload.o: content.h ../core/item.h ../templates/templates.h
|
||||
reload.o: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
reload.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
reload.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
reload.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
reload.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
reload.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
reload.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
reload.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
reload.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
reload.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
rm.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
rm.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
rm.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
rm.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
rm.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
||||
rm.o: ../core/db.h ../core/group.h ../core/dircontainer.h
|
||||
rm.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
|
||||
rm.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
|
||||
rm.o: ../core/mounts.h ../core/mount.h
|
||||
rm.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
rm.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
rm.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
rm.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
rm.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
rm.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
rm.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h ../core/db.h
|
||||
rm.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
rm.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
run.o: ../core/requesttypes.h ../core/session.h ../core/done.h ../core/item.h
|
||||
run.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h
|
||||
run.o: ../core/function.h ../core/thread.h ../core/compress.h
|
||||
run.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
run.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/error.h
|
||||
run.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
run.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
run.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
run.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
run.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
thread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
thread.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
thread.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
thread.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
thread.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
thread.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
thread.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
thread.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
thread.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
thread.o: ../core/postmultiparser.h ../core/db.h ../core/group.h
|
||||
thread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
|
||||
thread.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
|
||||
thread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
thread.o: ../core/mount.h
|
||||
thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
|
||||
thread.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
thread.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
|
||||
thread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.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: ../templates/patterncacher.h ../core/thread.h ../core/request.h
|
||||
upload.o: ../core/requesttypes.h ../core/session.h ../core/done.h
|
||||
upload.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
|
||||
upload.o: ../core/rebus.h ../core/function.h ../core/thread.h
|
||||
upload.o: ../core/compress.h ../core/acceptencodingparser.h
|
||||
upload.o: ../templates/patterncacher.h ../core/thread.h ../core/ticket.h
|
||||
upload.o: ../core/done.h ../core/request.h ../core/requesttypes.h
|
||||
upload.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
|
||||
upload.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/function.h
|
||||
upload.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
|
||||
upload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
|
||||
upload.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
|
||||
upload.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
|
||||
upload.o: ../core/groups.h ../core/group.h ../core/functions.h
|
||||
upload.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
|
||||
upload.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
|
||||
upload.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
|
||||
upload.o: ../core/ugcontainer.h ../core/groups.h ../core/group.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: ../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);
|
||||
|
||||
@@ -80,6 +80,14 @@ void Content::SetDefaultFunctionForDir()
|
||||
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
|
||||
}
|
||||
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
|
||||
request.pfunction = data.functions.GetFunction(FUN_LS);
|
||||
@@ -184,6 +192,15 @@ void Content::MakeStandardFunction()
|
||||
else
|
||||
if( request.pfunction->code == FUN_UPLOAD )
|
||||
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
|
||||
request.status = Error::permission_denied;
|
||||
|
||||
@@ -245,6 +262,14 @@ void Content::MakePost()
|
||||
PostFunUpload();
|
||||
break;
|
||||
|
||||
case FUN_CREATETICKET:
|
||||
PostFunCreateTicket();
|
||||
break;
|
||||
|
||||
case FUN_EDITTICKET:
|
||||
PostFunEditTicket();
|
||||
break;
|
||||
|
||||
default:
|
||||
log << log1 << "Content: unknown post function" << logend;
|
||||
break;
|
||||
@@ -388,16 +413,37 @@ Item * pdir;
|
||||
}
|
||||
|
||||
|
||||
void Content::RedirectToLastDir()
|
||||
{
|
||||
RedirectTo( *request.dir_table.back() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Content::ReadAdditionalInfo()
|
||||
{
|
||||
if( request.dir_table.empty() )
|
||||
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 )
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@
|
||||
#include "../core/item.h"
|
||||
#include "../templates/templates.h"
|
||||
#include "../core/thread.h"
|
||||
|
||||
#include "../core/ticket.h"
|
||||
#include "../core/done.h"
|
||||
|
||||
|
||||
class Content
|
||||
@@ -67,16 +68,29 @@ class Content
|
||||
static bool FunThreadSort(const Thread & t1, const Thread & t2);
|
||||
void FunThread();
|
||||
void FunCreateThread();
|
||||
|
||||
bool FunUploadCheckAccess();
|
||||
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 SetContentType();
|
||||
|
||||
void ReadItemContentWithType(Item & item);
|
||||
bool FunEmacsCheckAccess();
|
||||
void PostFunEmacsAdd();
|
||||
void PostFunEmacsEdit(bool with_url);
|
||||
bool PostEmacsCheckAbuse(bool adding);
|
||||
void PostFunEmacsModifyMountPoint(bool adding);
|
||||
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();
|
||||
void PostFunDefault();
|
||||
void PostFunPriv();
|
||||
@@ -84,11 +98,42 @@ class Content
|
||||
|
||||
bool FunCreateThreadCheckAccess();
|
||||
bool FunCreateThreadCheckAbuse();
|
||||
void ReadThread(Thread & thread);
|
||||
void AddThread();
|
||||
void PostFunCreateThreadLogAndRedirect();
|
||||
void PostFunCreateThread();
|
||||
|
||||
void UploadSaveFile();
|
||||
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(long item_id);
|
||||
void RedirectToLastDir();
|
||||
|
||||
void CheckGetPostTimes(time_t difference = 10);
|
||||
// bool CreateFile(const std::string & path, const std::string & content);
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#include "../core/data.h"
|
||||
|
||||
|
||||
|
||||
|
||||
bool Content::FunCreateThreadCheckAccess()
|
||||
{
|
||||
if( !request.CanCreateThread() )
|
||||
@@ -28,6 +30,7 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Content::FunCreateThreadCheckAbuse()
|
||||
{
|
||||
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()
|
||||
{
|
||||
if( !FunCreateThreadCheckAccess() )
|
||||
return;
|
||||
|
||||
ReadItem(request.item, Item::dir);
|
||||
ReadThread(request.thread);
|
||||
request.item.privileges = 0777; // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
||||
|
||||
if( !FunCreateThreadCheckAbuse() )
|
||||
{
|
||||
request.PostVar("url", request.item.url);
|
||||
request.PostVar("subject", request.item.subject);
|
||||
request.PostVar("content", request.item.content);
|
||||
SetContentType();
|
||||
SetUser(request.item);
|
||||
ReadItemContentWithType(request.item); // for correctly displaying the form
|
||||
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
|
||||
|
||||
request.thread.parent_id = request.dir_table.back()->id;
|
||||
PostFunMkdir(true, 0777); // !! tymczasowo 777 aby wszyscy mogli wysylac posty
|
||||
Mkdir(request.item, true);
|
||||
|
||||
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 )
|
||||
{
|
||||
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());
|
||||
}
|
||||
AddThread();
|
||||
}
|
||||
|
||||
PostFunCreateThreadLogAndRedirect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
229
content/createticket.cpp
Executable file
229
content/createticket.cpp
Executable file
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
148
content/editticket.cpp
Executable file
148
content/editticket.cpp
Executable file
@@ -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 @@
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::CheckSpecialFile()
|
||||
bool Content::FunEmacsCheckAccess()
|
||||
{
|
||||
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 )
|
||||
if( !request.is_item )
|
||||
{
|
||||
log << log3 << "Content: reloading mount points" << logend;
|
||||
data.mounts.ReadMounts(request.item.content);
|
||||
// adding a new item
|
||||
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()
|
||||
{
|
||||
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 = Done::added_item;
|
||||
request.session->done_status = db.AddItem(request.item);
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
@@ -70,14 +55,8 @@ void Content::PostFunEmacsAdd()
|
||||
|
||||
void Content::PostFunEmacsEdit(bool with_url)
|
||||
{
|
||||
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.item.SetDateModifyToNow();
|
||||
request.session->done = Done::edited_item;
|
||||
request.session->done_status = db.EditItemById(request.item, with_url);
|
||||
|
||||
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::PostFunSetUrlSubject()
|
||||
bool Content::PostEmacsCheckAbuse(bool adding)
|
||||
{
|
||||
bool with_url = false;
|
||||
|
||||
std::string * new_url = request.PostVar("url");
|
||||
std::string * new_subject = request.PostVar("subject");
|
||||
|
||||
if( request.is_item )
|
||||
if( !CheckRebus() )
|
||||
{
|
||||
// editing an item
|
||||
if( new_url && *new_url != request.item.url )
|
||||
with_url = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// adding a new item
|
||||
with_url = true;
|
||||
request.status = Error::incorrect_rebus;
|
||||
request.session->done = (adding)? Done::added_item : Done::edited_item;
|
||||
request.session->done_status = Error::incorrect_rebus;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if( new_url )
|
||||
request.item.url = *new_url;
|
||||
// !! is tested in createthread once
|
||||
CheckGetPostTimes();
|
||||
|
||||
if( new_subject )
|
||||
request.item.subject = *new_subject;
|
||||
|
||||
|
||||
if( request.item.subject.empty() )
|
||||
if( request.session->spam_score > 0 )
|
||||
{
|
||||
request.item.subject = request.dir_table.back()->subject;
|
||||
request.item.subject += "_msg_";
|
||||
request.item.subject += ToStr(db.Size(request.dir_table.back()->id, Item::file));
|
||||
request.status = Error::spam;
|
||||
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 false;
|
||||
}
|
||||
|
||||
// if request.item.url is empty then it will be set from request.item.subject
|
||||
PrepareUrl(request.item);
|
||||
|
||||
return with_url;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Content::SetContentType()
|
||||
|
||||
void Content::PostFunEmacsModifyMountPoint(bool adding)
|
||||
{
|
||||
request.item.content_type = Item::ct_formatted_text; // formatted text default
|
||||
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( data.mounts.pmount->type == Mount::thread )
|
||||
{
|
||||
if( request.CanUseHtml(user_id) )
|
||||
request.item.content_type = Item::ct_html;
|
||||
if( adding )
|
||||
db.EditThreadAddItem(request.dir_table.back()->id, request.item.id);
|
||||
|
||||
RedirectToLastDir();
|
||||
}
|
||||
else
|
||||
if( temp == "bbcode" )
|
||||
if( data.mounts.pmount->type == Mount::ticket )
|
||||
{
|
||||
if( request.CanUseBBCode(user_id) )
|
||||
request.item.content_type = Item::ct_bbcode;
|
||||
RedirectToLastDir();
|
||||
}
|
||||
else
|
||||
if( temp == "raw" )
|
||||
{
|
||||
if( request.CanUseRaw(user_id) )
|
||||
request.item.content_type = Item::ct_raw;
|
||||
// Mount::cms
|
||||
RedirectTo(request.item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,103 +123,47 @@ void Content::SetContentType()
|
||||
|
||||
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.PostVar("content", request.item.content);
|
||||
SetContentType();
|
||||
|
||||
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();
|
||||
request.is_item = true;
|
||||
request.item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
PostFunEmacsAdd();
|
||||
}
|
||||
catch(const Error & e)
|
||||
else
|
||||
{
|
||||
request.session->done_status = e;
|
||||
PostFunEmacsEdit(edit_with_url);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
{
|
||||
request.session->item = request.item;
|
||||
|
||||
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);
|
||||
}
|
||||
PostFunEmacsModifyMountPoint(adding);
|
||||
CheckSpecialFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
log << log1 << "Content: PostFunEmacs: Error: " << request.session->done_status << logend;
|
||||
log << log1 << "Content: PostFunEmacs: Error: "
|
||||
<< request.session->done_status << logend;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::FunEmacs()
|
||||
{
|
||||
if( !request.is_item )
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
FunEmacsCheckAccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
143
content/misc_item.cpp
Executable file
143
content/misc_item.cpp
Executable file
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
37
content/misc_specialfile.cpp
Executable file
37
content/misc_specialfile.cpp
Executable file
@@ -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;
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
Item item;
|
||||
request.session->done = Done::added_dir;
|
||||
|
||||
// try
|
||||
// {
|
||||
item.type = Item::dir;
|
||||
request.PostVar("subject", item.subject);
|
||||
request.PostVar("url", item.url);
|
||||
item.parent_id = request.dir_table.back()->id;
|
||||
|
||||
SetUser(item);
|
||||
|
||||
item.group_id = -1;
|
||||
item.privileges = mask;
|
||||
item.default_item = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Content::Mkdir(Item & item, bool add_to_dir_table)
|
||||
{
|
||||
request.session->done_status = db.AddItem(item);
|
||||
|
||||
// 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 )
|
||||
{
|
||||
Item * pdir = data.dirs.AddDir(item);
|
||||
|
||||
if( add_to_dir_table )
|
||||
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;
|
||||
|
||||
RedirectTo(item);
|
||||
RedirectTo(request.item);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -78,13 +72,7 @@ void Content::PostFunMkdir(bool add_to_dir_table, int mask)
|
||||
|
||||
void Content::FunMkdir()
|
||||
{
|
||||
// !! what about an item? (is_item)
|
||||
if( !request.CanUseMkdir(*request.dir_table.back()) )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
FunMkdirCheckAccess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void Content::FunRm()
|
||||
log << log2 << "Content: deleted item: subject: " << request.item.subject << ", id: " << request.item.id << logend;
|
||||
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);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -33,14 +33,22 @@ bool Content::FunThreadSort(const Thread & t1, const Thread & t2)
|
||||
|
||||
void Content::FunThread()
|
||||
{
|
||||
if( request.is_item )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
bool asc = true;
|
||||
|
||||
if( data.mounts.CurrentMountIsParam(Mount::desc) )
|
||||
if( data.mounts.pmount->IsArg(Mount::par_thread, "sort_desc") )
|
||||
asc = false;
|
||||
|
||||
|
||||
|
||||
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);
|
||||
|
||||
CheckAccessToItems();
|
||||
std::sort(request.thread_tab.begin(), request.thread_tab.end(), FunThreadSort);
|
||||
}
|
||||
|
||||
|
||||
62
content/ticket.cpp
Executable file
62
content/ticket.cpp
Executable file
@@ -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 "../core/request.h"
|
||||
#include "../core/data.h"
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
void Content::FunUpload()
|
||||
|
||||
|
||||
bool Content::FunUploadCheckAccess()
|
||||
{
|
||||
if( request.is_item || !request.CanUseUpload(*request.dir_table.back()) )
|
||||
{
|
||||
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;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Content::PostFunUpload()
|
||||
{
|
||||
if( request.is_item || !request.CanUseUpload(*request.dir_table.back()) )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
if( !FunUploadCheckAccess() )
|
||||
return;
|
||||
}
|
||||
|
||||
if( data.mounts.CurrentMountType() != Mount::cms )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
return;
|
||||
}
|
||||
|
||||
if( request.post_file_table.empty() )
|
||||
{
|
||||
request.status = Error::permission_denied;
|
||||
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
|
||||
request.item.static_auth = Item::static_other;
|
||||
|
||||
PostFunEmacs();
|
||||
PostFunEmacsAdd(); // always adding a new item
|
||||
|
||||
|
||||
if( request.session->done_status == Error::ok )
|
||||
{
|
||||
std::string path;
|
||||
UploadSaveFile();
|
||||
|
||||
if( request.MakeDirsOnFS(path) )
|
||||
{
|
||||
path += '/';
|
||||
path += request.item.url;
|
||||
const std::string & tmp_filename = request.post_file_table.begin()->second.tmp_filename;
|
||||
if( request.session->done_status == Error::ok )
|
||||
RedirectTo(request.item);
|
||||
}
|
||||
|
||||
if( rename(tmp_filename.c_str(), path.c_str()) < 0 )
|
||||
{
|
||||
// !! 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Content::FunUpload()
|
||||
{
|
||||
FunUploadCheckAccess();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user