From adf36e71ceab6fb84f0c6f30213b1f98fee54b96 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 11 Feb 2010 20:56:52 +0000 Subject: [PATCH] added: functions: ckeditor, uptime added: for function: login - a html pattern for GET request git-svn-id: svn://ttmath.org/publicrep/winix/trunk@567 e52654a7-88a9-db11-a3e9-0013d4bc506e --- content/Makefile.dep | 323 +++++++++++++++++++--------------- content/content.cpp | 27 ++- content/content.h | 6 + content/emacs.cpp | 4 +- content/login.cpp | 18 +- content/logout.cpp | 3 + content/ls.cpp | 5 + content/mkdir.cpp | 2 +- core/Makefile.dep | 20 ++- core/config.cpp | 2 + core/data.cpp | 1 + core/data.h | 9 + core/function.h | 6 + core/functions.cpp | 26 +++ core/htmlfilter.cpp | 26 +-- core/htmlfilter.h | 10 +- core/misc.cpp | 1 + core/notify.h | 8 +- core/pluginmsg.h | 6 +- core/postmultiparser.cpp | 34 ++-- core/postmultiparser.h | 4 +- core/request.cpp | 2 +- core/requesttypes.h | 2 +- core/sessionparser.cpp | 1 + core/users.h | 1 - html/fun_chmod.html | 0 html/fun_chown.html | 0 html/fun_ckeditor.html | 54 ++++++ html/fun_emacs.html | 4 +- html/fun_login.html | 18 ++ html/fun_ls.html | 50 ++++-- html/fun_mv.html | 0 html/fun_uname.html | 0 html/fun_uptime.html | 14 ++ html/index.html | 116 ++++++------ html/item_options.html | 11 +- locale/en | 25 ++- locale/pl | 26 ++- main/Makefile.dep | 19 +- main/main.cpp | 1 + templates/Makefile.dep | 109 ++++++++---- templates/Makefile.o.dep | 2 +- templates/ckeditorgetparser.h | 68 +++++++ templates/doc.cpp | 5 + templates/item.cpp | 25 ++- templates/ls.cpp | 47 +++++ templates/templates.cpp | 57 +++++- templates/templates.h | 38 +++- templates/uptime.cpp | 55 ++++++ templates/winix.cpp | 60 +++++++ templatesnotify/notify.cpp | 8 +- 51 files changed, 1006 insertions(+), 353 deletions(-) create mode 100755 html/fun_chmod.html create mode 100755 html/fun_chown.html create mode 100755 html/fun_ckeditor.html create mode 100755 html/fun_login.html create mode 100755 html/fun_mv.html create mode 100755 html/fun_uname.html create mode 100755 html/fun_uptime.html create mode 100755 templates/ckeditorgetparser.h create mode 100755 templates/ls.cpp create mode 100755 templates/uptime.cpp create mode 100755 templates/winix.cpp diff --git a/content/Makefile.dep b/content/Makefile.dep index 8254c6a..72ba6e0 100755 --- a/content/Makefile.dep +++ b/content/Makefile.dep @@ -3,21 +3,25 @@ cat.o: content.h ../core/item.h ../templates/templates.h cat.o: ../templates/patterncacher.h ../templates/misc.h cat.o: ../templates/localefilter.h ../core/locale.h -cat.o: ../confparser/confparser.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 +cat.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +cat.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +cat.o: ../core/ticket.h ../core/done.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/ticket.h +cat.o: ../core/error.h content.o: content.h ../core/item.h ../templates/templates.h content.o: ../templates/patterncacher.h ../templates/misc.h content.o: ../templates/localefilter.h ../core/locale.h -content.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +content.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +content.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h content.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h content.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -29,41 +33,47 @@ content.o: ../core/data.h ../core/pluginmsg.h createthread.o: content.h ../core/item.h ../templates/templates.h createthread.o: ../templates/patterncacher.h ../templates/misc.h createthread.o: ../templates/localefilter.h ../core/locale.h -createthread.o: ../confparser/confparser.h ../core/thread.h ../core/ticket.h -createthread.o: ../core/done.h ../core/request.h ../core/requesttypes.h -createthread.o: ../core/session.h ../core/done.h ../core/item.h -createthread.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h -createthread.o: ../core/function.h ../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/ticket.h ../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 ../core/locale.h +createthread.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +createthread.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.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 ../core/locale.h createticket.o: content.h ../core/item.h ../templates/templates.h createticket.o: ../templates/patterncacher.h ../templates/misc.h createticket.o: ../templates/localefilter.h ../core/locale.h -createticket.o: ../confparser/confparser.h ../core/thread.h ../core/ticket.h -createticket.o: ../core/done.h ../core/request.h ../core/requesttypes.h -createticket.o: ../core/session.h ../core/done.h ../core/item.h -createticket.o: ../core/error.h ../core/log.h ../core/user.h ../core/rebus.h -createticket.o: ../core/function.h ../core/thread.h ../core/compress.h -createticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h -createticket.o: ../core/htmlfilter.h ../core/postmultiparser.h -createticket.o: ../core/ticket.h ../core/error.h ../core/db.h ../core/group.h -createticket.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/mount.h -createticket.o: ../core/data.h ../core/dirs.h ../core/users.h -createticket.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h -createticket.o: ../core/mounts.h ../core/mount.h ../core/locale.h +createticket.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +createticket.o: ../core/httpsimpleparser.h ../core/log.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 ../core/locale.h default.o: content.h ../core/item.h ../templates/templates.h default.o: ../templates/patterncacher.h ../templates/misc.h default.o: ../templates/localefilter.h ../core/locale.h -default.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +default.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +default.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h default.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h default.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -74,26 +84,30 @@ default.o: ../core/locale.h editticket.o: content.h ../core/item.h ../templates/templates.h editticket.o: ../templates/patterncacher.h ../templates/misc.h editticket.o: ../templates/localefilter.h ../core/locale.h -editticket.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +editticket.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +editticket.o: ../core/ticket.h ../core/done.h ../core/request.h +editticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h +editticket.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h +editticket.o: ../core/rebus.h ../core/function.h ../core/thread.h +editticket.o: ../core/compress.h ../core/acceptencodingparser.h +editticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +editticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h +editticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h +editticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h +editticket.o: ../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 ../core/locale.h emacs.o: content.h ../core/item.h ../templates/templates.h emacs.o: ../templates/patterncacher.h ../templates/misc.h emacs.o: ../templates/localefilter.h ../core/locale.h -emacs.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +emacs.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +emacs.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h emacs.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h emacs.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -105,16 +119,19 @@ emacs.o: ../templates/misc.h ../core/misc.h last.o: content.h ../core/item.h ../templates/templates.h last.o: ../templates/patterncacher.h ../templates/misc.h last.o: ../templates/localefilter.h ../core/locale.h -last.o: ../confparser/confparser.h ../core/thread.h ../core/ticket.h -last.o: ../core/done.h +last.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +last.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +last.o: ../core/ticket.h ../core/done.h login.o: content.h ../core/item.h ../templates/templates.h login.o: ../templates/patterncacher.h ../templates/misc.h login.o: ../templates/localefilter.h ../core/locale.h -login.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +login.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +login.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h login.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h login.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -124,11 +141,13 @@ login.o: ../core/mounts.h ../core/mount.h ../core/locale.h logout.o: content.h ../core/item.h ../templates/templates.h logout.o: ../templates/patterncacher.h ../templates/misc.h logout.o: ../templates/localefilter.h ../core/locale.h -logout.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +logout.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +logout.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h logout.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h logout.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h @@ -138,30 +157,35 @@ logout.o: ../core/mount.h ../core/locale.h ls.o: content.h ../core/item.h ../templates/templates.h ls.o: ../templates/patterncacher.h ../templates/misc.h ls.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h -ls.o: ../core/thread.h ../core/ticket.h ../core/done.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/ticket.h -ls.o: ../core/db.h ../core/group.h ../core/dircontainer.h -ls.o: ../core/ugcontainer.h +ls.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h +ls.o: ../core/log.h ../core/thread.h ../core/ticket.h ../core/done.h +ls.o: ../core/request.h ../core/requesttypes.h ../core/session.h +ls.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h +ls.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h +ls.o: ../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 ../templates/misc.h misc_item.o: ../templates/localefilter.h ../core/locale.h -misc_item.o: ../confparser/confparser.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_item.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +misc_item.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +misc_item.o: ../core/ticket.h ../core/done.h ../core/request.h +misc_item.o: ../core/requesttypes.h ../core/session.h ../core/done.h +misc_item.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h +misc_item.o: ../core/rebus.h ../core/function.h ../core/thread.h +misc_item.o: ../core/compress.h ../core/acceptencodingparser.h +misc_item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +misc_item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +misc_item.o: ../core/db.h ../core/group.h ../core/dircontainer.h +misc_item.o: ../core/ugcontainer.h misc_specialfile.o: content.h ../core/item.h ../templates/templates.h misc_specialfile.o: ../templates/patterncacher.h ../templates/misc.h misc_specialfile.o: ../templates/localefilter.h ../core/locale.h -misc_specialfile.o: ../confparser/confparser.h ../core/thread.h +misc_specialfile.o: ../confparser/confparser.h +misc_specialfile.o: ../templates/ckeditorgetparser.h +misc_specialfile.o: ../core/httpsimpleparser.h ../core/log.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 @@ -177,11 +201,13 @@ misc_specialfile.o: ../core/mounts.h ../core/mount.h ../core/locale.h mkdir.o: content.h ../core/item.h ../templates/templates.h mkdir.o: ../templates/patterncacher.h ../templates/misc.h mkdir.o: ../templates/localefilter.h ../core/locale.h -mkdir.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +mkdir.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +mkdir.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h mkdir.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h mkdir.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -193,21 +219,25 @@ mkdir.o: ../templates/misc.h node.o: content.h ../core/item.h ../templates/templates.h node.o: ../templates/patterncacher.h ../templates/misc.h node.o: ../templates/localefilter.h ../core/locale.h -node.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +node.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +node.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h node.o: ../core/postmultiparser.h ../core/ticket.h priv.o: content.h ../core/item.h ../templates/templates.h priv.o: ../templates/patterncacher.h ../templates/misc.h priv.o: ../templates/localefilter.h ../core/locale.h -priv.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +priv.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +priv.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h @@ -217,11 +247,13 @@ priv.o: ../core/mounts.h ../core/mount.h ../core/locale.h reload.o: content.h ../core/item.h ../templates/templates.h reload.o: ../templates/patterncacher.h ../templates/misc.h reload.o: ../templates/localefilter.h ../core/locale.h -reload.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +reload.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +reload.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h reload.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h reload.o: ../core/notify.h ../templatesnotify/templatesnotify.h @@ -229,34 +261,40 @@ reload.o: ../core/mount.h ../templates/misc.h rm.o: content.h ../core/item.h ../templates/templates.h rm.o: ../templates/patterncacher.h ../templates/misc.h rm.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h -rm.o: ../core/thread.h ../core/ticket.h ../core/done.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/ticket.h -rm.o: ../core/error.h ../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 ../core/locale.h +rm.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h +rm.o: ../core/log.h ../core/thread.h ../core/ticket.h ../core/done.h +rm.o: ../core/request.h ../core/requesttypes.h ../core/session.h +rm.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h +rm.o: ../core/user.h ../core/rebus.h ../core/function.h ../core/thread.h +rm.o: ../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 ../core/locale.h run.o: content.h ../core/item.h ../templates/templates.h run.o: ../templates/patterncacher.h ../templates/misc.h run.o: ../templates/localefilter.h ../core/locale.h -run.o: ../confparser/confparser.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 +run.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +run.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +run.o: ../core/ticket.h ../core/done.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/ticket.h +run.o: ../core/error.h thread.o: content.h ../core/item.h ../templates/templates.h thread.o: ../templates/patterncacher.h ../templates/misc.h thread.o: ../templates/localefilter.h ../core/locale.h -thread.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +thread.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +thread.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h thread.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h @@ -266,11 +304,13 @@ thread.o: ../core/mount.h ../core/locale.h ../core/mount.h ticket.o: content.h ../core/item.h ../templates/templates.h ticket.o: ../templates/patterncacher.h ../templates/misc.h ticket.o: ../templates/localefilter.h ../core/locale.h -ticket.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +ticket.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +ticket.o: ../core/ticket.h ../core/done.h ../core/request.h +ticket.o: ../core/requesttypes.h ../core/session.h ../core/done.h +ticket.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h +ticket.o: ../core/rebus.h ../core/function.h ../core/thread.h +ticket.o: ../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 @@ -280,11 +320,13 @@ ticket.o: ../core/mount.h ../core/locale.h ../core/mount.h upload.o: content.h ../core/item.h ../templates/templates.h upload.o: ../templates/patterncacher.h ../templates/misc.h upload.o: ../templates/localefilter.h ../core/locale.h -upload.o: ../confparser/confparser.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: ../confparser/confparser.h ../templates/ckeditorgetparser.h +upload.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +upload.o: ../core/ticket.h ../core/done.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: ../core/acceptbaseparser.h ../core/htmlfilter.h upload.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h upload.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h @@ -294,5 +336,6 @@ upload.o: ../core/mount.h ../core/locale.h who.o: content.h ../core/item.h ../templates/templates.h who.o: ../templates/patterncacher.h ../templates/misc.h who.o: ../templates/localefilter.h ../core/locale.h -who.o: ../confparser/confparser.h ../core/thread.h ../core/ticket.h -who.o: ../core/done.h +who.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +who.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +who.o: ../core/ticket.h ../core/done.h diff --git a/content/content.cpp b/content/content.cpp index b914d6a..21c069a 100755 --- a/content/content.cpp +++ b/content/content.cpp @@ -201,6 +201,27 @@ void Content::MakeStandardFunction() else if( request.pfunction->code == FUN_TICKET ) FunTicket(); + else + if( request.pfunction->code == FUN_CKEDITOR ) + FunEmacs(); + else + if( request.pfunction->code == FUN_LOGIN ) + FunLogin(); + else + if( request.pfunction->code == FUN_UPTIME ) + { /* do nothing */ } +/* else + if( request.pfunction->code == FUN_MV ) + FunMv(); + else + if( request.pfunction->code == FUN_UNAME ) + FunUname(); + else + if( request.pfunction->code == FUN_CHMOD ) + FunChmod(); + else + if( request.pfunction->code == FUN_CHOWN ) + FunChown();*/ else request.status = Error::permission_denied; @@ -270,6 +291,10 @@ void Content::MakePost() PostFunEditTicket(); break; + case FUN_CKEDITOR: + PostFunEmacs(); + break; + default: log << log1 << "Content: unknown post function" << logend; break; @@ -339,7 +364,7 @@ void Content::Make() return; } - plugin.Call(CMSLU_CONTENT_MAKE); + plugin.Call(WINIX_CONTENT_MAKE); MakePage(); //request.PrintGetTable(); diff --git a/content/content.h b/content/content.h index 5452e65..cd84895 100755 --- a/content/content.h +++ b/content/content.h @@ -21,6 +21,8 @@ #include "../core/done.h" + + class Content { Templates templates; @@ -42,6 +44,7 @@ class Content void SetUser(Item & item); bool CheckRebus(); + void MakePost(); void FunCat(); @@ -50,6 +53,8 @@ class Content void FunEmacs(); void FunPriv(); + void FunCKEditor(); + bool FunRmCheckAccess(); void FunRmDirRecursive(); void FunRmDir(); @@ -78,6 +83,7 @@ class Content void CheckAccessToItems(); + void FunLogin(); void PostFunLogin(); diff --git a/content/emacs.cpp b/content/emacs.cpp index 9a34920..0507ab0 100755 --- a/content/emacs.cpp +++ b/content/emacs.cpp @@ -47,7 +47,7 @@ void Content::PostFunEmacsAdd() if( request.session->done_status == Error::ok ) { log << log2 << "Content: added a new item" << logend; - request.notify_code |= CMSLU_NOTIFY_ITEM_ADD; + request.notify_code |= WINIX_NOTIFY_ITEM_ADD; } } @@ -64,7 +64,7 @@ void Content::PostFunEmacsEdit(bool with_url) TemplatesFunctions::pattern_cacher.UpdatePattern(request.item); log << log2 << "Content: modified an item" << logend; - request.notify_code |= CMSLU_NOTIFY_ITEM_EDIT; + request.notify_code |= WINIX_NOTIFY_ITEM_EDIT; } } diff --git a/content/login.cpp b/content/login.cpp index abb9855..22d85af 100755 --- a/content/login.cpp +++ b/content/login.cpp @@ -17,16 +17,6 @@ -/* -void Content::PostFunLoginAddLast() -{ - - - - - -} -*/ void Content::PostFunLogin() @@ -53,11 +43,12 @@ void Content::PostFunLogin() request.session->remember_me = true; data.last.UserLogin(user_id, *login, inet_addr(request.env_remote_addr), request.session->id); - + data.how_many_logged += 1; + log << log2 << "User " << login << " (id: " << user_id << ") logged" << logend; } - // !! zglosic komunikat o nie poprawnym logowaniu + // !! moze zglosic komunikat o nie poprawnym logowaniu } catch(const Error &) { @@ -72,3 +63,6 @@ void Content::PostFunLogin() +void Content::FunLogin() +{ +} diff --git a/content/logout.cpp b/content/logout.cpp index 6ebdff9..2eb7105 100755 --- a/content/logout.cpp +++ b/content/logout.cpp @@ -29,6 +29,9 @@ void Content::FunLogout() log << log2 << "User: " << request.session->puser->name << ", id: " << request.session->puser->id << " logged out" << logend; data.last.UserLogout(request.session->puser->id, request.session->id); + + if( data.how_many_logged > 0 ) // for safety + data.how_many_logged -= 1; request.session->puser = 0; request.session->remember_me = 0; diff --git a/content/ls.cpp b/content/ls.cpp index 70f1465..2141d3d 100755 --- a/content/ls.cpp +++ b/content/ls.cpp @@ -24,6 +24,11 @@ void Content::FunLs() // we're reading only files here db.GetItems(request.item_table, request.dir_table.back()->id, Item::file, false, false, true); + + /* + request.IsParam("ckeditor_browse"); + */ + } diff --git a/content/mkdir.cpp b/content/mkdir.cpp index b7c8007..a28048a 100755 --- a/content/mkdir.cpp +++ b/content/mkdir.cpp @@ -58,7 +58,7 @@ void Content::PostFunMkdir(bool add_to_dir_table, int privileges) if( request.session->done_status == Error::ok ) { - request.notify_code |= CMSLU_NOTIFY_DIR_ADD; + request.notify_code |= WINIX_NOTIFY_DIR_ADD; RedirectTo(request.item); } else diff --git a/core/Makefile.dep b/core/Makefile.dep index 193331a..b5c126d 100755 --- a/core/Makefile.dep +++ b/core/Makefile.dep @@ -84,15 +84,17 @@ request.o: mounts.h mount.h locale.h ../confparser/confparser.h plugin.h request.o: pluginmsg.h misc.h db.h requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h requestcontroller.o: ../templates/templates.h ../templates/patterncacher.h -requestcontroller.o: misc.h item.h ../core/thread.h ../core/ticket.h -requestcontroller.o: ../core/done.h sessionmanager.h sessioncontainer.h -requestcontroller.o: session.h done.h error.h log.h user.h rebus.h -requestcontroller.o: functionparser.h requesttypes.h data.h dirs.h -requestcontroller.o: dircontainer.h users.h ugcontainer.h groups.h group.h -requestcontroller.o: functions.h function.h lastcontainer.h mounts.h mount.h -requestcontroller.o: locale.h ../confparser/confparser.h request.h thread.h -requestcontroller.o: compress.h acceptencodingparser.h acceptbaseparser.h -requestcontroller.o: htmlfilter.h postmultiparser.h ticket.h postparser.h +requestcontroller.o: misc.h item.h ../templates/ckeditorgetparser.h +requestcontroller.o: ../core/httpsimpleparser.h ../core/log.h +requestcontroller.o: ../core/thread.h ../core/ticket.h ../core/done.h +requestcontroller.o: sessionmanager.h sessioncontainer.h session.h done.h +requestcontroller.o: error.h log.h user.h rebus.h functionparser.h +requestcontroller.o: requesttypes.h data.h dirs.h dircontainer.h users.h +requestcontroller.o: ugcontainer.h groups.h group.h functions.h function.h +requestcontroller.o: lastcontainer.h mounts.h mount.h locale.h +requestcontroller.o: ../confparser/confparser.h request.h thread.h compress.h +requestcontroller.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h +requestcontroller.o: postmultiparser.h ticket.h postparser.h requestcontroller.o: httpsimpleparser.h cookieparser.h notify.h requestcontroller.o: ../templatesnotify/templatesnotify.h ../core/mount.h requestcontroller.o: ../core/locale.h ../templates/misc.h diff --git a/core/config.cpp b/core/config.cpp index 96d7bea..7a136aa 100755 --- a/core/config.cpp +++ b/core/config.cpp @@ -121,6 +121,7 @@ void Config::AssignValues() data.base_server = Text("base_server"); data.base_url_prefix = Text("base_url_prefix"); data.base_url_static_prefix = Text("base_url_static_prefix"); + data.base_url_static_ext_prefix = Text("base_url_static_ext_prefix"); data.base_url_static_auth_prefix = Text("base_url_static_auth_prefix"); NoLastSlash(data.base_server); @@ -128,6 +129,7 @@ void Config::AssignValues() data.base_url = data.base_url_prefix + data.base_server; data.base_url_static = data.base_url_static_prefix + data.base_server; + data.base_url_static_ext = data.base_url_static_ext_prefix + data.base_server; data.base_url_static_auth = data.base_url_static_auth_prefix + data.base_server; data.priv_no_user = Text("priv_no_user", "-- no user --"); diff --git a/core/data.cpp b/core/data.cpp index e39cf6f..7e3337e 100755 --- a/core/data.cpp +++ b/core/data.cpp @@ -17,6 +17,7 @@ Data::Data() { signal_hup = false; stdout_is_closed = false; + how_many_logged = 0; // the rest will be read from a config file } diff --git a/core/data.h b/core/data.h index bdecb92..341c7ce 100755 --- a/core/data.h +++ b/core/data.h @@ -72,6 +72,7 @@ public: std::string base_server; std::string base_url_prefix; std::string base_url_static_prefix; + std::string base_url_static_ext_prefix; std::string base_url_static_auth_prefix; std::string http_session_id_name; @@ -133,6 +134,9 @@ public: // base_url_static_prefix + base_server std::string base_url_static; + // additional static server for common content such as ckeditor + std::string base_url_static_ext; + // base_url_static_auth_prefix + base_server std::string base_url_static_auth; @@ -185,6 +189,11 @@ public: // rebus (captcha) Rebus rebus; + // the time when the winix starts + time_t system_start; + + // how many logged users + long how_many_logged; Data(); diff --git a/core/function.h b/core/function.h index fce88a8..7aacc0b 100755 --- a/core/function.h +++ b/core/function.h @@ -35,6 +35,12 @@ #define FUN_CREATETICKET 18 #define FUN_EDITTICKET 19 #define FUN_TICKET 20 +#define FUN_UPTIME 21 +//#define FUN_MV 23 +//#define FUN_UNAME 24 +//#define FUN_CHMOD 25 +//#define FUN_CHOWN 26 +#define FUN_CKEDITOR 27 diff --git a/core/functions.cpp b/core/functions.cpp index eab6635..5009fa4 100755 --- a/core/functions.cpp +++ b/core/functions.cpp @@ -112,6 +112,32 @@ void Functions::ReadFunctions() f.item.url = "ticket"; table.insert( std::make_pair(f.item.url, f) ); + f.code = FUN_UPTIME; + f.item.url = "uptime"; + table.insert( std::make_pair(f.item.url, f) ); + + /* + f.code = FUN_MV; + f.item.url = "mv"; + table.insert( std::make_pair(f.item.url, f) ); + + f.code = FUN_UNAME; + f.item.url = "uname"; + table.insert( std::make_pair(f.item.url, f) ); + + f.code = FUN_CHMOD; + f.item.url = "chmod"; + table.insert( std::make_pair(f.item.url, f) ); + + f.code = FUN_CHOWN; + f.item.url = "chown"; + table.insert( std::make_pair(f.item.url, f) ); + */ + + f.code = FUN_CKEDITOR; + f.item.url = "ckeditor"; + table.insert( std::make_pair(f.item.url, f) ); + // functions which need more privileges diff --git a/core/htmlfilter.cpp b/core/htmlfilter.cpp index 86f6149..4e800e8 100755 --- a/core/htmlfilter.cpp +++ b/core/htmlfilter.cpp @@ -48,8 +48,8 @@ void HTMLFilter::Filter(const std::string & in, std::string & out) HTMLFilter::HTMLFilter() { - pstack = new Item[CMSLU_HTMLFILTER_STACK_MAXLEN]; - buffer = new char[CMSLU_HTMLFILTER_BUFFER_MAXLEN]; + pstack = new Item[WINIX_HTMLFILTER_STACK_MAXLEN]; + buffer = new char[WINIX_HTMLFILTER_BUFFER_MAXLEN]; tab_size = 2; trim_white = false; @@ -60,16 +60,16 @@ HTMLFilter::HTMLFilter() HTMLFilter::HTMLFilter(const HTMLFilter & f) { // don't need to copy the stack - pstack = new Item[CMSLU_HTMLFILTER_STACK_MAXLEN]; - buffer = new char[CMSLU_HTMLFILTER_BUFFER_MAXLEN]; + pstack = new Item[WINIX_HTMLFILTER_STACK_MAXLEN]; + buffer = new char[WINIX_HTMLFILTER_BUFFER_MAXLEN]; } HTMLFilter & HTMLFilter::operator=(const HTMLFilter & f) { // don't need to copy the stack - pstack = new Item[CMSLU_HTMLFILTER_STACK_MAXLEN]; - buffer = new char[CMSLU_HTMLFILTER_BUFFER_MAXLEN]; + pstack = new Item[WINIX_HTMLFILTER_STACK_MAXLEN]; + buffer = new char[WINIX_HTMLFILTER_BUFFER_MAXLEN]; return *this; } @@ -129,7 +129,7 @@ return pstack[stack_len-1]; bool HTMLFilter::PushStack() { - if( stack_len == CMSLU_HTMLFILTER_STACK_MAXLEN ) + if( stack_len == WINIX_HTMLFILTER_STACK_MAXLEN ) // oops, too many items return false; @@ -302,7 +302,7 @@ void HTMLFilter::ReadItemName() { size_t i; - for( i=0 ; IsValidCharForName(*pchar) && i CMSLU_POSTMULTI_OUTPUT_BUFFER + boundary.size() + 2 ) // +2 for the new line character + if( content.size() > WINIX_POSTMULTI_OUTPUT_BUFFER + boundary.size() + 2 ) // +2 for the new line character { - tmp_file.write(content.c_str(), CMSLU_POSTMULTI_OUTPUT_BUFFER); - content_len += CMSLU_POSTMULTI_OUTPUT_BUFFER; - content.erase(0, CMSLU_POSTMULTI_OUTPUT_BUFFER); + tmp_file.write(content.c_str(), WINIX_POSTMULTI_OUTPUT_BUFFER); + content_len += WINIX_POSTMULTI_OUTPUT_BUFFER; + content.erase(0, WINIX_POSTMULTI_OUTPUT_BUFFER); } if( data.post_file_max != 0 && content_len > (size_t)data.post_file_max ) @@ -290,7 +290,7 @@ void PostMultiParser::ReadContentToFile() time_t t1, t2; content.clear(); - content.reserve(CMSLU_POSTMULTI_OUTPUT_BUFFER + boundary.size()); + content.reserve(WINIX_POSTMULTI_OUTPUT_BUFFER + boundary.size()); content_len = 0; t1 = time(0); @@ -343,10 +343,10 @@ void PostMultiParser::ReadContent() void PostMultiParser::AddNormalPostVar() { - if( post_table->size() >= CMSLU_POSTTABLE_MAXSIZE ) + if( post_table->size() >= WINIX_POSTTABLE_MAXSIZE ) { err = Error::input_too_large; - log << log1 << "PMP: more than " << CMSLU_POSTTABLE_MAXSIZE << " post variables (skipping)" << logend; + log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post variables (skipping)" << logend; return; } @@ -364,10 +364,10 @@ void PostMultiParser::AddNormalPostVar() void PostMultiParser::AddFilePostVar() { - if( post_file_table->size() >= CMSLU_POSTTABLE_MAXSIZE ) + if( post_file_table->size() >= WINIX_POSTTABLE_MAXSIZE ) { err = Error::input_too_large; - log << log1 << "PMP: more than " << CMSLU_POSTTABLE_MAXSIZE << " post file variables (skipping)" << logend; + log << log1 << "PMP: more than " << WINIX_POSTTABLE_MAXSIZE << " post file variables (skipping)" << logend; return; } @@ -433,7 +433,7 @@ void PostMultiParser::CreateTmpFile() { char buf[100]; - sprintf(buf, "/tmp/cmslu_%u_%d_%u", (unsigned)getpid(), tmp_filename_postfix, rand()); + sprintf(buf, "/tmp/winix_%u_%d_%u", (unsigned)getpid(), tmp_filename_postfix, rand()); tmp_filename_postfix += 1; tmp_file.open(buf, std::ios_base::binary | std::ios_base::out); @@ -493,13 +493,13 @@ void PostMultiParser::ReadChar() if( in_buffer_ind >= in_buffer_len ) { - if( in_buffer_len < CMSLU_POSTMULTI_INPUT_BUFFER ) + if( in_buffer_len < WINIX_POSTMULTI_INPUT_BUFFER ) { last = -1; return; } - in_buffer_len = FCGX_GetStr((char*)in_buffer, CMSLU_POSTMULTI_INPUT_BUFFER, in); + in_buffer_len = FCGX_GetStr((char*)in_buffer, WINIX_POSTMULTI_INPUT_BUFFER, in); in_buffer_ind = 0; } @@ -522,8 +522,8 @@ Error PostMultiParser::Parse(FCGX_Stream * in_, PostTable & post_table_, PostFil last = 0; err = Error::ok; line_end_dos = false; - in_buffer_ind = CMSLU_POSTMULTI_INPUT_BUFFER; - in_buffer_len = CMSLU_POSTMULTI_INPUT_BUFFER; + in_buffer_ind = WINIX_POSTMULTI_INPUT_BUFFER; + in_buffer_len = WINIX_POSTMULTI_INPUT_BUFFER; post_table = &post_table_; post_file_table = &post_file_table_; tmp_filename_postfix = 1; diff --git a/core/postmultiparser.h b/core/postmultiparser.h index 468469c..871460b 100755 --- a/core/postmultiparser.h +++ b/core/postmultiparser.h @@ -17,8 +17,8 @@ #include "requesttypes.h" // 2 MB -#define CMSLU_POSTMULTI_INPUT_BUFFER 2097152 -#define CMSLU_POSTMULTI_OUTPUT_BUFFER 2097152 +#define WINIX_POSTMULTI_INPUT_BUFFER 2097152 +#define WINIX_POSTMULTI_OUTPUT_BUFFER 2097152 class PostMultiParser diff --git a/core/request.cpp b/core/request.cpp index 50e48d3..85b7d6c 100755 --- a/core/request.cpp +++ b/core/request.cpp @@ -105,7 +105,7 @@ void Request::Clear() redirect_to.clear(); - plugin.Call(CMSLU_REQUEST_CLEAR); + plugin.Call(WINIX_REQUEST_CLEAR); } diff --git a/core/requesttypes.h b/core/requesttypes.h index b2162e4..87da615 100755 --- a/core/requesttypes.h +++ b/core/requesttypes.h @@ -15,7 +15,7 @@ #include -#define CMSLU_POSTTABLE_MAXSIZE 20 +#define WINIX_POSTTABLE_MAXSIZE 20 struct PostFile diff --git a/core/sessionparser.cpp b/core/sessionparser.cpp index 47bb977..eb6a8e8 100755 --- a/core/sessionparser.cpp +++ b/core/sessionparser.cpp @@ -66,6 +66,7 @@ bool SessionParser::Parse(SessionContainer & container) if( MakeSession(user_id) ) { + data.how_many_logged += 1; container.PushBack(session); log << log2 << "SP: read session id: " << session.id << " for user: " << session.puser->name << logend; } diff --git a/core/users.h b/core/users.h index 75c1a2f..060b880 100755 --- a/core/users.h +++ b/core/users.h @@ -40,7 +40,6 @@ public: Iterator End(); SizeType Size(); User & operator[](SizeType pos); - }; diff --git a/html/fun_chmod.html b/html/fun_chmod.html new file mode 100755 index 0000000..e69de29 diff --git a/html/fun_chown.html b/html/fun_chown.html new file mode 100755 index 0000000..e69de29 diff --git a/html/fun_ckeditor.html b/html/fun_ckeditor.html new file mode 100755 index 0000000..77dcebb --- /dev/null +++ b/html/fun_ckeditor.html @@ -0,0 +1,54 @@ +[if-one item_is]

