the first part of reimplementing has been done

now we have app object and singletons are only: log logn plugin and app



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@628 e52654a7-88a9-db11-a3e9-0013d4bc506e
pull/3/head 0.4.0
Tomasz Sowa 13 years ago
parent 6897192364
commit 217cf1420b

@ -5,7 +5,8 @@ CXX = g++
endif
ifndef CXXFLAGS
CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
#CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
CXXFLAGS = -fPIC -Wall -pedantic -O0 -g -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
endif
@ -18,13 +19,12 @@ all: winix
winix: FORCE
@cd core ; $(MAKE) -e
@cd content ; $(MAKE) -e
@cd confparser ; $(MAKE) -e
@cd functions ; $(MAKE) -e
@cd templates ; $(MAKE) -e
@cd templatesnotify ; $(MAKE) -e
@cd plugins/stats ; $(MAKE) -e
@cd ../ezc/src ; $(MAKE) -e
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o content/*.o templates/*.o templatesnotify/*.o confparser/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o functions/*.o templates/*.o templatesnotify/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz -lpthread
@cd main ; $(MAKE) -e
# use the full path with winix.so
$(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so
@ -32,8 +32,7 @@ winix: FORCE
clean:
@cd core ; $(MAKE) -e clean
@cd content ; $(MAKE) -e clean
@cd confparser ; $(MAKE) -e clean
@cd functions ; $(MAKE) -e clean
@cd templates ; $(MAKE) -e clean
@cd templatesnotify ; $(MAKE) -e clean
@cd plugins/stats ; $(MAKE) -e clean
@ -48,11 +47,10 @@ FORCE:
depend:
@cd core ; $(MAKE) -e depend
@cd content ; $(MAKE) -e depend
@cd confparser ; $(MAKE) -e depend
@cd functions ; $(MAKE) -e depend
@cd templates ; $(MAKE) -e depend
@cd templatesnotify ; $(MAKE) -e depend
@cd plugins/stats ; $(MAKE) -e depend
@cd plugins/stats ; $(MAKE) -e depend
@cd ../ezc/src ; $(MAKE) -e depend
@cd main ; $(MAKE) -e depend

@ -1,3 +1 @@
# DO NOT DELETE
confparser.o: confparser.h

@ -1 +1 @@
o = confparser.o
o =

@ -1,455 +0,0 @@
# DO NOT DELETE
adduser.o: content.h ../core/item.h ../templates/templates.h
adduser.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
adduser.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
adduser.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
adduser.o: ../core/httpsimpleparser.h ../core/log.h
adduser.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
adduser.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
adduser.o: ../core/thread.h ../core/error.h ../core/log.h
adduser.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
adduser.o: ../core/request.h ../core/requesttypes.h ../core/session.h
adduser.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
adduser.o: ../core/compress.h ../core/acceptencodingparser.h
adduser.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
adduser.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
adduser.o: ../core/users.h ../core/groups.h ../core/functions.h
adduser.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
adduser.o: ../core/loadavg.h
cat.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
cat.o: ../templates/patterncacher.h ../templates/misc.h
cat.o: ../templates/localefilter.h ../core/locale.h
cat.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
cat.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
cat.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
cat.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
cat.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
cat.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
cat.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
cat.o: ../core/function.h ../core/compress.h ../core/acceptencodingparser.h
cat.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
cat.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
cat.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
cat.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
cat.o: ../core/loadavg.h
content.o: content.h ../core/item.h ../templates/templates.h
content.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
content.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
content.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
content.o: ../core/httpsimpleparser.h ../core/log.h
content.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
content.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
content.o: ../core/thread.h ../core/error.h ../core/log.h
content.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
content.o: ../core/request.h ../core/requesttypes.h ../core/session.h
content.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
content.o: ../core/compress.h ../core/acceptencodingparser.h
content.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
content.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
content.o: ../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/loadavg.h ../core/misc.h ../core/plugin.h
content.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
cp.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
cp.o: ../templates/patterncacher.h ../templates/misc.h
cp.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h
cp.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
cp.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
cp.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
cp.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
cp.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
cp.o: ../core/request.h ../core/requesttypes.h ../core/session.h
cp.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
cp.o: ../core/compress.h ../core/acceptencodingparser.h
cp.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
cp.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h ../core/users.h
cp.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
cp.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/misc.h
createthread.o: content.h ../core/item.h ../templates/templates.h
createthread.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
createthread.o: ../templates/misc.h ../templates/localefilter.h
createthread.o: ../core/locale.h ../confparser/confparser.h
createthread.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
createthread.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
createthread.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
createthread.o: ../core/group.h ../core/thread.h ../core/error.h
createthread.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
createthread.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
createthread.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
createthread.o: ../core/function.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/mount.h ../core/data.h ../core/dirs.h
createthread.o: ../core/users.h ../core/groups.h ../core/functions.h
createthread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
createthread.o: ../core/loadavg.h
createticket.o: content.h ../core/item.h ../templates/templates.h
createticket.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
createticket.o: ../templates/misc.h ../templates/localefilter.h
createticket.o: ../core/locale.h ../confparser/confparser.h
createticket.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
createticket.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
createticket.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
createticket.o: ../core/group.h ../core/thread.h ../core/error.h
createticket.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
createticket.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
createticket.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
createticket.o: ../core/function.h ../core/compress.h
createticket.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
createticket.o: ../core/htmlfilter.h ../core/postmultiparser.h
createticket.o: ../core/error.h ../core/mount.h ../core/data.h ../core/dirs.h
createticket.o: ../core/users.h ../core/groups.h ../core/functions.h
createticket.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
createticket.o: ../core/loadavg.h
default.o: content.h ../core/item.h ../templates/templates.h
default.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
default.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
default.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
default.o: ../core/httpsimpleparser.h ../core/log.h
default.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
default.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
default.o: ../core/thread.h ../core/error.h ../core/log.h
default.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
default.o: ../core/request.h ../core/requesttypes.h ../core/session.h
default.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
default.o: ../core/compress.h ../core/acceptencodingparser.h
default.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
default.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
default.o: ../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 ../core/loadavg.h
download.o: content.h ../core/item.h ../templates/templates.h
download.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
download.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
download.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
download.o: ../core/httpsimpleparser.h ../core/log.h
download.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
download.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
download.o: ../core/thread.h ../core/error.h ../core/log.h
download.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
download.o: ../core/request.h ../core/requesttypes.h ../core/session.h
download.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
download.o: ../core/compress.h ../core/acceptencodingparser.h
download.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
download.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
download.o: ../core/users.h ../core/groups.h ../core/functions.h
download.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
download.o: ../core/loadavg.h
editticket.o: content.h ../core/item.h ../templates/templates.h
editticket.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
editticket.o: ../templates/misc.h ../templates/localefilter.h
editticket.o: ../core/locale.h ../confparser/confparser.h
editticket.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
editticket.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
editticket.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
editticket.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
editticket.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
editticket.o: ../core/request.h ../core/requesttypes.h ../core/session.h
editticket.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
editticket.o: ../core/compress.h ../core/acceptencodingparser.h
editticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
editticket.o: ../core/postmultiparser.h ../core/error.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 ../core/loadavg.h
emacs.o: content.h ../core/item.h ../templates/templates.h
emacs.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../templates/misc.h
emacs.o: ../templates/localefilter.h ../core/locale.h
emacs.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
emacs.o: ../core/httpsimpleparser.h ../core/log.h
emacs.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
emacs.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
emacs.o: ../core/thread.h ../core/error.h ../core/log.h
emacs.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
emacs.o: ../core/request.h ../core/requesttypes.h ../core/session.h
emacs.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
emacs.o: ../core/compress.h ../core/acceptencodingparser.h
emacs.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
emacs.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
emacs.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
emacs.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
emacs.o: ../core/loadavg.h ../core/notify.h
emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h
emacs.o: ../templates/misc.h ../core/misc.h
last.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
last.o: ../templates/patterncacher.h ../templates/misc.h
last.o: ../templates/localefilter.h ../core/locale.h
last.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
last.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
last.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
last.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
last.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
last.o: ../core/ticket.h
login.o: content.h ../core/item.h ../templates/templates.h
login.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../templates/misc.h
login.o: ../templates/localefilter.h ../core/locale.h
login.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
login.o: ../core/httpsimpleparser.h ../core/log.h
login.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
login.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
login.o: ../core/thread.h ../core/error.h ../core/log.h
login.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
login.o: ../core/request.h ../core/requesttypes.h ../core/session.h
login.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
login.o: ../core/compress.h ../core/acceptencodingparser.h
login.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
login.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
login.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
login.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
login.o: ../core/loadavg.h
logout.o: content.h ../core/item.h ../templates/templates.h
logout.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
logout.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
logout.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
logout.o: ../core/httpsimpleparser.h ../core/log.h
logout.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
logout.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
logout.o: ../core/thread.h ../core/error.h ../core/log.h
logout.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
logout.o: ../core/request.h ../core/requesttypes.h ../core/session.h
logout.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
logout.o: ../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/users.h ../core/groups.h ../core/functions.h
logout.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
logout.o: ../core/loadavg.h
ls.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
ls.o: ../templates/patterncacher.h ../templates/misc.h
ls.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h
ls.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
ls.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
ls.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
ls.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
ls.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
ls.o: ../core/request.h ../core/requesttypes.h ../core/session.h
ls.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
ls.o: ../core/compress.h ../core/acceptencodingparser.h
ls.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
ls.o: ../core/postmultiparser.h
misc_item.o: content.h ../core/item.h ../templates/templates.h
misc_item.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
misc_item.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
misc_item.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
misc_item.o: ../core/httpsimpleparser.h ../core/log.h
misc_item.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
misc_item.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
misc_item.o: ../core/thread.h ../core/error.h ../core/log.h
misc_item.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
misc_item.o: ../core/request.h ../core/requesttypes.h ../core/session.h
misc_item.o: ../core/rebus.h ../core/plugindata.h ../core/function.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/misc.h
misc_specialfile.o: content.h ../core/item.h ../templates/templates.h
misc_specialfile.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
misc_specialfile.o: ../templates/misc.h ../templates/localefilter.h
misc_specialfile.o: ../core/locale.h ../confparser/confparser.h
misc_specialfile.o: ../templates/ckeditorgetparser.h
misc_specialfile.o: ../core/httpsimpleparser.h ../core/log.h
misc_specialfile.o: ../templates/indexpatterns.h ../core/thread.h
misc_specialfile.o: ../core/ticket.h ../core/db.h ../core/item.h
misc_specialfile.o: ../core/user.h ../core/group.h ../core/thread.h
misc_specialfile.o: ../core/error.h ../core/log.h ../core/dircontainer.h
misc_specialfile.o: ../core/ugcontainer.h ../core/ticket.h ../core/request.h
misc_specialfile.o: ../core/requesttypes.h ../core/session.h ../core/rebus.h
misc_specialfile.o: ../core/plugindata.h ../core/function.h
misc_specialfile.o: ../core/compress.h ../core/acceptencodingparser.h
misc_specialfile.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
misc_specialfile.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
misc_specialfile.o: ../core/users.h ../core/groups.h ../core/functions.h
misc_specialfile.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
misc_specialfile.o: ../core/loadavg.h
mkdir.o: content.h ../core/item.h ../templates/templates.h
mkdir.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../templates/misc.h
mkdir.o: ../templates/localefilter.h ../core/locale.h
mkdir.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
mkdir.o: ../core/httpsimpleparser.h ../core/log.h
mkdir.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
mkdir.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
mkdir.o: ../core/thread.h ../core/error.h ../core/log.h
mkdir.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
mkdir.o: ../core/request.h ../core/requesttypes.h ../core/session.h
mkdir.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
mkdir.o: ../core/compress.h ../core/acceptencodingparser.h
mkdir.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
mkdir.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
mkdir.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
mkdir.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
mkdir.o: ../core/loadavg.h ../core/notify.h
mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
mkdir.o: ../templates/misc.h
mv.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
mv.o: ../templates/patterncacher.h ../templates/misc.h
mv.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h
mv.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
mv.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
mv.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
mv.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
mv.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
mv.o: ../core/request.h ../core/requesttypes.h ../core/session.h
mv.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
mv.o: ../core/compress.h ../core/acceptencodingparser.h
mv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
mv.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h ../core/users.h
mv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
mv.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h
node.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
node.o: ../templates/patterncacher.h ../templates/misc.h
node.o: ../templates/localefilter.h ../core/locale.h
node.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
node.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
node.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
node.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
node.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
node.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
node.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
node.o: ../core/function.h ../core/compress.h ../core/acceptencodingparser.h
node.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
node.o: ../core/postmultiparser.h
priv.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
priv.o: ../templates/patterncacher.h ../templates/misc.h
priv.o: ../templates/localefilter.h ../core/locale.h
priv.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
priv.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
priv.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
priv.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
priv.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
priv.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
priv.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
priv.o: ../core/function.h ../core/compress.h ../core/acceptencodingparser.h
priv.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
priv.o: ../core/postmultiparser.h ../core/error.h ../core/data.h
priv.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
priv.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
priv.o: ../core/loadavg.h
reload.o: content.h ../core/item.h ../templates/templates.h
reload.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
reload.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
reload.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
reload.o: ../core/httpsimpleparser.h ../core/log.h
reload.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
reload.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
reload.o: ../core/thread.h ../core/error.h ../core/log.h
reload.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
reload.o: ../core/request.h ../core/requesttypes.h ../core/session.h
reload.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
reload.o: ../core/compress.h ../core/acceptencodingparser.h
reload.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
reload.o: ../core/postmultiparser.h ../core/error.h ../core/notify.h
reload.o: ../templatesnotify/templatesnotify.h ../core/mount.h
reload.o: ../templates/misc.h
rm.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
rm.o: ../templates/patterncacher.h ../templates/misc.h
rm.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h
rm.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
rm.o: ../core/log.h ../templates/indexpatterns.h ../core/thread.h
rm.o: ../core/ticket.h ../core/db.h ../core/item.h ../core/user.h
rm.o: ../core/group.h ../core/thread.h ../core/error.h ../core/log.h
rm.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
rm.o: ../core/request.h ../core/requesttypes.h ../core/session.h
rm.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
rm.o: ../core/compress.h ../core/acceptencodingparser.h
rm.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
rm.o: ../core/postmultiparser.h ../core/error.h ../core/data.h ../core/dirs.h
rm.o: ../core/users.h ../core/groups.h ../core/functions.h
rm.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
rm.o: ../core/loadavg.h ../core/plugin.h ../core/request.h ../core/data.h
rm.o: ../core/pluginmsg.h
run.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
run.o: ../templates/patterncacher.h ../templates/misc.h
run.o: ../templates/localefilter.h ../core/locale.h
run.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
run.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
run.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
run.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
run.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
run.o: ../core/ticket.h ../core/request.h ../core/requesttypes.h
run.o: ../core/session.h ../core/rebus.h ../core/plugindata.h
run.o: ../core/function.h ../core/compress.h ../core/acceptencodingparser.h
run.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
run.o: ../core/postmultiparser.h ../core/error.h
subject.o: content.h ../core/item.h ../templates/templates.h
subject.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
subject.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
subject.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
subject.o: ../core/httpsimpleparser.h ../core/log.h
subject.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
subject.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
subject.o: ../core/thread.h ../core/error.h ../core/log.h
subject.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
subject.o: ../core/request.h ../core/requesttypes.h ../core/session.h
subject.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
subject.o: ../core/compress.h ../core/acceptencodingparser.h
subject.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
subject.o: ../core/postmultiparser.h
thread.o: content.h ../core/item.h ../templates/templates.h
thread.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
thread.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
thread.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
thread.o: ../core/httpsimpleparser.h ../core/log.h
thread.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
thread.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
thread.o: ../core/thread.h ../core/error.h ../core/log.h
thread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
thread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
thread.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
thread.o: ../core/compress.h ../core/acceptencodingparser.h
thread.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
thread.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
thread.o: ../core/users.h ../core/groups.h ../core/functions.h
thread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
thread.o: ../core/loadavg.h ../core/mount.h
ticket.o: content.h ../core/item.h ../templates/templates.h
ticket.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
ticket.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
ticket.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
ticket.o: ../core/httpsimpleparser.h ../core/log.h
ticket.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
ticket.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
ticket.o: ../core/thread.h ../core/error.h ../core/log.h
ticket.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
ticket.o: ../core/request.h ../core/requesttypes.h ../core/session.h
ticket.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
ticket.o: ../core/compress.h ../core/acceptencodingparser.h
ticket.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
ticket.o: ../core/postmultiparser.h ../core/data.h ../core/dirs.h
ticket.o: ../core/users.h ../core/groups.h ../core/functions.h
ticket.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
ticket.o: ../core/loadavg.h ../core/mount.h
uname.o: content.h ../core/item.h ../templates/templates.h
uname.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../templates/misc.h
uname.o: ../templates/localefilter.h ../core/locale.h
uname.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
uname.o: ../core/httpsimpleparser.h ../core/log.h
uname.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
uname.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
uname.o: ../core/thread.h ../core/error.h ../core/log.h
uname.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
upload.o: content.h ../core/item.h ../templates/templates.h
upload.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
upload.o: ../templates/misc.h ../templates/localefilter.h ../core/locale.h
upload.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
upload.o: ../core/httpsimpleparser.h ../core/log.h
upload.o: ../templates/indexpatterns.h ../core/thread.h ../core/ticket.h
upload.o: ../core/db.h ../core/item.h ../core/user.h ../core/group.h
upload.o: ../core/thread.h ../core/error.h ../core/log.h
upload.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/ticket.h
upload.o: ../core/request.h ../core/requesttypes.h ../core/session.h
upload.o: ../core/rebus.h ../core/plugindata.h ../core/function.h
upload.o: ../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/users.h ../core/groups.h ../core/functions.h
upload.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
upload.o: ../core/loadavg.h ../core/misc.h
who.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
who.o: ../templates/patterncacher.h ../templates/misc.h
who.o: ../templates/localefilter.h ../core/locale.h
who.o: ../confparser/confparser.h ../templates/ckeditorgetparser.h
who.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
who.o: ../core/thread.h ../core/ticket.h ../core/db.h ../core/item.h
who.o: ../core/user.h ../core/group.h ../core/thread.h ../core/error.h
who.o: ../core/log.h ../core/dircontainer.h ../core/ugcontainer.h
who.o: ../core/ticket.h

@ -1 +0,0 @@
o = adduser.o cat.o content.o cp.o createthread.o createticket.o default.o download.o editticket.o emacs.o last.o login.o logout.o ls.o misc_item.o misc_specialfile.o mkdir.o mv.o node.o priv.o reload.o rm.o run.o subject.o thread.o ticket.o uname.o upload.o who.o

@ -1,111 +0,0 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "content.h"
#include "../core/request.h"
#include "../core/data.h"
#include "../core/db.h"
bool Content::CheckAddUserVars(const std::string * login, const std::string * pass, const std::string * conf_pass)
{
if( !login || !pass || !conf_pass )
{
request.status = WINIX_ERR_PERMISSION_DENIED;
return false;
}
if( login->empty() )
{
request.status = WINIX_ERR_LOGIN_EMPTY;
return false;
}
if( *pass != *conf_pass )
{
request.status = WINIX_ERR_PASSWORDS_DIFFERENT;
return false;
}
if( pass->size() < 5 )
{
request.status = WINIX_ERR_PASSWORD_TOO_SHORT;
return false;
}
if( data.users.IsUser(*login) )
{
request.status = WINIX_ERR_USER_EXISTS;
return false;
}
return true;
}
void Content::PostFunAddUser()
{
User user;
std::string * login = request.PostVar("login");
std::string * pass = request.PostVar("password");
std::string * conf_pass = request.PostVar("confirmpassword");
std::string * email = request.PostVar("email");
if( !CheckAddUserVars(login, pass, conf_pass) )
return;
user.name = *login;
if( email )
user.email = *email;
request.status = db.AddUser(user, *pass);
if( request.status == WINIX_ERR_OK )
{
if( data.users.AddUser(user) )
{
if( !request.session->puser )
LoginUser(user.id, false);
log << log2 << "Content: added a new user: " << user.name << logend;
}
else
{
log << log1 << "Content: I can't add to data.users: " << user.name
<< " but the user was added to the db correctly" << logend;
}
if( request.is_item )
RedirectTo(request.item);
else
RedirectToLastDir();
}
}
void Content::FunAddUser()
{
}

@ -1,37 +0,0 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "content.h"
#include "../core/request.h"
#include "../core/error.h"
#include "../core/data.h"
void Content::FunCat()
{
if( !request.is_item )
{
log << log1 << "Content: cat function requires an item" << logend;
request.status = WINIX_ERR_NO_ITEM;
return;
}
if( !request.HasReadAccess(request.item) )
{
request.status = WINIX_ERR_PERMISSION_DENIED;
return;
}
request.send_as_attachment = request.IsParam("attachment");
}

@ -1,580 +0,0 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#include "content.h"
#include "../core/request.h"
#include "../core/error.h"
#include "../core/db.h"
#include "../core/data.h"
#include "../core/misc.h"
#include "../core/plugin.h"
bool Content::Init()
{
templates.ReadIndexFileNames();
templates.ReadTemplates();
templates.CreateFunctions();
return true;
}
bool Content::DirsHaveReadExecPerm()
{
std::vector<Item*>::iterator i;
for(i = request.dir_table.begin() ; i!=request.dir_table.end() ; ++i)
{
if( !request.HasReadExecAccess(**i) )
return false;
}
return true;
}
void Content::SetDefaultFunctionForFile()
{
if( request.item.auth != Item::auth_none )
request.pfunction = data.functions.GetFunction(FUN_DOWNLOAD);
else
if( request.HasReadExecAccess(request.item) )
request.pfunction = data.functions.GetFunction(FUN_RUN);
else
request.pfunction = data.functions.GetFunction(FUN_CAT);
if( request.pfunction )
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
}
void Content::SetDefaultFunctionForDir()
{
long default_item = request.dir_table.back()->default_item;
if( default_item != -1 )
{
log << log3 << "Content: Default item: id: " << default_item << logend;
RedirectTo(default_item);
return;
}
if( data.mounts.pmount->type == Mount::thread )
{
request.pfunction = data.functions.GetFunction(FUN_THREAD);
if( request.pfunction )
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);
if( request.pfunction )
log << log3 << "Content: default function: " << request.pfunction->item.url << logend;
}
}
void Content::SetDefaultFunction()
{
if( request.is_item )
{
SetDefaultFunctionForFile();
}
else
{
SetDefaultFunctionForDir();
}
}
void Content::FunNothing()
{
/* do nothing */
}
void Content::CallFunction()
{
static FunItem tab[] = {
{FUN_LOGOUT, &Content::FunLogout},
{FUN_CAT, &Content::FunCat},
{FUN_LS, &Content::FunLs},
{FUN_EMACS, &Content::FunEmacs},
{FUN_MKDIR, &Content::FunMkdir},
{FUN_DEFAULT, &Content::FunDefault},
{FUN_PRIV, &Content::FunPriv},
{FUN_RM, &Content::FunRm},
{FUN_RUN, &Content::FunRun},
{FUN_NODE, &Content::FunNode},
{FUN_WHO, &Content::FunWho},
{FUN_LAST, &Content::FunLast},
{FUN_THREAD, &Content::FunThread},
{FUN_RELOAD, &Content::FunReload},
{FUN_UPLOAD, &Content::FunUpload},
{FUN_TICKET, &Content::FunTicket},
{FUN_CKEDITOR, &Content::FunEmacs},
{FUN_TINYMCE, &Content::FunEmacs},
{FUN_LOGIN, &Content::FunLogin},
{FUN_MV, &Content::FunMv},
{FUN_UNAME, &Content::FunUname},
{FUN_CHMOD, &Content::FunPriv},
{FUN_CHOWN, &Content::FunPriv},
{FUN_DOWNLOAD, &Content::FunDownload},
{FUN_ADDUSER, &Content::FunAddUser},
{FUN_SUBJECT, &Content::FunSubject},
{FUN_CP, &Content::FunCp},
{FUN_UPTIME, &Content::FunNothing},
{FUN_EDITTICKET,&Content::FunEditTicket},
{FUN_CREATETHREAD, &Content::FunCreateThread},
{FUN_CREATETICKET, &Content::FunCreateTicket}
};
size_t len = sizeof(tab) / sizeof(FunItem);
size_t i;
for(i=0 ; i<len ; ++i)
{
if( tab[i].code == request.pfunction->code )
{
(this->*tab[i].fun)();
return;
}
}
request.status = WINIX_ERR_PERMISSION_DENIED;
}
void Content::MakeStandardFunction()
{
if( request.role == Request::authorizer )
{
// in authorizer mode only cat function is available
// (and must be default)
if( request.pfunction )
{
request.status = WINIX_ERR_NO_ITEM;
log << log1 << "Content: in authorizer mode only 'cat' funtion is available and must "
"be default (not in the url)" << logend;
return;
}
request.pfunction = data.functions.GetFunction(FUN_CAT);
}
if( !request.pfunction )
SetDefaultFunction();
if( !request.redirect_to.empty() )
return;
if( !request.pfunction )
{
request.status = WINIX_ERR_NO_FUNCTION;
log << log1 << "Content: no function (neither cat nor ls)" << logend;
return;
}
CallFunction();
}
void Content::CallPostFunction()
{
static FunItem tab[] = {
{FUN_RUN, &Content::PostFunRun},
{FUN_EMACS, &Content::PostFunEmacs},
{FUN_MKDIR, &Content::PostFunMkdir},
{FUN_DEFAULT, &Content::PostFunDefault},
{FUN_PRIV, &Content::PostFunPriv},
{FUN_CHMOD, &Content::PostFunPriv},
{FUN_CHOWN, &Content::PostFunPriv},
{FUN_LOGIN, &Content::PostFunLogin},
{FUN_UPLOAD, &Content::PostFunUpload},
{FUN_EDITTICKET,&Content::PostFunEditTicket},
{FUN_CKEDITOR, &Content::PostFunEmacs},
{FUN_TINYMCE, &Content::PostFunEmacs},
{FUN_ADDUSER, &Content::PostFunAddUser},
{FUN_MV, &Content::PostFunMv},
{FUN_SUBJECT, &Content::PostFunSubject},
{FUN_CP, &Content::PostFunCp},
{FUN_CREATETHREAD, &Content::PostFunCreateThread},
{FUN_CREATETICKET, &Content::PostFunCreateTicket}
};
size_t len = sizeof(tab) / sizeof(FunItem);
size_t i;
for(i=0 ; i<len ; ++i)
{
if( tab[i].code == request.pfunction->code )
{
(this->*tab[i].fun)();
return;
}
}
log << log1 << "Content: unknown post function" << logend;
request.status = WINIX_ERR_PERMISSION_DENIED;
}
void Content::MakePost()
{
if( request.role == Request::authorizer )
{
request.status = WINIX_ERR_PERMISSION_DENIED;
return;
}
if( !request.pfunction )
SetDefaultFunction();
if( !request.pfunction )
{
request.status = WINIX_ERR_NO_FUNCTION;
log << log1 << "Content: MakePost: no function" << logend;
return;
}
CallPostFunction();
}
void Content::MakePage()
{
bool sent = false;
if( !request.redirect_to.empty() ||
!request.x_sendfile.empty() )
return;
if( request.is_item && request.item.auth == Item::auth_none &&
request.item.content_type == Item::ct_raw && request.status == WINIX_ERR_OK && request.pfunction )
{
if( request.pfunction->code == FUN_CAT )
{
request.page << request.item.content;
sent = true;
}
else
if( request.pfunction->code == FUN_RUN )
{
templates.GenerateRunRaw();
sent = true;
}
}
if( !sent )
{
templates.Generate();
}
}
void Content::Make()
{
if( request.dir_table.empty() )
{
log << log1 << "Content: there is no a root dir (dir_table is empty)" << logend;
return;
}
// request.status can be changed by function_parser
if( request.status == WINIX_ERR_OK )
{
if( DirsHaveReadExecPerm() )
{
if( request.method == Request::post )
MakePost();
if( request.redirect_to.empty() && request.status == WINIX_ERR_OK )
MakeStandardFunction();
}
else
request.status = WINIX_ERR_PERMISSION_DENIED;
}
if( request.session->spam_score > 0 )
log << log1 << "Content: spam score: " << request.session->spam_score << logend;
if( request.IsParam("noredirect") )
request.redirect_to.clear();
if( !request.redirect_to.empty() )
return;
if( request.dir_table.empty() )
{
log << log1 << "Content: there is no a root dir (dir_table is empty -- after calling some standard functions)" << logend;
return;
}
plugin.Call(WINIX_CONTENT_MAKE);
MakePage();
// !! dodac parametr do konfiga wlaczajacy te informacje
//request.PrintGetTable();
//request.PrintEnv();
//request.PrintIn();
}
// !! mozna zrobic jakas obsluge kiedy nie mozemy sie redirectnac, np gdy wystapil blad
// !! moze zwracac jakas wartosc?
void Content::RedirectTo(const Item & item, const char * postfix)
{
std::string path;
request.redirect_to = data.base_url;
if( item.type == Item::dir )
{
// item_id is pointing to a directory
data.dirs.MakePath(item.id, path);
request.redirect_to += path;
}
else
{
if( !data.dirs.MakePath(item.parent_id, path) )
log << log1 << "Content: Can't redirect: no dirs for item id: " << item.id << logend;
request.redirect_to += path;
request.redirect_to += item.url;
}
if( postfix )
request.redirect_to += postfix;
}
void Content::RedirectTo(long item_id, const char * postfix)
{
std::string path;
Item * pdir;
request.redirect_to = data.base_url;
pdir = data.dirs.GetDir(item_id);
if( pdir )
{
// item_id is pointing to a directory
data.dirs.MakePath(pdir->id, path);
request.redirect_to += path;
}
else
{
// !! zrobic nowy interfejs
// !! GetItem pozamieniac na GetFile
db.GetItem(request.item_table, item_id);
if( !request.item_table.empty() )
{
if( !data.dirs.MakePath(request.item_table[0].parent_id, path) )
log << log1 << "Content: Can't redirect: no dirs for item id: " << request.item_table[0].id << ", requested directory id: " << request.item_table[0].parent_id << logend;
request.redirect_to += path + request.item_table[0].url;
}
else
{
log << log1 << "Content: Can't redirect: no such item: id: " << item_id << logend;
}
}
if( postfix )
request.redirect_to += postfix;
}
void Content::RedirectToLastDir()
{
RedirectTo( *request.dir_table.back() );
}
void Content::ReadAdditionalInfo()
{
if( request.dir_table.empty() )
return;
if( data.mounts.pmount->type == Mount::thread )
{
if( db.GetThreadByDirId(request.dir_table.back()->id, request.thread) == WINIX_ERR_OK )
request.is_thread = true;
}
else
if( data.mounts.pmount->type == Mount::ticket )
{
if( db.GetTicketByDirId(request.dir_table.back()->id, request.ticket) == WINIX_ERR_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
}
}
}
}
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 CorrectUrlOnlyAllowedChar()
CorrectUrlOnlyAllowedChar(item.url);
if( data.functions.GetFunction(item.url) )
{
// the name provided by an user is the same as a name of a function
// we add one underscore character at the beginning
// names of functions should not begin with an underscore '_'
// and we can simply add one '_' at the beginning
// and the name will be unique
item.url.insert(item.url.begin(), '_');
}
}
bool Content::CheckRebus()
{
if( request.session->puser )
// logged user don't have to use the rebus
return true;
if( request.session->rebus_checked )
return true;
request.session->rebus_checked = true;
if( !request.session->rebus_item )
{
log << log1 << "Content: rebus not set" << logend;
return false;
}
try
{
std::string * answer = request.PostVar("rebus");
if( answer && data.rebus.IsAnswerOk(request.session->rebus_item, *answer) )
return true;
}
catch(const Error &)
{
}
log << log1 << "Content: rebus has an incorrect answer" << logend;
// don't add request.session->spam_score when the rebus has incorrect answer
// a user could have made a mistake
return false;
}
void Content::SetUser(Item & item)
{
if( request.session->puser )
{
item.user_id = request.session->puser->id;
item.guest_name.clear();
}
else
{
item.user_id = -1;
request.PostVar("guestname", item.guest_name);
}
item.group_id = request.dir_table.back()->group_id;
}
void Content::CheckGetPostTimes(time_t difference)
{
time_t now = std::time(0);
if( request.session->puser )
return;
if( request.method != Request::post )
return;
if( now - request.session->last_time_get >= (time_t)difference )
return;
if( request.AllPostVarEmpty() )
return;
request.session->spam_score += 1;
log << log1 << "Content: spam +1: POST after GET sent too fast" << logend;
}
/*
bool Content::CreateFile(const std::string & path, const std::string & content)
{
std::ofstream file(path.c_str(), std::ios_base::binary | std::ios_base::out);
if( !file )
{
log << log1 << "Content: can't create file: " << path << logend;
return false;
}
file << content;
file.close();
// !! dodac sprawdzenie prawidlowosci zapisania pliku
return true;
}
*/