{edit}

[else]

{add}

[end] + +[include "err_abuse.html"] + + +
+
+ {form_emacs_legend} + + [if-one mount_type_is_cms] +

{title}:

+ + +

{suggested_url}:

+ + [end] + + [if-one mount_type_is_thread] + [is mount_thread_is "subject"] +

{title}:

+ + +

{suggested_url}:

+ + [end] + [end] + + [if-one mount_type_is_cms]

{form_emacs_content_cms}

[end] + [if-one mount_type_is_thread]

{form_emacs_content_thread}

[end] + [if-one mount_type_is_ticket]

{form_emacs_content_ticket}

[end] + + + + + + [is winix_function_param_is "full"] + + [else] + + [end] + + [if-no user_logged] +

{nick}:

+ + +

{rebus_how_is_it} [rebus_question]?

+ + [end] + + +
+
+ + diff --git a/html/fun_emacs.html b/html/fun_emacs.html index 6c544da..e147716 100755 --- a/html/fun_emacs.html +++ b/html/fun_emacs.html @@ -11,7 +11,7 @@

{title}:

-

{url}:

+

{suggested_url}:

[end] @@ -20,7 +20,7 @@

{title}:

-

{url}:

+

{suggested_url}:

[end] [end] diff --git a/html/fun_login.html b/html/fun_login.html new file mode 100755 index 0000000..05b563d --- /dev/null +++ b/html/fun_login.html @@ -0,0 +1,18 @@ +

{login_header}

+ +[if-one user_logged] +

{logged_as_long}: [user_name]
+ {logout}

+[else] +
+
+ {form_login_legend}: + + + + +
+
+[end] + + diff --git a/html/fun_ls.html b/html/fun_ls.html index a7f9a48..c269f94 100755 --- a/html/fun_ls.html +++ b/html/fun_ls.html @@ -1,22 +1,50 @@ -[if-no item_is] - [if-one dir_childs_tab] -
    - [for dir_childs_tab] -
  • [dir_childs_tab_url]/
  • + +[is winix_function_param_is "ckeditor_browse"] + + + + [if-any item_tab] +
      + + [for item_tab] +
    • [item_tab_subject]
    • [end] +
    [end] -[end] + +[else] +

    {ls_header}

    -[if-one item_tab] - + [end] + + + + [if-one item_tab] + + [end] + + + [include "item_options.html"] + [end] + + + diff --git a/html/fun_mv.html b/html/fun_mv.html new file mode 100755 index 0000000..e69de29 diff --git a/html/fun_uname.html b/html/fun_uname.html new file mode 100755 index 0000000..e69de29 diff --git a/html/fun_uptime.html b/html/fun_uptime.html new file mode 100755 index 0000000..7c4557f --- /dev/null +++ b/html/fun_uptime.html @@ -0,0 +1,14 @@ +

    {uptime_header}

    + +

    [winix_cur_time], {uptime_up} + +[if-one uptime_more_than_one_day] + [uptime_days] {uptime_days}, +[else] + [uptime_hours], +[end] + +[winix_users_logged] {uptime_users} +

    + + diff --git a/html/index.html b/html/index.html index cfac1d9..3fa56e8 100755 --- a/html/index.html +++ b/html/index.html @@ -8,65 +8,77 @@ + [is winix_function_is "ckeditor"][end] - -
    - + + + + [is-no winix_function_is "ckeditor"] +
    +
    + +
    + [content] +
    + [else] +
    + [content] +
    + [end] [# is-no winix_function_is "ckeditor"] + + + + +
    + - - - - - -
    - -
    - - - -
    -[content] -
    - - - - - - - - +[else] + + +
    + [content] +
    + +[end] [# is-no winix_function_param_is "fullscreen"] + diff --git a/html/item_options.html b/html/item_options.html index 83a775e..3b9205d 100755 --- a/html/item_options.html +++ b/html/item_options.html @@ -1,13 +1,18 @@ +[is-no winix_function_param_is "fullscreen"] [if-one dir_can_write item_can_write]

    {admin_options}:

    [end] - +[end] diff --git a/locale/en b/locale/en index 79c68a6..50d1462 100755 --- a/locale/en +++ b/locale/en @@ -2,6 +2,8 @@ language = en charset = iso-8859-1 logged_as = logged as +logged_as_long = You are logged as + logout = logout form_login_legend = Loging @@ -40,6 +42,7 @@ form_thread_legend = Thread form button_thread_submit = Create thread url = Url +suggested_url = Suggested url short_url = Short url title = Title nick = Nick @@ -100,6 +103,9 @@ last_table_login_date = Login time last_table_logout_date = Logout time last_none = There is no anything information. + +ls_header = Directory listing + mkdir_header = Make directory mkdir_was_error = We are sorry but there were errors during creating the directory mkdir_form_legend = Make directory form @@ -149,14 +155,23 @@ who_table_start = Start who_table_last_active = Last active who_none = There is no any sessions. -admin_options = Available administrative options. -admin_mkdir = Add directory -admin_emacs_add = Add file -admin_emacs_edit = Edit file -admin_rm = Remove file +admin_options = Frequently used administrative options +admin_ls = List directory (ls) +admin_mkdir = Add directory (mkdir) +admin_emacs_add = Add file (emacs) +admin_emacs_edit = Edit file (emacs) +admin_ckeditor_add = Add file (ckeditor) +admin_ckeditor_edit = Edit file (ckeditor) +admin_rm = Remove file (rm) +admin_upload = Upload an image or file (upload) +login_header = Login +uptime_header = Uptime +uptime_up = up +uptime_users = users +uptime_days = days # notifications diff --git a/locale/pl b/locale/pl index f03065c..4e5b89f 100755 --- a/locale/pl +++ b/locale/pl @@ -2,6 +2,7 @@ language = pl charset = iso-8859-2 logged_as = zalogowany jako +logged_as_long = Aktualnie jesteś zalogowany jako logout = wyloguj @@ -40,6 +41,7 @@ form_thread_legend = Wype button_thread_submit = Załóż wątek url = Url +suggested_url = Sugerowany url short_url = Krótki url title = Tytuł nick = Nick @@ -100,6 +102,9 @@ last_table_login_date = Czas zalogowania last_table_logout_date = Czas wylogowania last_none = Nie ma dostępnych żadnych informacji. + +ls_header = Zawartość katalogu + mkdir_header = Stwórz katalog mkdir_was_error = Przykro nam ale wystąpiły błędy podczas tworzenia tego katalogu. mkdir_form_legend = Wypełnij wszystkie pozycje formularza @@ -149,17 +154,26 @@ who_table_start = Start who_table_last_active = Ostatnio aktywny who_none = Nie ma żadnych dostępnych sesji. -admin_options = Dostępne opcje administracyjne -admin_mkdir = Dodaj katalog -admin_emacs_add = Dodaj pozycję -admin_emacs_edit = Edytuj pozycję -admin_rm = Usuń pozycję +admin_options = Najczęściej używane opcje administracyjne +admin_ls = Pokaż zawartość katalogu (ls) +admin_mkdir = Dodaj katalog (mkdir) +admin_emacs_add = Dodaj pozycję (emacs) +admin_emacs_edit = Edytuj pozycję (emacs) +admin_ckeditor_add = Dodaj pozycję (ckeditor) +admin_ckeditor_edit = Edytuj pozycję (ckeditor) +admin_rm = Usuń pozycję (rm) +admin_upload = Wyślij zdjęcie lub plik (upload) +login_header = Logowanie +uptime_header = Uptime +uptime_up = uruchomiony przez +uptime_users = zalogowanych użytkowników +uptime_days = dni # notifications -notify_new = Coœ nowego +notify_new = Coś nowego notify_change = Zmiany notify_from = Ślimaczkowe powiadomienia notify_content_type = text/plain; charset="ISO-8859-2" diff --git a/main/Makefile.dep b/main/Makefile.dep index 2457540..1bd594d 100755 --- a/main/Makefile.dep +++ b/main/Makefile.dep @@ -3,15 +3,16 @@ main.o: ../core/requestcontroller.h ../content/content.h ../core/item.h main.o: ../templates/templates.h ../templates/patterncacher.h main.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h -main.o: ../confparser/confparser.h ../core/thread.h ../core/ticket.h -main.o: ../core/done.h ../core/sessionmanager.h ../core/sessioncontainer.h -main.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h -main.o: ../core/log.h ../core/user.h ../core/rebus.h ../core/functionparser.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/groups.h ../core/group.h ../core/functions.h -main.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h -main.o: ../core/mount.h ../core/locale.h ../core/log.h ../core/request.h +main.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h +main.o: ../core/httpsimpleparser.h ../core/log.h ../core/thread.h +main.o: ../core/ticket.h ../core/done.h ../core/sessionmanager.h +main.o: ../core/sessioncontainer.h ../core/session.h ../core/done.h +main.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h +main.o: ../core/rebus.h ../core/functionparser.h ../core/requesttypes.h +main.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h +main.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h +main.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h +main.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/request.h main.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h main.o: ../core/acceptbaseparser.h ../core/htmlfilter.h main.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h diff --git a/main/main.cpp b/main/main.cpp index b7892cb..2d411c4 100755 --- a/main/main.cpp +++ b/main/main.cpp @@ -73,6 +73,7 @@ int main(int argv, char ** argc) return 1; } + data.system_start = time(0); data.config_file = argc[1]; if( !config.ReadConfig(true) ) /* errors to stdout */ diff --git a/templates/Makefile.dep b/templates/Makefile.dep index fb44e2e..d65402f 100755 --- a/templates/Makefile.dep +++ b/templates/Makefile.dep @@ -1,7 +1,8 @@ # DO NOT DELETE dir.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -dir.o: ../core/locale.h ../confparser/confparser.h ../core/request.h +dir.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +dir.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.h 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/function.h ../core/thread.h ../core/compress.h @@ -10,21 +11,22 @@ dir.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.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/functions.h ../core/lastcontainer.h ../core/mounts.h -dir.o: ../core/mount.h ../core/locale.h ../core/db.h ../core/log.h -dir.o: ../core/misc.h +dir.o: ../core/mount.h ../core/locale.h ../core/db.h ../core/misc.h doc.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -doc.o: ../core/locale.h ../confparser/confparser.h ../core/data.h -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/group.h ../core/functions.h ../core/function.h -doc.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -doc.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h -doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h -doc.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h -doc.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -doc.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +doc.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +doc.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h ../core/dirs.h +doc.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h +doc.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h +doc.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h +doc.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h +doc.o: ../core/locale.h ../core/request.h ../core/requesttypes.h +doc.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h +doc.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +doc.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +doc.o: ../core/misc.h done.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -done.o: ../core/locale.h ../confparser/confparser.h ../core/request.h +done.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +done.o: ../core/httpsimpleparser.h ../core/log.h ../core/request.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/rebus.h ../core/function.h ../core/thread.h @@ -32,7 +34,8 @@ done.o: ../core/compress.h ../core/acceptencodingparser.h done.o: ../core/acceptbaseparser.h ../core/htmlfilter.h done.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h item.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -item.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +item.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +item.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/group.h ../core/functions.h ../core/function.h @@ -43,7 +46,8 @@ item.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h item.o: ../core/acceptbaseparser.h ../core/htmlfilter.h item.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h last.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -last.o: ../core/locale.h ../confparser/confparser.h ../core/lastcontainer.h +last.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +last.o: ../core/httpsimpleparser.h ../core/log.h ../core/lastcontainer.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/groups.h ../core/group.h ../core/functions.h @@ -56,6 +60,14 @@ last.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h last.o: ../core/misc.h localefilter.o: localefilter.h ../core/locale.h ../confparser/confparser.h localefilter.o: ../core/misc.h ../core/item.h +ls.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h +ls.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +ls.o: ../core/httpsimpleparser.h ../core/log.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/ticket.h misc.o: ../core/data.h ../core/dirs.h ../core/item.h ../core/dircontainer.h misc.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h misc.o: ../core/groups.h ../core/group.h ../core/functions.h @@ -64,7 +76,8 @@ misc.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h misc.o: ../core/misc.h misc.h localefilter.h ../core/locale.h misc.o: ../confparser/confparser.h mount.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -mount.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +mount.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +mount.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/group.h ../core/functions.h ../core/function.h @@ -78,7 +91,8 @@ patterncacher.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h patterncacher.o: ../core/mount.h ../core/error.h ../core/rebus.h patterncacher.o: ../core/locale.h ../core/log.h priv.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -priv.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +priv.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +priv.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/group.h ../core/functions.h ../core/function.h @@ -99,20 +113,23 @@ rebus.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h rebus.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h rebus.o: ../core/mount.h ../core/locale.h templates.h patterncacher.h rebus.o: ../core/item.h misc.h localefilter.h ../core/locale.h -rebus.o: ../confparser/confparser.h +rebus.o: ../confparser/confparser.h ckeditorgetparser.h +rebus.o: ../core/httpsimpleparser.h ../core/log.h sys.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -sys.o: ../core/locale.h ../confparser/confparser.h ../core/data.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/group.h ../core/functions.h ../core/function.h -sys.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h -sys.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h -sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h -sys.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h -sys.o: ../core/acceptbaseparser.h ../core/htmlfilter.h -sys.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +sys.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +sys.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h ../core/dirs.h +sys.o: ../core/item.h ../core/dircontainer.h ../core/users.h ../core/user.h +sys.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h +sys.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h +sys.o: ../core/mounts.h ../core/mount.h ../core/error.h ../core/rebus.h +sys.o: ../core/locale.h ../core/request.h ../core/requesttypes.h +sys.o: ../core/session.h ../core/done.h ../core/thread.h ../core/compress.h +sys.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h +sys.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h +sys.o: ../core/misc.h templates.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -templates.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +templates.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +templates.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/log.h ../core/groups.h ../core/group.h @@ -126,7 +143,8 @@ templates.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h templates.o: ../core/plugin.h ../core/request.h ../core/data.h templates.o: ../core/pluginmsg.h thread.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -thread.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +thread.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +thread.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/groups.h ../core/group.h ../core/functions.h @@ -138,7 +156,8 @@ thread.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h thread.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h thread.o: ../core/misc.h ticket.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -ticket.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +ticket.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +ticket.o: ../core/httpsimpleparser.h ../core/log.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 @@ -149,8 +168,17 @@ ticket.o: ../core/done.h ../core/thread.h ../core/compress.h ticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h ticket.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h ticket.o: ../core/misc.h +uptime.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h +uptime.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +uptime.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h +uptime.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h +uptime.o: ../core/users.h ../core/user.h ../core/ugcontainer.h ../core/log.h +uptime.o: ../core/groups.h ../core/group.h ../core/functions.h +uptime.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h +uptime.o: ../core/mount.h ../core/error.h ../core/rebus.h ../core/locale.h user.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -user.o: ../core/locale.h ../confparser/confparser.h ../core/data.h +user.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +user.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.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/group.h ../core/functions.h ../core/function.h @@ -161,7 +189,8 @@ user.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h user.o: ../core/acceptbaseparser.h ../core/htmlfilter.h user.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h who.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h -who.o: ../core/locale.h ../confparser/confparser.h ../core/sessioncontainer.h +who.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +who.o: ../core/httpsimpleparser.h ../core/log.h ../core/sessioncontainer.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/requestcontroller.h ../content/content.h @@ -175,3 +204,15 @@ who.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/request.h who.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h who.o: ../core/acceptbaseparser.h ../core/htmlfilter.h who.o: ../core/postmultiparser.h ../core/ticket.h ../core/misc.h +winix.o: templates.h patterncacher.h ../core/item.h misc.h localefilter.h +winix.o: ../core/locale.h ../confparser/confparser.h ckeditorgetparser.h +winix.o: ../core/httpsimpleparser.h ../core/log.h ../core/data.h +winix.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h +winix.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h +winix.o: ../core/group.h ../core/functions.h ../core/function.h +winix.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h +winix.o: ../core/error.h ../core/rebus.h ../core/locale.h ../core/request.h +winix.o: ../core/requesttypes.h ../core/session.h ../core/done.h +winix.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h +winix.o: ../core/acceptbaseparser.h ../core/htmlfilter.h +winix.o: ../core/postmultiparser.h ../core/ticket.h diff --git a/templates/Makefile.o.dep b/templates/Makefile.o.dep index 148b339..9ef05fb 100755 --- a/templates/Makefile.o.dep +++ b/templates/Makefile.o.dep @@ -1 +1 @@ -o = dir.o doc.o done.o item.o last.o localefilter.o misc.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o user.o who.o +o = dir.o doc.o done.o item.o last.o localefilter.o ls.o misc.o mount.o patterncacher.o priv.o rebus.o sys.o templates.o thread.o ticket.o uptime.o user.o who.o winix.o diff --git a/templates/ckeditorgetparser.h b/templates/ckeditorgetparser.h new file mode 100755 index 0000000..7134300 --- /dev/null +++ b/templates/ckeditorgetparser.h @@ -0,0 +1,68 @@ +/* + * This file is a part of CMSLU -- Content Management System like Unix + * and is not publicly distributed + * + * Copyright (c) 2008-2010, Tomasz Sowa + * All rights reserved. + * + */ + +#ifndef headerfilecmslutemplatesckeditorgetparser +#define headerfilecmslutemplatesckeditorgetparser + + +#include +#include "../core/httpsimpleparser.h" +#include "../core/log.h" + + + + +class CKEditorGetParser : public HttpSimpleParser +{ + const char * pchar; + + +protected: + + + virtual int GetChar() + { + if( !pchar || *pchar == 0 ) + return -1; + + return (int)(unsigned char)*(pchar++); + } + + + virtual void Parameter(std::string & name, std::string & value) + { + if( name == "CKEditorFuncNum" ) + { + fun_num = atol(value.c_str()); + log << log3 << "CKEGetParser: callback function number: " << fun_num << logend; + } + } + + +public: + + long fun_num; + + CKEditorGetParser() + { + pchar = 0; + fun_num = 0; + } + + void Parse(const char * str) + { + pchar = str; + HttpSimpleParser::Parse(); + } + + +}; + + +#endif diff --git a/templates/doc.cpp b/templates/doc.cpp index 7c6bbeb..cf3c786 100755 --- a/templates/doc.cpp +++ b/templates/doc.cpp @@ -58,6 +58,11 @@ void doc_base_url_static(Info & i) } +void doc_base_url_static_ext(Info & i) +{ + i.out << data.base_url_static_ext; +} + void doc_base_url_static_auth(Info & i) { diff --git a/templates/item.cpp b/templates/item.cpp index bd83613..91d8997 100755 --- a/templates/item.cpp +++ b/templates/item.cpp @@ -187,16 +187,22 @@ void item_static_auth_is_other(Info & i) void item_can_read(Info & i) { - if( request.HasReadAccess(request.item) ) - i.result = true; + i.result = request.HasReadAccess(request.item); } + void item_can_write(Info & i) { - if( request.HasWriteAccess(request.item) ) - i.result = true; + i.result = request.HasWriteAccess(request.item); } + +void item_can_remove(Info & i) +{ + i.result = request.CanRemove(request.item); +} + + void item_info(Info & i) { if( static_cast(data.locale.GetLang()) >= patterns.size() ) @@ -449,6 +455,17 @@ void item_tab_link(Info & i) } +void item_tab_link_static_auth(Info & i) +{ + if( item_index < request.item_table.size() ) + { + HtmlEscape(i.out, data.base_url_static_auth); + item_tab_dir(i); + item_tab_url(i); + } +} + + void item_tab_can_read(Info & i) { if( item_index < request.item_table.size() ) diff --git a/templates/ls.cpp b/templates/ls.cpp new file mode 100755 index 0000000..33fc035 --- /dev/null +++ b/templates/ls.cpp @@ -0,0 +1,47 @@ +/* + * This file is a part of CMSLU -- Content Management System like Unix + * and is not publicly distributed + * + * Copyright (c) 2008-2010, Tomasz Sowa + * All rights reserved. + * + */ + +#include "templates.h" +#include "../core/request.h" + + + + +namespace TemplatesFunctions +{ + +static size_t ls_ckeditor_reqid = 0; + + + + +void ls_ckeditor_funnum_browse(Info & i) +{ + if( ls_ckeditor_reqid != request.id ) + { + ls_ckeditor_reqid = request.id; + ckeditor_getparser.fun_num = 2; // default if there is a problem with parsing info + + if( !request.param_table.empty() ) + { + const char * str = request.param_table[request.param_table.size()-1]->c_str() + 1; // the first char is '?' + ckeditor_getparser.Parse(str); + } + } + + i.out << ckeditor_getparser.fun_num; +} + + + + + + +} // namespace + diff --git a/templates/templates.cpp b/templates/templates.cpp index c479d13..881990e 100755 --- a/templates/templates.cpp +++ b/templates/templates.cpp @@ -18,11 +18,11 @@ namespace TemplatesFunctions { -TemplatesMisc::Patterns patterns; -Ezc::Functions functions; -PatternCacher pattern_cacher; -LocaleFilter locale_filter; - +TemplatesMisc::Patterns patterns; +Ezc::Functions functions; +PatternCacher pattern_cacher; +LocaleFilter locale_filter; +CKEditorGetParser ckeditor_getparser; @@ -58,7 +58,14 @@ Ezc::Pattern * p = 0; {FUN_TICKET, pat_fun_ticket}, {FUN_CREATETICKET, pat_fun_createticket}, {FUN_EDITTICKET, pat_fun_createticket}, - {FUN_UPLOAD, pat_fun_upload} + {FUN_UPLOAD, pat_fun_upload}, + {FUN_UPTIME, pat_fun_uptime}, + {FUN_LOGIN, pat_fun_login}, +/* {FUN_MV, pat_fun_mv}, + {FUN_UNAME, pat_fun_uname}, + {FUN_CHMOD, pat_fun_chmod}, + {FUN_CHOWN, pat_fun_chown}, */ + {FUN_CKEDITOR, pat_fun_ckeditor} }; size_t i, len = sizeof(pat_name_tab)/sizeof(PatName); @@ -164,6 +171,7 @@ void Templates::CreateFunctions() functions.Insert("doc_title", doc_title); functions.Insert("doc_base_url", doc_base_url); functions.Insert("doc_base_url_static", doc_base_url_static); + functions.Insert("doc_base_url_static_ext", doc_base_url_static_ext); functions.Insert("doc_base_url_static_auth", doc_base_url_static_auth); functions.Insert("doc_current_url", doc_current_url); functions.Insert("doc_is_error", doc_is_error); @@ -193,6 +201,7 @@ void Templates::CreateFunctions() functions.Insert("item_can_read", item_can_read); functions.Insert("item_can_write", item_can_write); + functions.Insert("item_can_remove", item_can_remove); functions.Insert("item_info", item_info); functions.Insert("item_user", item_user); functions.Insert("item_date_creation", item_date_creation); @@ -222,6 +231,7 @@ void Templates::CreateFunctions() functions.Insert("item_tab_dir", item_tab_dir); functions.Insert("item_tab_url", item_tab_url); functions.Insert("item_tab_link", item_tab_link); + functions.Insert("item_tab_link_static_auth", item_tab_link_static_auth); functions.Insert("item_tab_can_read", item_tab_can_read); functions.Insert("item_tab_info", item_tab_info); functions.Insert("item_tab_user", item_tab_user); @@ -260,6 +270,13 @@ void Templates::CreateFunctions() + /* + user + */ + functions.Insert("ls_ckeditor_funnum_browse", ls_ckeditor_funnum_browse); + + + /* user */ @@ -414,12 +431,29 @@ void Templates::CreateFunctions() /* rebus */ - functions.Insert("rebus_question", rebus_question); + functions.Insert("rebus_question", rebus_question); + /* + uptime + */ + functions.Insert("uptime_more_than_one_day", uptime_more_than_one_day); + functions.Insert("uptime_days", uptime_days); + functions.Insert("uptime_hours", uptime_hours); + + /* + winix + */ + functions.Insert("winix_cur_time", winix_cur_time); + functions.Insert("winix_users_logged", winix_users_logged); + functions.Insert("winix_function_is", winix_function_is); + functions.Insert("winix_function_param_is", winix_function_param_is); - plugin.Call(CMSLU_TEMPLATES_CREATEFUNCTIONS, &functions); + + + + plugin.Call(WINIX_TEMPLATES_CREATEFUNCTIONS, &functions); } @@ -457,6 +491,13 @@ using namespace TemplatesMisc; Read(patterns, pat_fun_upload, locale_filter, "fun_upload.html"); Read(patterns, pat_fun_ticket, locale_filter, "fun_ticket.html"); Read(patterns, pat_fun_createticket,locale_filter, "fun_createticket.html"); + Read(patterns, pat_fun_uptime, locale_filter, "fun_uptime.html"); + Read(patterns, pat_fun_login, locale_filter, "fun_login.html"); + /*Read(patterns, pat_fun_mv, locale_filter, "fun_mv.html"); + Read(patterns, pat_fun_uname, locale_filter, "fun_uname.html"); + Read(patterns, pat_fun_chmod, locale_filter, "fun_chmod.html"); + Read(patterns, pat_fun_chown, locale_filter, "fun_chown.html"); */ + Read(patterns, pat_fun_ckeditor, locale_filter, "fun_ckeditor.html"); } diff --git a/templates/templates.h b/templates/templates.h index 0b60591..2b2e9d0 100755 --- a/templates/templates.h +++ b/templates/templates.h @@ -15,6 +15,7 @@ #include "ezc.h" #include "patterncacher.h" #include "misc.h" +#include "ckeditorgetparser.h" @@ -39,7 +40,14 @@ namespace TemplatesFunctions pat_fun_createthread, pat_fun_upload, pat_fun_ticket, + pat_fun_uptime, + pat_fun_login, + pat_fun_mv, + pat_fun_uname, + pat_fun_chmod, + pat_fun_chown, pat_fun_createticket, + pat_fun_ckeditor, pat_err_404, pat_err_per_denied, pat_err_others, @@ -61,7 +69,7 @@ namespace TemplatesFunctions extern TemplatesMisc::Patterns patterns; extern PatternCacher pattern_cacher; extern Ezc::Functions functions; - + extern CKEditorGetParser ckeditor_getparser; /* @@ -78,6 +86,7 @@ namespace TemplatesFunctions void doc_title(Info & i); void doc_base_url(Info & i); void doc_base_url_static(Info & i); + void doc_base_url_static_ext(Info & i); void doc_base_url_static_auth(Info & i); void doc_current_url(Info & i); void doc_is_error(Info & i); @@ -107,6 +116,7 @@ namespace TemplatesFunctions void item_static_auth_is_other(Info & i); void item_can_read(Info & i); void item_can_write(Info & i); + void item_can_remove(Info & i); void item_info(Info & i); void item_user(Info & i); void item_date_creation(Info & i); @@ -136,6 +146,7 @@ namespace TemplatesFunctions void item_tab_dir(Info & i); void item_tab_url(Info & i); void item_tab_link(Info & i); + void item_tab_link_static_auth(Info & i); void item_tab_can_read(Info & i); void item_tab_info(Info & i); void item_tab_user(Info & i); @@ -173,6 +184,12 @@ namespace TemplatesFunctions void dir_last_dates_equal(Info & i); + /* + user + */ + void ls_ckeditor_funnum_browse(Info & i); + + /* user */ @@ -318,13 +335,30 @@ namespace TemplatesFunctions void mount_type_is_ticket(Info & i); void mount_type_is_cms(Info & i); - + /* rebus */ void rebus_question(Info & i); + /* + uptime + */ + void uptime_more_than_one_day(Info & i); + void uptime_days(Info & i); + void uptime_hours(Info & i); + + + /* + winix + */ + void winix_cur_time(Info & i); + void winix_users_logged(Info & i); + void winix_function_is(Info & i); + void winix_function_param_is(Info & i); + + } // namespace TemplatesFunctions diff --git a/templates/uptime.cpp b/templates/uptime.cpp new file mode 100755 index 0000000..63a4e1a --- /dev/null +++ b/templates/uptime.cpp @@ -0,0 +1,55 @@ +/* + * This file is a part of CMSLU -- Content Management System like Unix + * and is not publicly distributed + * + * Copyright (c) 2008-2010, Tomasz Sowa + * All rights reserved. + * + */ + +#include +#include "templates.h" +#include "../core/data.h" + + +namespace TemplatesFunctions +{ + + + +void uptime_more_than_one_day(Info & i) +{ + time_t up = time(0) - data.system_start; + time_t days = up / 60 / 60 / 24; + + i.result = ( days > 1 ); +} + + +void uptime_days(Info & i) +{ + time_t up = time(0) - data.system_start; + time_t days = up / 60 / 60 / 24; + + i.out << days; +} + + +void uptime_hours(Info & i) +{ +char buf[50]; + + time_t sec = time(0) - data.system_start; + time_t min = sec / 60; + time_t hour = min / 60; + + if( hour == 0 && min == 0 ) + sprintf(buf, "%d:%02d:%02d", hour, min, sec); + else + sprintf(buf, "%d:%02d", hour, min); + + i.out << buf; +} + + +} // namespace diff --git a/templates/winix.cpp b/templates/winix.cpp new file mode 100755 index 0000000..9a31b9b --- /dev/null +++ b/templates/winix.cpp @@ -0,0 +1,60 @@ +/* + * This file is a part of CMSLU -- Content Management System like Unix + * and is not publicly distributed + * + * Copyright (c) 2008-2010, Tomasz Sowa + * All rights reserved. + * + */ + +#include +#include "templates.h" +#include "../core/data.h" +#include "../core/request.h" + + +namespace TemplatesFunctions +{ + + + +void winix_cur_time(Info & i) +{ +static char buffer[100]; + + time_t t = time(0); + tm * ptm = localtime(&t); + + sprintf(buffer, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec); + i.out << buffer; +} + + + +void winix_users_logged(Info & i) +{ + i.out << data.how_many_logged; +} + + + +void winix_function_is(Info & i) +{ + if( !request.pfunction || !i.is ) + return; + + i.result = (request.pfunction->item.url == *i.is); +} + + +void winix_function_param_is(Info & i) +{ + if( !i.is ) + return; + + i.result = request.IsParam(i.is->c_str()); +} + + + +} // namespace diff --git a/templatesnotify/notify.cpp b/templatesnotify/notify.cpp index 0f0e141..aed857a 100755 --- a/templatesnotify/notify.cpp +++ b/templatesnotify/notify.cpp @@ -18,28 +18,28 @@ namespace TemplatesNotifyFunctions void notify_item_added(Info & i) { - i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_ADD) != 0; + i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_ADD) != 0; } void notify_item_edited(Info & i) { - i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_EDIT) != 0; + i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_EDIT) != 0; } void notify_item_deleted(Info & i) { - i.result = (notify_msg->notify_code & CMSLU_NOTIFY_ITEM_DELETE) != 0; + i.result = (notify_msg->notify_code & WINIX_NOTIFY_ITEM_DELETE) != 0; } void notify_dir_added(Info & i) { - i.result = (notify_msg->notify_code & CMSLU_NOTIFY_DIR_ADD) != 0; + i.result = (notify_msg->notify_code & WINIX_NOTIFY_DIR_ADD) != 0; }