@ -1,295 +0,0 @@
/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucontentcontent
#define headerfilecmslucontentcontent
#include <cstdlib>
#include <fcgiapp.h>
#include <ctime>
#include "../core/item.h"
#include "../templates/templates.h"
#include "../core/thread.h"
#include "../core/ticket.h"
#include "../core/db.h"
class Content
{
Templates templates;
std::string temp;
void FunDownload();
void CheckSpecialFile();
void PrepareUrl(Item & item);
bool CheckAddUserVars(const std::string * login, const std::string * pass, const std::string * conf_pass);
void PostFunAddUser();
void FunAddUser();
/*
mv
*/
bool MoveIsTheSameFile(const Item & item);
void MoveAuth(Item & item);
void MoveFile(Item & item, bool redirect = true);
void MoveDir(Item & item, bool redirect = true);
void MoveAuthPrepareQuery();
void MoveAuthContentOfDir(const Item & item);
bool MoveParseDir(long & dir_id, std::string & dir, std::string & file);
bool MoveCheckAccessFromToDir();
bool MoveCheckAccessFrom();
bool MoveCheckAccessTo(long dir_id);
bool MoveCheckMountPoints(long dir_id);
void MoveContentOfDir();
void PostFunMv();
void FunMv();
std::string mv_dir;
std::string mv_file;
std::string mv_new_path;
long mv_dir_id;
std::vector<Item> mv_auth;
Db::ItemQuery mv_auth_iq;
/*
cp
*/
bool CpCheckAccessFrom();
void CpAuth(Item & item);
void CpSetNewAttributes(Item & item);
void CpItem(Item & item, long dst_dir_id);
void CpFilesInDir(const Item & dir, long dst_dir_id);
void CpContentOfDir(const Item & item, long dst_dir_id);
long CpDir(const Item & item, long dst_dir_id);
void CpItemCheck(Item & item, bool redirect = true);
void CpContentOfDirCheck(const Item & item, bool redirect = true);
void CpDirCheck(const Item & item, bool redirect = true);
void PostFunCp();
void FunCp();
void CpPrepare();
Item cp_temp;
Db::ItemQuery cp_iq;
bool cp_remove_defaults;
bool cp_preserve_attr;
long cp_new_user;
long cp_new_group;
void SetDefaultFunctionForFile();
void SetDefaultFunctionForDir();
void SetDefaultFunction();
bool DirsHaveReadExecPerm();
/*
calling functions (standard, post)
*/
typedef void (Content::*Fun)();
struct FunItem
{
int code;
Fun fun;
};
void FunNothing();
void CallFunction();
void MakeStandardFunction();
void CallPostFunction();
void MakePost();
void SetUser(Item & item);
bool CheckRebus();
void FunCat();
void FunLogout();
void FunLs();
void FunEmacs();
void AddPathToAuth(std::string & path);
void FunCKEditor();
void FunUname();
bool SubjectCheckAccess();
void EditDirSubject();