Compare commits
144 Commits
0.5.4
...
337f563bd4
| Author | SHA1 | Date | |
|---|---|---|---|
| 337f563bd4 | |||
| c9fe09ebe3 | |||
| db1c63a350 | |||
| 7cc2dcd1fc | |||
| bcde392ce3 | |||
| 8d046f6280 | |||
| 9a6696699f | |||
| 56f2eec597 | |||
| d29b33532d | |||
| a16e82bf54 | |||
| 46c17cc441 | |||
| 2099092e16 | |||
| 88b7517337 | |||
| 619236329c | |||
| 76160a5ba6 | |||
| e95f32231a | |||
| be81307faa | |||
| 177e58da4e | |||
| 4c2efc08fd | |||
| ae03922491 | |||
| ab005118ba | |||
| eec8635af4 | |||
| 5060997d2a | |||
| 0ac5a21a14 | |||
| def0f8d144 | |||
| 8895f0dcac | |||
| 4f8db81c85 | |||
| aa388e248d | |||
| e5d7403c54 | |||
| 4f57d6134c | |||
| 03f6b54a5b | |||
| 63ef007ca1 | |||
| 603e0679e7 | |||
| b90445de4a | |||
| 491dd27ebf | |||
| 89d303f375 | |||
| a2ffc1e81c | |||
| a7c47140ae | |||
| ebd7f85fdb | |||
| 833c04776f | |||
| 919c2f62f5 | |||
| 8f6004d444 | |||
| 1b8f5dc673 | |||
| 027a8ec428 | |||
| d1e7765e98 | |||
| 2d1b2e6b6e | |||
| 350fc551e5 | |||
| 1c05c31721 | |||
| 08123fe6ac | |||
| 35b93b1655 | |||
| 436a198c36 | |||
| aa58faf145 | |||
| dcc6d35cba | |||
| 3f29cdc01e | |||
| ba7d55b7c1 | |||
| 6252a0e732 | |||
| ca14b1a427 | |||
| b01db89942 | |||
| fd421c54e3 | |||
| 55992b5066 | |||
| a5dfc9974f | |||
| 7b4a17c934 | |||
| c2a1097dd5 | |||
| ccf78dcb02 | |||
| 3eff400d88 | |||
| 5ab816b5be | |||
| e57840faed | |||
| 240bf4dc5d | |||
| abd1500f07 | |||
| 42144bb31c | |||
| 7ed41a03ae | |||
| 1286ceeddf | |||
| 145efe937c | |||
| ed5adb3f23 | |||
| 7d0508961e | |||
| e53e2e6af9 | |||
| 4fafd2a478 | |||
| f15da4d049 | |||
| 057607f9e5 | |||
| c433b3fd41 | |||
| 632b49ab90 | |||
| f54df8d600 | |||
| d8451ceaa0 | |||
| 62f178c2ee | |||
| eb4e7343e7 | |||
| 5274e8e8ff | |||
| ae2a885d6c | |||
| 901663b145 | |||
| dc301d4c50 | |||
| 34f0535a26 | |||
| af0e2a778d | |||
| 904f1e70f2 | |||
| ddf7ef30ad | |||
| 0a43870e76 | |||
| f875bd2944 | |||
| c9bf20201b | |||
| 76314aab10 | |||
| 3547d326b8 | |||
| 0ecb2ac70e | |||
| 8f8defe0de | |||
| db5572e864 | |||
| 1100cf75d7 | |||
| 4fda06b547 | |||
| fb18b2238e | |||
| 5266a7e4e5 | |||
| 8196fb77d1 | |||
| 4abf6642f7 | |||
| e3284dcfbc | |||
| f064ff6b3d | |||
| bfa5d8cc05 | |||
| 6614919c13 | |||
| 8379acdb7f | |||
| 160ddc258d | |||
| 01892d2766 | |||
| 222955a2e7 | |||
| 37b22c3559 | |||
| afbd522362 | |||
| a4bed3ab14 | |||
| 7468e7a36c | |||
| 145445c713 | |||
| 7fa9314c6b | |||
| 5d37b6c6ae | |||
| fe1f84e29d | |||
| 83e27a6653 | |||
| ee9c68b04e | |||
| c04874397b | |||
| 375604edd6 | |||
| 3e32f3784f | |||
| 5c4a54d998 | |||
| 3af3ac3f6f | |||
| d801f53154 | |||
| a6b06f82e9 | |||
| b7f3f84080 | |||
| 26715bdd4c | |||
| 083fa7857f | |||
| 9ffda3e070 | |||
| 81160dbbe9 | |||
| 7c266b85e2 | |||
| 48cdca7549 | |||
| 1c401eae3b | |||
| 0e9eb30b5d | |||
| c10c9393c0 | |||
| 8705b3437c | |||
| aed891764a |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.cproject
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
winixd/winix
|
||||||
128
Makefile
128
Makefile
@@ -1,128 +0,0 @@
|
|||||||
# Makefile for GNU make
|
|
||||||
|
|
||||||
|
|
||||||
ifndef CXX
|
|
||||||
CXX = g++
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef CXXFLAGS
|
|
||||||
CXXFLAGS = -fPIC -Wall -O2 -pthread -I/usr/local/include -I/home/tomek/roboczy/prog/winix -I/home/tomek/roboczy/prog/ezc/src -I/home/tomek/roboczy/prog/tito/src -I/home/tomek/roboczy/prog/pikotools -DEZC_USE_WINIX_LOGGER -DEZC_HAS_SPECIAL_STREAM
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef LDFLAGS
|
|
||||||
LDFLAGS = -L/usr/local/lib
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
export CXX
|
|
||||||
export CXXFLAGS
|
|
||||||
export LDFLAGS
|
|
||||||
|
|
||||||
|
|
||||||
all: winix.so plugins winix
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
winix.so: FORCE
|
|
||||||
@cd core ; $(MAKE) -e
|
|
||||||
@cd db ; $(MAKE) -e
|
|
||||||
@cd functions ; $(MAKE) -e
|
|
||||||
@cd notify ; $(MAKE) -e
|
|
||||||
@cd templates ; $(MAKE) -e
|
|
||||||
@cd ../ezc/src ; $(MAKE) -e
|
|
||||||
@cd ../tito/src ; $(MAKE) -e
|
|
||||||
@cd ../pikotools ; $(MAKE) -e
|
|
||||||
$(CXX) -shared -rdynamic -Wl,-whole-archive -o winix.so $(CXXFLAGS) core/*.o db/*.o functions/*.o templates/*.o notify/*.o ../ezc/src/ezc.a ../tito/src/tito.a ../pikotools/utf8/utf8.a ../pikotools/space/space.a ../pikotools/mainparser/mainparser.a ../pikotools/date/date.a $(LDFLAGS) -lfcgi -lpq -lz -lfetch -lpthread -Wl,-no-whole-archive
|
|
||||||
|
|
||||||
|
|
||||||
winix: winix.so FORCE
|
|
||||||
@cd main ; $(MAKE) -e
|
|
||||||
# use the full path with winix.so
|
|
||||||
$(CXX) -o winix $(CXXFLAGS) $(LDFLAGS) main/*.o /home/tomek/roboczy/prog/winix/winix.so
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
plugins: FORCE
|
|
||||||
@cd plugins/stats ; $(MAKE) -e
|
|
||||||
@cd plugins/thread ; $(MAKE) -e
|
|
||||||
@cd plugins/ticket ; $(MAKE) -e
|
|
||||||
@cd plugins/gallery ; $(MAKE) -e
|
|
||||||
@cd plugins/group ; $(MAKE) -e
|
|
||||||
@cd plugins/menu ; $(MAKE) -e
|
|
||||||
@cd plugins/export ; $(MAKE) -e
|
|
||||||
|
|
||||||
|
|
||||||
FORCE:
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
@cd core ; $(MAKE) -e clean
|
|
||||||
@cd db ; $(MAKE) -e clean
|
|
||||||
@cd functions ; $(MAKE) -e clean
|
|
||||||
@cd templates ; $(MAKE) -e clean
|
|
||||||
@cd notify ; $(MAKE) -e clean
|
|
||||||
@cd plugins/stats ; $(MAKE) -e clean
|
|
||||||
@cd plugins/thread ; $(MAKE) -e clean
|
|
||||||
@cd plugins/ticket ; $(MAKE) -e clean
|
|
||||||
@cd plugins/gallery ; $(MAKE) -e clean
|
|
||||||
@cd plugins/group ; $(MAKE) -e clean
|
|
||||||
@cd plugins/menu ; $(MAKE) -e clean
|
|
||||||
@cd plugins/export ; $(MAKE) -e clean
|
|
||||||
@cd ../ezc/src ; $(MAKE) -e clean
|
|
||||||
@cd ../tito/src ; $(MAKE) -e clean
|
|
||||||
@cd ../pikotools ; $(MAKE) -e clean
|
|
||||||
@cd main ; $(MAKE) -e clean
|
|
||||||
rm -f winix.so
|
|
||||||
rm -f winix
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
depend:
|
|
||||||
@cd core ; $(MAKE) -e depend
|
|
||||||
@cd db ; $(MAKE) -e depend
|
|
||||||
@cd functions ; $(MAKE) -e depend
|
|
||||||
@cd templates ; $(MAKE) -e depend
|
|
||||||
@cd notify ; $(MAKE) -e depend
|
|
||||||
@cd plugins/stats ; $(MAKE) -e depend
|
|
||||||
@cd plugins/thread ; $(MAKE) -e depend
|
|
||||||
@cd plugins/ticket ; $(MAKE) -e depend
|
|
||||||
@cd plugins/gallery ; $(MAKE) -e depend
|
|
||||||
@cd plugins/group ; $(MAKE) -e depend
|
|
||||||
@cd plugins/menu ; $(MAKE) -e depend
|
|
||||||
@cd plugins/export ; $(MAKE) -e depend
|
|
||||||
@cd ../ezc/src ; $(MAKE) -e depend
|
|
||||||
@cd ../tito/src ; $(MAKE) -e depend
|
|
||||||
@cd ../pikotools ; $(MAKE) -e depend
|
|
||||||
@cd main ; $(MAKE) -e depend
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
install: all
|
|
||||||
# binaries
|
|
||||||
mkdir -p /usr/local/winix/bin
|
|
||||||
cp winix.so /usr/local/winix/bin
|
|
||||||
# use the full path with winix.so (we have to recompile winix with a new path to winix.so)
|
|
||||||
$(CXX) -o /usr/local/winix/bin/winix $(CXXFLAGS) main/*.o /usr/local/winix/bin/winix.so
|
|
||||||
# etc configs
|
|
||||||
mkdir -p /usr/local/winix/etc
|
|
||||||
cp -rf etc/ /usr/local/winix/etc/
|
|
||||||
find /usr/local/winix/etc/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
|
||||||
# html templates
|
|
||||||
mkdir -p /usr/local/winix/html
|
|
||||||
cp -rf html/ /usr/local/winix/html/
|
|
||||||
find /usr/local/winix/html/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
|
||||||
# txt templates
|
|
||||||
mkdir -p /usr/local/winix/txt
|
|
||||||
cp -rf txt/ /usr/local/winix/txt/
|
|
||||||
find /usr/local/winix/txt/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
|
||||||
# locales
|
|
||||||
mkdir -p /usr/local/winix/locale
|
|
||||||
cp -rf locale/ /usr/local/winix/locale/
|
|
||||||
find /usr/local/winix/locale/ -type d -name ".svn" | xargs -I foo rm -fr foo
|
|
||||||
# plugins
|
|
||||||
mkdir -p /usr/local/winix/plugins
|
|
||||||
find plugins/ -name "*.so" | xargs -I foo cp foo /usr/local/winix/plugins/
|
|
||||||
# removed provileges for others
|
|
||||||
find /usr/local/winix -exec chmod o-r,o-x,o-w "{}" "+"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
include Makefile.o.dep
|
|
||||||
|
|
||||||
|
|
||||||
all: $(o)
|
|
||||||
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) -c $(CXXFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
depend:
|
|
||||||
makedepend -Y. -I.. -I../../ezc/src -I../../pikotools -I../../tito/src -f- *.cpp > Makefile.dep
|
|
||||||
echo -n "o = " > Makefile.o.dep
|
|
||||||
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o
|
|
||||||
|
|
||||||
include Makefile.dep
|
|
||||||
@@ -1,886 +0,0 @@
|
|||||||
# DO NOT DELETE
|
|
||||||
|
|
||||||
acceptbaseparser.o: acceptbaseparser.h
|
|
||||||
app.o: app.h config.h ../../pikotools/space/spaceparser.h
|
|
||||||
app.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
app.o: htmlfilter.h system.h job.h basethread.h synchro.h
|
|
||||||
app.o: ../../pikotools/space/space.h dirs.h item.h
|
|
||||||
app.o: ../../pikotools/date/date.h dircontainer.h ../db/db.h ../db/dbbase.h
|
|
||||||
app.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
|
||||||
app.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
app.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
app.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
app.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
app.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
|
||||||
app.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
app.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
|
||||||
app.o: logmanipulators.h slog.h cur.h request.h error.h
|
|
||||||
app.o: ../templates/htmltextstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
app.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
app.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
|
||||||
app.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
app.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
app.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
app.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
app.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
app.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
|
||||||
app.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h mountparser.h
|
|
||||||
app.o: crypt.h run.h users.h groups.h group.h loadavg.h image.h
|
|
||||||
app.o: threadmanager.h timezones.h timezone.h sessionmanager.h
|
|
||||||
app.o: sessioncontainer.h ipbancontainer.h ../functions/functions.h
|
|
||||||
app.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
app.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
app.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
app.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
app.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
app.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
app.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
app.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
app.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
app.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
app.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
app.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
app.o: ../functions/sort.h ../functions/specialdefault.h ../functions/stat.h
|
|
||||||
app.o: ../functions/subject.h ../functions/template.h ../functions/tinymce.h
|
|
||||||
app.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
|
|
||||||
app.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
|
||||||
app.o: ../templates/templates.h ../templates/patterncacher.h
|
|
||||||
app.o: ../templates/indexpatterns.h ../templates/patterns.h
|
|
||||||
app.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
|
||||||
app.o: ../core/sessionmanager.h compress.h postparser.h httpsimpleparser.h
|
|
||||||
app.o: plugin.h pluginmsg.h cookieparser.h postmultiparser.h
|
|
||||||
app.o: acceptencodingparser.h acceptbaseparser.h
|
|
||||||
basethread.o: basethread.h synchro.h
|
|
||||||
bbcodeparser.o: bbcodeparser.h htmlfilter.h
|
|
||||||
compress.o: compress.h requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
compress.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
compress.o: ../../pikotools/convert/convert.h
|
|
||||||
compress.o: ../../pikotools/convert/inttostr.h
|
|
||||||
compress.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
compress.o: ../../pikotools/textstream/types.h log.h textstream.h
|
|
||||||
compress.o: logmanipulators.h slog.h cur.h request.h item.h error.h config.h
|
|
||||||
compress.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
compress.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
compress.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
compress.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
compress.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
compress.o: ../templates/locale.h
|
|
||||||
config.o: config.h ../../pikotools/space/spaceparser.h
|
|
||||||
config.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
config.o: htmlfilter.h log.h textstream.h logmanipulators.h
|
|
||||||
config.o: ../../pikotools/textstream/textstream.h
|
|
||||||
config.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
config.o: ../../pikotools/convert/convert.h
|
|
||||||
config.o: ../../pikotools/convert/inttostr.h
|
|
||||||
config.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
config.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
config.o: requesttypes.h item.h error.h ../templates/htmltextstream.h
|
|
||||||
config.o: ../core/textstream.h misc.h ../../pikotools/utf8/utf8.h
|
|
||||||
config.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
|
||||||
config.o: rebus.h ipban.h mount.h ../templates/locale.h plugin.h pluginmsg.h
|
|
||||||
config.o: system.h job.h basethread.h synchro.h dirs.h dircontainer.h
|
|
||||||
config.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
config.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
|
||||||
config.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
config.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
|
||||||
config.o: ../notify/notifypool.h ../templates/patterns.h
|
|
||||||
config.o: ../templates/locale.h ../templates/localefilter.h
|
|
||||||
config.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
|
||||||
config.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|
||||||
config.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
|
||||||
config.o: ../notify/notifythread.h ../core/basethread.h
|
|
||||||
config.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
|
||||||
config.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
|
||||||
config.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
|
||||||
config.o: timezones.h timezone.h sessionmanager.h sessioncontainer.h
|
|
||||||
config.o: ipbancontainer.h ../functions/functions.h
|
|
||||||
config.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
config.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
config.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
config.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
config.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
config.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
config.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
config.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
config.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
config.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
config.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
config.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
config.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
config.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
|
||||||
config.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
config.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
config.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
config.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
config.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
config.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
crypt.o: crypt.h run.h config.h ../../pikotools/space/spaceparser.h
|
|
||||||
crypt.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
crypt.o: htmlfilter.h user.h ../../pikotools/utf8/utf8.h log.h textstream.h
|
|
||||||
crypt.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
|
||||||
crypt.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
crypt.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
crypt.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
crypt.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
crypt.o: requesttypes.h item.h error.h ../templates/htmltextstream.h
|
|
||||||
crypt.o: ../core/textstream.h misc.h ../../pikotools/space/spacetojson.h
|
|
||||||
crypt.o: session.h plugindata.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
dircontainer.o: dircontainer.h item.h ../../pikotools/space/space.h
|
|
||||||
dircontainer.o: ../../pikotools/date/date.h log.h textstream.h
|
|
||||||
dircontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
|
||||||
dircontainer.o: ../../pikotools/convert/convert.h
|
|
||||||
dircontainer.o: ../../pikotools/convert/inttostr.h
|
|
||||||
dircontainer.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dircontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
dircontainer.o: requesttypes.h error.h config.h
|
|
||||||
dircontainer.o: ../../pikotools/space/spaceparser.h
|
|
||||||
dircontainer.o: ../../pikotools/space/space.h
|
|
||||||
dircontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
dircontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
dircontainer.o: ../../pikotools/utf8/utf8.h
|
|
||||||
dircontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
dircontainer.o: plugindata.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
dirs.o: dirs.h item.h ../../pikotools/space/space.h
|
|
||||||
dirs.o: ../../pikotools/date/date.h dircontainer.h ../db/db.h ../db/dbbase.h
|
|
||||||
dirs.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
|
||||||
dirs.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
dirs.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
dirs.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dirs.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
dirs.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
dirs.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
dirs.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
dirs.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
dirs.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
|
||||||
dirs.o: cur.h request.h error.h config.h htmlfilter.h
|
|
||||||
dirs.o: ../templates/htmltextstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
dirs.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
dirs.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
|
||||||
dirs.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
dirs.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
dirs.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
dirs.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
dirs.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
dirs.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
|
||||||
dirs.o: ../core/users.h ugcontainer.h lastcontainer.h
|
|
||||||
groups.o: groups.h group.h ugcontainer.h ../db/db.h ../db/dbbase.h
|
|
||||||
groups.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
|
||||||
groups.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
groups.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
groups.o: ../../pikotools/convert/convert.h
|
|
||||||
groups.o: ../../pikotools/convert/inttostr.h
|
|
||||||
groups.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
groups.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
groups.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
groups.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
groups.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
groups.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
groups.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
|
||||||
groups.o: cur.h request.h error.h config.h htmlfilter.h
|
|
||||||
groups.o: ../templates/htmltextstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
groups.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
groups.o: ../templates/locale.h
|
|
||||||
htmlfilter.o: htmlfilter.h
|
|
||||||
httpsimpleparser.o: httpsimpleparser.h
|
|
||||||
image.o: image.h basethread.h synchro.h textstream.h ../db/db.h
|
|
||||||
image.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
image.o: ../core/textstream.h misc.h item.h ../../pikotools/space/space.h
|
|
||||||
image.o: ../../pikotools/date/date.h requesttypes.h
|
|
||||||
image.o: ../../pikotools/textstream/textstream.h
|
|
||||||
image.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
image.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
image.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
image.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
image.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
image.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
image.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
image.o: ../core/ugcontainer.h log.h logmanipulators.h slog.h cur.h request.h
|
|
||||||
image.o: error.h config.h htmlfilter.h ../templates/htmltextstream.h
|
|
||||||
image.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
|
||||||
image.o: rebus.h ipban.h mount.h ../templates/locale.h ../core/config.h
|
|
||||||
image.o: system.h job.h dirs.h dircontainer.h ../notify/notify.h
|
|
||||||
image.o: ../notify/notifypool.h ../templates/patterns.h ../templates/locale.h
|
|
||||||
image.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
image.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
image.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
image.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
image.o: ../core/basethread.h ../notify/templatesnotify.h ../core/users.h
|
|
||||||
image.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
|
||||||
image.o: users.h groups.h group.h loadavg.h threadmanager.h timezones.h
|
|
||||||
image.o: timezone.h plugin.h pluginmsg.h sessionmanager.h sessioncontainer.h
|
|
||||||
image.o: ipbancontainer.h ../functions/functions.h
|
|
||||||
image.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
image.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
image.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
image.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
image.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
image.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
image.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
image.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
image.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
image.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
image.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
image.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
image.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
image.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
|
||||||
image.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
image.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
image.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
image.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
image.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
image.o: ../templates/htmltextstream.h ../core/sessionmanager.h lock.h
|
|
||||||
ipbancontainer.o: ipbancontainer.h ipban.h log.h textstream.h
|
|
||||||
ipbancontainer.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
|
||||||
ipbancontainer.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
ipbancontainer.o: ../../pikotools/convert/convert.h
|
|
||||||
ipbancontainer.o: ../../pikotools/convert/inttostr.h
|
|
||||||
ipbancontainer.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
ipbancontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
ipbancontainer.o: requesttypes.h item.h error.h config.h
|
|
||||||
ipbancontainer.o: ../../pikotools/space/spaceparser.h
|
|
||||||
ipbancontainer.o: ../../pikotools/space/space.h
|
|
||||||
ipbancontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
ipbancontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
ipbancontainer.o: ../../pikotools/utf8/utf8.h
|
|
||||||
ipbancontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
ipbancontainer.o: plugindata.h rebus.h mount.h ../templates/locale.h
|
|
||||||
item.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
item.o: misc.h requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
item.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
item.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
item.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
item.o: crypt.h run.h config.h ../../pikotools/space/spaceparser.h
|
|
||||||
item.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
item.o: htmlfilter.h user.h
|
|
||||||
job.o: job.h basethread.h synchro.h ../../pikotools/space/space.h plugin.h
|
|
||||||
job.o: pluginmsg.h log.h textstream.h logmanipulators.h
|
|
||||||
job.o: ../../pikotools/textstream/textstream.h ../../pikotools/date/date.h
|
|
||||||
job.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
job.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
job.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
job.o: requesttypes.h item.h error.h config.h
|
|
||||||
job.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
job.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
job.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
job.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
job.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
job.o: ../templates/locale.h system.h dirs.h dircontainer.h ../db/db.h
|
|
||||||
job.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
|
||||||
job.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
job.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
job.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
|
||||||
job.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
job.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
job.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
job.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
job.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
job.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
|
||||||
job.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h mountparser.h
|
|
||||||
job.o: crypt.h run.h users.h groups.h group.h loadavg.h image.h
|
|
||||||
job.o: threadmanager.h timezones.h timezone.h sessionmanager.h
|
|
||||||
job.o: sessioncontainer.h ipbancontainer.h ../functions/functions.h
|
|
||||||
job.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
job.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
job.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
job.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
job.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
job.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
job.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
job.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
job.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
job.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
job.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
job.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
job.o: ../functions/sort.h ../functions/specialdefault.h ../functions/stat.h
|
|
||||||
job.o: ../functions/subject.h ../functions/template.h ../functions/tinymce.h
|
|
||||||
job.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
|
|
||||||
job.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
|
||||||
job.o: ../templates/templates.h ../templates/patterncacher.h
|
|
||||||
job.o: ../templates/indexpatterns.h ../templates/patterns.h
|
|
||||||
job.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
|
||||||
job.o: ../core/sessionmanager.h
|
|
||||||
lastcontainer.o: lastcontainer.h ../../pikotools/date/date.h log.h
|
|
||||||
lastcontainer.o: textstream.h logmanipulators.h
|
|
||||||
lastcontainer.o: ../../pikotools/textstream/textstream.h
|
|
||||||
lastcontainer.o: ../../pikotools/space/space.h
|
|
||||||
lastcontainer.o: ../../pikotools/convert/convert.h
|
|
||||||
lastcontainer.o: ../../pikotools/convert/inttostr.h
|
|
||||||
lastcontainer.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
lastcontainer.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
lastcontainer.o: requesttypes.h item.h error.h config.h
|
|
||||||
lastcontainer.o: ../../pikotools/space/spaceparser.h
|
|
||||||
lastcontainer.o: ../../pikotools/space/space.h
|
|
||||||
lastcontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
lastcontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
lastcontainer.o: ../../pikotools/utf8/utf8.h
|
|
||||||
lastcontainer.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
lastcontainer.o: plugindata.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
loadavg.o: loadavg.h log.h textstream.h logmanipulators.h
|
|
||||||
loadavg.o: ../../pikotools/textstream/textstream.h
|
|
||||||
loadavg.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
loadavg.o: ../../pikotools/convert/convert.h
|
|
||||||
loadavg.o: ../../pikotools/convert/inttostr.h
|
|
||||||
loadavg.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
loadavg.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
loadavg.o: requesttypes.h item.h error.h config.h
|
|
||||||
loadavg.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
loadavg.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
loadavg.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
loadavg.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
loadavg.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
loadavg.o: ../templates/locale.h
|
|
||||||
lock.o: lock.h synchro.h
|
|
||||||
log.o: log.h textstream.h logmanipulators.h
|
|
||||||
log.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
|
||||||
log.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
|
||||||
log.o: ../../pikotools/convert/inttostr.h
|
|
||||||
log.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
log.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
log.o: requesttypes.h item.h error.h config.h
|
|
||||||
log.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
log.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
log.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
log.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
log.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
log.o: ../templates/locale.h timezones.h timezone.h
|
|
||||||
misc.o: misc.h item.h ../../pikotools/space/space.h
|
|
||||||
misc.o: ../../pikotools/date/date.h requesttypes.h
|
|
||||||
misc.o: ../../pikotools/textstream/textstream.h
|
|
||||||
misc.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
misc.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
misc.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h log.h
|
|
||||||
misc.o: textstream.h logmanipulators.h slog.h cur.h request.h error.h
|
|
||||||
misc.o: config.h ../../pikotools/space/spaceparser.h
|
|
||||||
misc.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
misc.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
|
||||||
misc.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
|
||||||
misc.o: rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
misc.o: ../templates/templates.h ../../ezc/src/ezc.h
|
|
||||||
misc.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
misc.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
misc.o: ../../ezc/src/stringconv.h ../templates/patterncacher.h
|
|
||||||
misc.o: ../core/item.h ../templates/indexpatterns.h ../templates/patterns.h
|
|
||||||
misc.o: ../templates/locale.h ../templates/changepatterns.h
|
|
||||||
misc.o: ../templates/htmltextstream.h ../templates/localefilter.h
|
|
||||||
misc.o: ../core/config.h ../core/cur.h ../core/system.h
|
|
||||||
misc.o: ../core/sessionmanager.h ../core/htmlfilter.h ../db/db.h
|
|
||||||
misc.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
|
||||||
misc.o: ../db/dbitemquery.h ../db/dbitemcolumns.h ../core/user.h
|
|
||||||
misc.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
|
||||||
mount.o: mount.h misc.h item.h ../../pikotools/space/space.h
|
|
||||||
mount.o: ../../pikotools/date/date.h requesttypes.h
|
|
||||||
mount.o: ../../pikotools/textstream/textstream.h
|
|
||||||
mount.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
mount.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
mount.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
mountparser.o: mountparser.h mount.h item.h ../../pikotools/space/space.h
|
|
||||||
mountparser.o: ../../pikotools/date/date.h dirs.h dircontainer.h ../db/db.h
|
|
||||||
mountparser.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
mountparser.o: ../core/textstream.h misc.h requesttypes.h
|
|
||||||
mountparser.o: ../../pikotools/textstream/textstream.h
|
|
||||||
mountparser.o: ../../pikotools/convert/convert.h
|
|
||||||
mountparser.o: ../../pikotools/convert/inttostr.h
|
|
||||||
mountparser.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
mountparser.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
mountparser.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
mountparser.o: ../../pikotools/space/space.h
|
|
||||||
mountparser.o: ../../pikotools/textstream/types.h ../db/dbitemquery.h
|
|
||||||
mountparser.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
|
|
||||||
mountparser.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
|
||||||
mountparser.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
|
||||||
mountparser.o: error.h config.h htmlfilter.h ../templates/htmltextstream.h
|
|
||||||
mountparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
mountparser.o: plugindata.h rebus.h ipban.h ../templates/locale.h
|
|
||||||
mountparser.o: ../notify/notify.h ../notify/notifypool.h
|
|
||||||
mountparser.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
mountparser.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
mountparser.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
mountparser.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
mountparser.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
mountparser.o: ../core/basethread.h ../notify/templatesnotify.h
|
|
||||||
mountparser.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
|
||||||
mounts.o: mounts.h mount.h error.h dirs.h item.h
|
|
||||||
mounts.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
mounts.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
|
||||||
mounts.o: ../db/dbtextstream.h ../core/textstream.h misc.h requesttypes.h
|
|
||||||
mounts.o: ../../pikotools/textstream/textstream.h
|
|
||||||
mounts.o: ../../pikotools/convert/convert.h
|
|
||||||
mounts.o: ../../pikotools/convert/inttostr.h
|
|
||||||
mounts.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
mounts.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
mounts.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
mounts.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
mounts.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
mounts.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
mounts.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
|
||||||
mounts.o: cur.h request.h config.h htmlfilter.h ../templates/htmltextstream.h
|
|
||||||
mounts.o: ../../pikotools/space/spacetojson.h session.h user.h plugindata.h
|
|
||||||
mounts.o: rebus.h ipban.h ../templates/locale.h ../notify/notify.h
|
|
||||||
mounts.o: ../notify/notifypool.h ../templates/patterns.h
|
|
||||||
mounts.o: ../templates/locale.h ../templates/localefilter.h
|
|
||||||
mounts.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
|
||||||
mounts.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|
||||||
mounts.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
|
||||||
mounts.o: ../notify/notifythread.h ../core/basethread.h
|
|
||||||
mounts.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
|
||||||
mounts.o: ugcontainer.h lastcontainer.h mountparser.h plugin.h pluginmsg.h
|
|
||||||
mounts.o: system.h job.h basethread.h synchro.h crypt.h run.h users.h
|
|
||||||
mounts.o: groups.h group.h loadavg.h image.h threadmanager.h timezones.h
|
|
||||||
mounts.o: timezone.h sessionmanager.h sessioncontainer.h ipbancontainer.h
|
|
||||||
mounts.o: ../functions/functions.h ../functions/functionbase.h
|
|
||||||
mounts.o: ../core/request.h ../core/system.h ../core/synchro.h
|
|
||||||
mounts.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
|
||||||
mounts.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
|
||||||
mounts.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
|
||||||
mounts.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
|
||||||
mounts.o: ../functions/env.h ../functions/imgcrop.h ../functions/last.h
|
|
||||||
mounts.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
|
||||||
mounts.o: ../functions/ls.h ../functions/man.h ../functions/meta.h
|
|
||||||
mounts.o: ../functions/mkdir.h ../functions/mv.h ../functions/nicedit.h
|
|
||||||
mounts.o: ../functions/node.h ../functions/passwd.h ../functions/priv.h
|
|
||||||
mounts.o: ../functions/pw.h ../functions/reload.h ../functions/rm.h
|
|
||||||
mounts.o: ../functions/rmuser.h ../functions/sort.h
|
|
||||||
mounts.o: ../functions/specialdefault.h ../functions/stat.h
|
|
||||||
mounts.o: ../functions/subject.h ../functions/template.h
|
|
||||||
mounts.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
mounts.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
mounts.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
mounts.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
mounts.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
mounts.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
plugin.o: plugin.h pluginmsg.h log.h textstream.h logmanipulators.h
|
|
||||||
plugin.o: ../../pikotools/textstream/textstream.h
|
|
||||||
plugin.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
plugin.o: ../../pikotools/convert/convert.h
|
|
||||||
plugin.o: ../../pikotools/convert/inttostr.h
|
|
||||||
plugin.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
plugin.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
plugin.o: requesttypes.h item.h error.h config.h
|
|
||||||
plugin.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
plugin.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
plugin.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
plugin.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
plugin.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
plugin.o: ../templates/locale.h system.h job.h basethread.h synchro.h dirs.h
|
|
||||||
plugin.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
|
||||||
plugin.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
|
||||||
plugin.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
plugin.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
|
||||||
plugin.o: ../notify/notifypool.h ../templates/patterns.h
|
|
||||||
plugin.o: ../templates/locale.h ../templates/localefilter.h
|
|
||||||
plugin.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
|
||||||
plugin.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|
||||||
plugin.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
|
||||||
plugin.o: ../notify/notifythread.h ../core/basethread.h
|
|
||||||
plugin.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
|
||||||
plugin.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
|
||||||
plugin.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
|
||||||
plugin.o: timezones.h timezone.h sessionmanager.h sessioncontainer.h
|
|
||||||
plugin.o: ipbancontainer.h ../functions/functions.h
|
|
||||||
plugin.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
plugin.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
plugin.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
plugin.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
plugin.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
plugin.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
plugin.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
plugin.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
plugin.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
plugin.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
plugin.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
plugin.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
plugin.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
plugin.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
|
||||||
plugin.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
plugin.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
plugin.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
plugin.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
plugin.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
plugin.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h textstream.h
|
|
||||||
plugindata.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
|
||||||
plugindata.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
plugindata.o: ../../pikotools/convert/convert.h
|
|
||||||
plugindata.o: ../../pikotools/convert/inttostr.h
|
|
||||||
plugindata.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
plugindata.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
plugindata.o: requesttypes.h item.h error.h config.h
|
|
||||||
plugindata.o: ../../pikotools/space/spaceparser.h
|
|
||||||
plugindata.o: ../../pikotools/space/space.h
|
|
||||||
plugindata.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
plugindata.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
plugindata.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
plugindata.o: session.h user.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
plugindata.o: system.h job.h basethread.h synchro.h dirs.h dircontainer.h
|
|
||||||
plugindata.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
plugindata.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
|
||||||
plugindata.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
plugindata.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
|
||||||
plugindata.o: ../notify/notifypool.h ../templates/patterns.h
|
|
||||||
plugindata.o: ../templates/locale.h ../templates/localefilter.h
|
|
||||||
plugindata.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
|
||||||
plugindata.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|
||||||
plugindata.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
|
||||||
plugindata.o: ../notify/notifythread.h ../core/basethread.h
|
|
||||||
plugindata.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
|
||||||
plugindata.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h
|
|
||||||
plugindata.o: run.h users.h groups.h group.h loadavg.h image.h
|
|
||||||
plugindata.o: threadmanager.h timezones.h timezone.h sessionmanager.h
|
|
||||||
plugindata.o: sessioncontainer.h ipbancontainer.h ../functions/functions.h
|
|
||||||
plugindata.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
plugindata.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
plugindata.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
plugindata.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
plugindata.o: ../functions/ckeditor.h ../functions/cp.h
|
|
||||||
plugindata.o: ../functions/default.h ../functions/download.h
|
|
||||||
plugindata.o: ../functions/emacs.h ../functions/env.h ../functions/imgcrop.h
|
|
||||||
plugindata.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
|
||||||
plugindata.o: ../functions/ln.h ../functions/ls.h ../functions/man.h
|
|
||||||
plugindata.o: ../functions/meta.h ../functions/mkdir.h ../functions/mv.h
|
|
||||||
plugindata.o: ../functions/nicedit.h ../functions/node.h
|
|
||||||
plugindata.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
plugindata.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
plugindata.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
plugindata.o: ../functions/stat.h ../functions/subject.h
|
|
||||||
plugindata.o: ../functions/template.h ../functions/tinymce.h
|
|
||||||
plugindata.o: ../functions/uname.h ../functions/upload.h
|
|
||||||
plugindata.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
plugindata.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
plugindata.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
plugindata.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
plugindata.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
postmultiparser.o: postmultiparser.h error.h requesttypes.h
|
|
||||||
postmultiparser.o: ../../pikotools/textstream/textstream.h
|
|
||||||
postmultiparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
postmultiparser.o: ../../pikotools/convert/convert.h
|
|
||||||
postmultiparser.o: ../../pikotools/convert/inttostr.h
|
|
||||||
postmultiparser.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
postmultiparser.o: ../../pikotools/textstream/types.h config.h
|
|
||||||
postmultiparser.o: ../../pikotools/space/spaceparser.h
|
|
||||||
postmultiparser.o: ../../pikotools/space/space.h
|
|
||||||
postmultiparser.o: ../../pikotools/textstream/types.h htmlfilter.h misc.h
|
|
||||||
postmultiparser.o: item.h ../../pikotools/utf8/utf8.h log.h textstream.h
|
|
||||||
postmultiparser.o: logmanipulators.h slog.h cur.h request.h
|
|
||||||
postmultiparser.o: ../templates/htmltextstream.h ../core/textstream.h
|
|
||||||
postmultiparser.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
postmultiparser.o: plugindata.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
rebus.o: log.h textstream.h logmanipulators.h
|
|
||||||
rebus.o: ../../pikotools/textstream/textstream.h
|
|
||||||
rebus.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
rebus.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
rebus.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
rebus.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
rebus.o: requesttypes.h item.h error.h config.h
|
|
||||||
rebus.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
rebus.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
rebus.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
rebus.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
rebus.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
rebus.o: ../templates/locale.h
|
|
||||||
request.o: request.h requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
request.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
request.o: ../../pikotools/convert/convert.h
|
|
||||||
request.o: ../../pikotools/convert/inttostr.h
|
|
||||||
request.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
request.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
|
||||||
request.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
request.o: ../../pikotools/textstream/types.h htmlfilter.h textstream.h
|
|
||||||
request.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
request.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
request.o: log.h logmanipulators.h slog.h cur.h session.h user.h plugindata.h
|
|
||||||
request.o: rebus.h ipban.h mount.h ../templates/locale.h plugin.h pluginmsg.h
|
|
||||||
request.o: system.h job.h basethread.h synchro.h dirs.h dircontainer.h
|
|
||||||
request.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
request.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
|
||||||
request.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
request.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
|
||||||
request.o: ../notify/notifypool.h ../templates/patterns.h
|
|
||||||
request.o: ../templates/locale.h ../templates/localefilter.h
|
|
||||||
request.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
|
||||||
request.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
|
||||||
request.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
|
||||||
request.o: ../notify/notifythread.h ../core/basethread.h
|
|
||||||
request.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
|
||||||
request.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
|
||||||
request.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
|
||||||
request.o: timezones.h timezone.h sessionmanager.h sessioncontainer.h
|
|
||||||
request.o: ipbancontainer.h ../functions/functions.h
|
|
||||||
request.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
request.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
request.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
request.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
request.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
request.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
request.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
request.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
request.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
request.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
request.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
request.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
request.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
request.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
|
||||||
request.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
request.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
request.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
request.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
request.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
request.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
run.o: run.h log.h textstream.h logmanipulators.h
|
|
||||||
run.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
|
||||||
run.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
|
||||||
run.o: ../../pikotools/convert/inttostr.h
|
|
||||||
run.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
run.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
run.o: requesttypes.h item.h error.h config.h
|
|
||||||
run.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
run.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
run.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
run.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
run.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
run.o: ../templates/locale.h
|
|
||||||
session.o: session.h item.h ../../pikotools/space/space.h
|
|
||||||
session.o: ../../pikotools/date/date.h error.h user.h plugindata.h rebus.h
|
|
||||||
session.o: textstream.h ipban.h misc.h requesttypes.h
|
|
||||||
session.o: ../../pikotools/textstream/textstream.h
|
|
||||||
session.o: ../../pikotools/convert/convert.h
|
|
||||||
session.o: ../../pikotools/convert/inttostr.h
|
|
||||||
session.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
session.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
sessioncontainer.o: sessioncontainer.h session.h item.h
|
|
||||||
sessioncontainer.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
sessioncontainer.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
|
||||||
sessioncontainer.o: cur.h request.h requesttypes.h
|
|
||||||
sessioncontainer.o: ../../pikotools/textstream/textstream.h
|
|
||||||
sessioncontainer.o: ../../pikotools/convert/convert.h
|
|
||||||
sessioncontainer.o: ../../pikotools/convert/inttostr.h
|
|
||||||
sessioncontainer.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
sessioncontainer.o: ../../pikotools/textstream/types.h config.h
|
|
||||||
sessioncontainer.o: ../../pikotools/space/spaceparser.h
|
|
||||||
sessioncontainer.o: ../../pikotools/space/space.h
|
|
||||||
sessioncontainer.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessioncontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
sessioncontainer.o: ../../pikotools/utf8/utf8.h
|
|
||||||
sessioncontainer.o: ../../pikotools/space/spacetojson.h mount.h log.h
|
|
||||||
sessioncontainer.o: logmanipulators.h slog.h ../templates/locale.h
|
|
||||||
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h item.h
|
|
||||||
sessionmanager.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
sessionmanager.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
|
||||||
sessionmanager.o: cur.h request.h requesttypes.h
|
|
||||||
sessionmanager.o: ../../pikotools/textstream/textstream.h
|
|
||||||
sessionmanager.o: ../../pikotools/convert/convert.h
|
|
||||||
sessionmanager.o: ../../pikotools/convert/inttostr.h
|
|
||||||
sessionmanager.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
sessionmanager.o: ../../pikotools/textstream/types.h config.h
|
|
||||||
sessionmanager.o: ../../pikotools/space/spaceparser.h
|
|
||||||
sessionmanager.o: ../../pikotools/space/space.h
|
|
||||||
sessionmanager.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessionmanager.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
sessionmanager.o: ../../pikotools/utf8/utf8.h
|
|
||||||
sessionmanager.o: ../../pikotools/space/spacetojson.h mount.h
|
|
||||||
sessionmanager.o: ipbancontainer.h lastcontainer.h system.h job.h
|
|
||||||
sessionmanager.o: basethread.h synchro.h dirs.h dircontainer.h ../db/db.h
|
|
||||||
sessionmanager.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
sessionmanager.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
|
||||||
sessionmanager.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
|
||||||
sessionmanager.o: ../core/dircontainer.h ../core/ugcontainer.h log.h
|
|
||||||
sessionmanager.o: logmanipulators.h slog.h ../templates/locale.h
|
|
||||||
sessionmanager.o: ../notify/notify.h ../notify/notifypool.h
|
|
||||||
sessionmanager.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
sessionmanager.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
sessionmanager.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
sessionmanager.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
sessionmanager.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
sessionmanager.o: ../core/basethread.h ../notify/templatesnotify.h
|
|
||||||
sessionmanager.o: ../core/config.h ../core/users.h ugcontainer.h mounts.h
|
|
||||||
sessionmanager.o: mountparser.h crypt.h run.h users.h groups.h group.h
|
|
||||||
sessionmanager.o: loadavg.h image.h threadmanager.h timezones.h timezone.h
|
|
||||||
sessionmanager.o: sessionparser.h plugin.h pluginmsg.h
|
|
||||||
sessionmanager.o: ../functions/functions.h ../functions/functionbase.h
|
|
||||||
sessionmanager.o: ../core/request.h ../core/system.h ../core/synchro.h
|
|
||||||
sessionmanager.o: ../functions/functionparser.h ../core/cur.h
|
|
||||||
sessionmanager.o: ../functions/adduser.h ../functions/cat.h
|
|
||||||
sessionmanager.o: ../functions/chmod.h ../functions/privchanger.h
|
|
||||||
sessionmanager.o: ../functions/chown.h ../functions/ckeditor.h
|
|
||||||
sessionmanager.o: ../functions/cp.h ../functions/default.h
|
|
||||||
sessionmanager.o: ../functions/download.h ../functions/emacs.h
|
|
||||||
sessionmanager.o: ../functions/env.h ../functions/imgcrop.h
|
|
||||||
sessionmanager.o: ../functions/last.h ../functions/login.h
|
|
||||||
sessionmanager.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
sessionmanager.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
sessionmanager.o: ../functions/mv.h ../functions/nicedit.h
|
|
||||||
sessionmanager.o: ../functions/node.h ../functions/passwd.h
|
|
||||||
sessionmanager.o: ../functions/priv.h ../functions/pw.h ../functions/reload.h
|
|
||||||
sessionmanager.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h
|
|
||||||
sessionmanager.o: ../functions/specialdefault.h ../functions/stat.h
|
|
||||||
sessionmanager.o: ../functions/subject.h ../functions/template.h
|
|
||||||
sessionmanager.o: ../functions/tinymce.h ../functions/uname.h
|
|
||||||
sessionmanager.o: ../functions/upload.h ../functions/uptime.h
|
|
||||||
sessionmanager.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
|
||||||
sessionmanager.o: ../templates/templates.h ../templates/patterncacher.h
|
|
||||||
sessionmanager.o: ../templates/indexpatterns.h ../templates/patterns.h
|
|
||||||
sessionmanager.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
|
||||||
sessionmanager.o: ../core/sessionmanager.h
|
|
||||||
sessionparser.o: sessionparser.h session.h item.h
|
|
||||||
sessionparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
sessionparser.o: error.h user.h plugindata.h rebus.h textstream.h ipban.h
|
|
||||||
sessionparser.o: sessioncontainer.h cur.h request.h requesttypes.h
|
|
||||||
sessionparser.o: ../../pikotools/textstream/textstream.h
|
|
||||||
sessionparser.o: ../../pikotools/convert/convert.h
|
|
||||||
sessionparser.o: ../../pikotools/convert/inttostr.h
|
|
||||||
sessionparser.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
sessionparser.o: ../../pikotools/textstream/types.h config.h
|
|
||||||
sessionparser.o: ../../pikotools/space/spaceparser.h
|
|
||||||
sessionparser.o: ../../pikotools/space/space.h
|
|
||||||
sessionparser.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
sessionparser.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
sessionparser.o: ../../pikotools/utf8/utf8.h
|
|
||||||
sessionparser.o: ../../pikotools/space/spacetojson.h mount.h users.h log.h
|
|
||||||
sessionparser.o: logmanipulators.h slog.h ../templates/locale.h
|
|
||||||
slog.o: slog.h cur.h request.h requesttypes.h
|
|
||||||
slog.o: ../../pikotools/textstream/textstream.h ../../pikotools/space/space.h
|
|
||||||
slog.o: ../../pikotools/date/date.h ../../pikotools/convert/convert.h
|
|
||||||
slog.o: ../../pikotools/convert/inttostr.h
|
|
||||||
slog.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
slog.o: ../../pikotools/textstream/types.h item.h error.h config.h
|
|
||||||
slog.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
slog.o: ../../pikotools/textstream/types.h htmlfilter.h textstream.h
|
|
||||||
slog.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
slog.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
slog.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
slog.o: logmanipulators.h ../templates/locale.h
|
|
||||||
synchro.o: synchro.h
|
|
||||||
system.o: system.h job.h basethread.h synchro.h ../../pikotools/space/space.h
|
|
||||||
system.o: dirs.h item.h ../../pikotools/date/date.h dircontainer.h ../db/db.h
|
|
||||||
system.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
|
||||||
system.o: ../core/textstream.h misc.h requesttypes.h
|
|
||||||
system.o: ../../pikotools/textstream/textstream.h
|
|
||||||
system.o: ../../pikotools/convert/convert.h
|
|
||||||
system.o: ../../pikotools/convert/inttostr.h
|
|
||||||
system.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
system.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
system.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
system.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
system.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
system.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
system.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
|
||||||
system.o: cur.h request.h error.h config.h htmlfilter.h
|
|
||||||
system.o: ../templates/htmltextstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
system.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
system.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
|
||||||
system.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
system.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
system.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
system.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
system.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
system.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
|
||||||
system.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h
|
|
||||||
system.o: mountparser.h crypt.h run.h users.h groups.h group.h loadavg.h
|
|
||||||
system.o: image.h threadmanager.h timezones.h timezone.h
|
|
||||||
system.o: ../templates/templates.h ../templates/patterncacher.h
|
|
||||||
system.o: ../templates/indexpatterns.h ../templates/patterns.h
|
|
||||||
system.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
|
||||||
system.o: ../core/cur.h ../core/system.h ../core/sessionmanager.h
|
|
||||||
system.o: ../core/htmlfilter.h ../functions/functions.h
|
|
||||||
system.o: ../functions/functionbase.h ../core/request.h ../core/synchro.h
|
|
||||||
system.o: ../functions/functionparser.h ../functions/adduser.h
|
|
||||||
system.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
|
||||||
system.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
|
||||||
system.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
|
||||||
system.o: ../functions/env.h ../functions/imgcrop.h ../functions/last.h
|
|
||||||
system.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
|
||||||
system.o: ../functions/ls.h ../functions/man.h ../functions/meta.h
|
|
||||||
system.o: ../functions/mkdir.h ../functions/mv.h ../functions/nicedit.h
|
|
||||||
system.o: ../functions/node.h ../functions/passwd.h ../functions/priv.h
|
|
||||||
system.o: ../functions/pw.h ../functions/reload.h ../functions/rm.h
|
|
||||||
system.o: ../functions/rmuser.h ../functions/sort.h
|
|
||||||
system.o: ../functions/specialdefault.h ../functions/stat.h
|
|
||||||
system.o: ../functions/subject.h ../functions/template.h
|
|
||||||
system.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
system.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
system.o: plugin.h pluginmsg.h sessionmanager.h sessioncontainer.h
|
|
||||||
system.o: ipbancontainer.h
|
|
||||||
threadmanager.o: threadmanager.h basethread.h synchro.h log.h textstream.h
|
|
||||||
threadmanager.o: logmanipulators.h ../../pikotools/textstream/textstream.h
|
|
||||||
threadmanager.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
|
||||||
threadmanager.o: ../../pikotools/convert/convert.h
|
|
||||||
threadmanager.o: ../../pikotools/convert/inttostr.h
|
|
||||||
threadmanager.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
threadmanager.o: ../../pikotools/textstream/types.h slog.h cur.h request.h
|
|
||||||
threadmanager.o: requesttypes.h item.h error.h config.h
|
|
||||||
threadmanager.o: ../../pikotools/space/spaceparser.h
|
|
||||||
threadmanager.o: ../../pikotools/space/space.h
|
|
||||||
threadmanager.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
threadmanager.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
threadmanager.o: ../../pikotools/utf8/utf8.h
|
|
||||||
threadmanager.o: ../../pikotools/space/spacetojson.h session.h user.h
|
|
||||||
threadmanager.o: plugindata.h rebus.h ipban.h mount.h ../templates/locale.h
|
|
||||||
timezone.o: timezone.h ../../pikotools/date/date.h
|
|
||||||
timezone.o: ../../pikotools/space/space.h misc.h item.h requesttypes.h
|
|
||||||
timezone.o: ../../pikotools/textstream/textstream.h
|
|
||||||
timezone.o: ../../pikotools/convert/convert.h
|
|
||||||
timezone.o: ../../pikotools/convert/inttostr.h
|
|
||||||
timezone.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
timezone.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
timezones.o: timezones.h timezone.h ../../pikotools/date/date.h
|
|
||||||
timezones.o: ../../pikotools/space/space.h
|
|
||||||
timezones.o: ../../pikotools/space/spaceparser.h
|
|
||||||
timezones.o: ../../pikotools/space/space.h ../../pikotools/textstream/types.h
|
|
||||||
timezones.o: misc.h item.h requesttypes.h
|
|
||||||
timezones.o: ../../pikotools/textstream/textstream.h
|
|
||||||
timezones.o: ../../pikotools/convert/convert.h
|
|
||||||
timezones.o: ../../pikotools/convert/inttostr.h
|
|
||||||
timezones.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
timezones.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
timezones.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
|
||||||
timezones.o: error.h config.h htmlfilter.h ../templates/htmltextstream.h
|
|
||||||
timezones.o: ../core/textstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
timezones.o: session.h user.h plugindata.h rebus.h ipban.h mount.h
|
|
||||||
timezones.o: ../templates/locale.h
|
|
||||||
user.o: user.h
|
|
||||||
users.o: users.h sessionmanager.h sessioncontainer.h session.h item.h
|
|
||||||
users.o: ../../pikotools/space/space.h ../../pikotools/date/date.h error.h
|
|
||||||
users.o: user.h plugindata.h rebus.h textstream.h ipban.h cur.h request.h
|
|
||||||
users.o: requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
users.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
users.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
users.o: ../../pikotools/textstream/types.h config.h
|
|
||||||
users.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
|
||||||
users.o: ../../pikotools/textstream/types.h htmlfilter.h
|
|
||||||
users.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
|
||||||
users.o: ../../pikotools/utf8/utf8.h ../../pikotools/space/spacetojson.h
|
|
||||||
users.o: mount.h ipbancontainer.h lastcontainer.h system.h job.h basethread.h
|
|
||||||
users.o: synchro.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
|
|
||||||
users.o: ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
|
||||||
users.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
|
||||||
users.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
users.o: ../core/ugcontainer.h log.h logmanipulators.h slog.h
|
|
||||||
users.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
|
||||||
users.o: ../templates/patterns.h ../templates/locale.h
|
|
||||||
users.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
|
||||||
users.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
|
||||||
users.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
|
||||||
users.o: ../../ezc/src/stringconv.h ../notify/notifythread.h
|
|
||||||
users.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
|
||||||
users.o: ../core/users.h ugcontainer.h mounts.h mountparser.h crypt.h run.h
|
|
||||||
users.o: groups.h group.h loadavg.h image.h threadmanager.h timezones.h
|
|
||||||
users.o: timezone.h plugin.h pluginmsg.h ../functions/functions.h
|
|
||||||
users.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
|
||||||
users.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
|
||||||
users.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
|
||||||
users.o: ../functions/privchanger.h ../functions/chown.h
|
|
||||||
users.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
|
||||||
users.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
|
||||||
users.o: ../functions/imgcrop.h ../functions/last.h ../functions/login.h
|
|
||||||
users.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
|
||||||
users.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
|
||||||
users.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
|
||||||
users.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
|
||||||
users.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
|
||||||
users.o: ../functions/sort.h ../functions/specialdefault.h
|
|
||||||
users.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
|
||||||
users.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
|
||||||
users.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
|
||||||
users.o: ../core/htmlfilter.h ../templates/templates.h
|
|
||||||
users.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
|
||||||
users.o: ../templates/patterns.h ../templates/changepatterns.h
|
|
||||||
users.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
o = acceptbaseparser.o app.o basethread.o bbcodeparser.o compress.o config.o crypt.o dircontainer.o dirs.o groups.o htmlfilter.o httpsimpleparser.o image.o ipbancontainer.o item.o job.o lastcontainer.o loadavg.o lock.o log.o misc.o mount.o mountparser.o mounts.o plugin.o plugindata.o postmultiparser.o rebus.o request.o run.o session.o sessioncontainer.o sessionmanager.o sessionparser.o slog.o synchro.o system.o threadmanager.o timezone.o timezones.o user.o users.o
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "acceptbaseparser.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool AcceptBaseParser::IsWhite(int c)
|
|
||||||
{
|
|
||||||
if( c==' ' || c=='\t' )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::SkipWhite()
|
|
||||||
{
|
|
||||||
while( IsWhite(*text) )
|
|
||||||
++text;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::RemoveWhiteFromEnd(std::string & str)
|
|
||||||
{
|
|
||||||
if( str.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
size_t i = str.size() - 1;
|
|
||||||
|
|
||||||
for( ; i!=0 && IsWhite(str[i]) ; --i);
|
|
||||||
|
|
||||||
if( !IsWhite(str[i]) )
|
|
||||||
++i;
|
|
||||||
|
|
||||||
if( i < str.size() )
|
|
||||||
str.erase(i); // erasing until the end of the string
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::ReadParameter()
|
|
||||||
{
|
|
||||||
param.clear();
|
|
||||||
|
|
||||||
SkipWhite();
|
|
||||||
|
|
||||||
while( *text!=0 && *text!=',' && *text!=';' )
|
|
||||||
{
|
|
||||||
param += *text;
|
|
||||||
++text;
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoveWhiteFromEnd(param);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::ReadQ()
|
|
||||||
{
|
|
||||||
q = 1.0;
|
|
||||||
|
|
||||||
SkipWhite();
|
|
||||||
|
|
||||||
if( *text != ';' )
|
|
||||||
return;
|
|
||||||
|
|
||||||
++text; // skipping a semicolon
|
|
||||||
|
|
||||||
while( *text!=0 && *text!=',' && *text!='=' )
|
|
||||||
// skipping until ',' or '='
|
|
||||||
++text;
|
|
||||||
|
|
||||||
if( *text==0 || *text==',' )
|
|
||||||
return;
|
|
||||||
|
|
||||||
++text; // skipping '='
|
|
||||||
|
|
||||||
SkipWhite();
|
|
||||||
q = strtod(text, (char**)&text);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::SkipParam()
|
|
||||||
{
|
|
||||||
SkipWhite();
|
|
||||||
|
|
||||||
if( *text == ',' )
|
|
||||||
++text;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AcceptBaseParser::Parse(const char * str)
|
|
||||||
{
|
|
||||||
text = str;
|
|
||||||
Init();
|
|
||||||
|
|
||||||
while( *text != 0 )
|
|
||||||
{
|
|
||||||
ReadParameter();
|
|
||||||
ReadQ();
|
|
||||||
SkipParam();
|
|
||||||
Param(param, q);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_acceptbaseparser
|
|
||||||
#define headerfile_winix_core_acceptbaseparser
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// sample (you must create your own class derived from this one):
|
|
||||||
// object.Parse(" text/html ; , ; q = 45, application / xhtml+xml ; q = 0.4 , application/xml ; q = 0.9 , */* ; q = 0.8 ");
|
|
||||||
class AcceptBaseParser
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
void Parse(const char * str);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
virtual void Init() {} ;
|
|
||||||
virtual void Param(const std::string & param, double q) = 0;
|
|
||||||
|
|
||||||
bool IsWhite(int c);
|
|
||||||
void SkipWhite();
|
|
||||||
void RemoveWhiteFromEnd(std::string & str);
|
|
||||||
void ReadParameter();
|
|
||||||
void ReadQ();
|
|
||||||
void SkipParam();
|
|
||||||
|
|
||||||
|
|
||||||
const char * text;
|
|
||||||
std::string param;
|
|
||||||
double q;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_acceptencodingparser
|
|
||||||
#define headerfile_winix_core_acceptencodingparser
|
|
||||||
|
|
||||||
#include "acceptbaseparser.h"
|
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
|
|
||||||
class AcceptEncodingParser : public AcceptBaseParser
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
bool AcceptDeflate()
|
|
||||||
{
|
|
||||||
return accept_deflate;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool AcceptGzip()
|
|
||||||
{
|
|
||||||
return accept_gzip;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ParseAndLog(const char * str)
|
|
||||||
{
|
|
||||||
Parse(str);
|
|
||||||
|
|
||||||
if( accept_deflate || accept_gzip )
|
|
||||||
{
|
|
||||||
log << log3 << "AEP: ";
|
|
||||||
|
|
||||||
if( accept_deflate )
|
|
||||||
{
|
|
||||||
log << "accept deflate";
|
|
||||||
|
|
||||||
if( accept_gzip )
|
|
||||||
log << ", ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if( accept_gzip )
|
|
||||||
log << "accept gzip";
|
|
||||||
|
|
||||||
log << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void Init()
|
|
||||||
{
|
|
||||||
accept_deflate = false;
|
|
||||||
accept_gzip = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Param(const std::string & param, double q)
|
|
||||||
{
|
|
||||||
if( param=="deflate" && q!=0.0 )
|
|
||||||
{
|
|
||||||
accept_deflate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( param=="gzip" && q!=0.0 )
|
|
||||||
{
|
|
||||||
accept_gzip = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool accept_deflate;
|
|
||||||
bool accept_gzip;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
1553
core/app.cpp
1553
core/app.cpp
File diff suppressed because it is too large
Load Diff
193
core/app.h
193
core/app.h
@@ -1,193 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2013, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_app
|
|
||||||
#define headerfile_winix_core_app
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <ctime>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <pwd.h>
|
|
||||||
#include <grp.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include "system.h"
|
|
||||||
#include "mounts.h"
|
|
||||||
#include "request.h"
|
|
||||||
#include "synchro.h"
|
|
||||||
#include "sessionmanager.h"
|
|
||||||
#include "db/db.h"
|
|
||||||
#include "functions/functions.h"
|
|
||||||
#include "templates/templates.h"
|
|
||||||
#include "compress.h"
|
|
||||||
#include "postparser.h"
|
|
||||||
#include "cookieparser.h"
|
|
||||||
#include "postmultiparser.h"
|
|
||||||
#include "acceptencodingparser.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class App
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
App();
|
|
||||||
|
|
||||||
bool InitFCGI();
|
|
||||||
bool DropPrivileges();
|
|
||||||
bool Init();
|
|
||||||
void Start();
|
|
||||||
void Close();
|
|
||||||
void LogUserGroups();
|
|
||||||
bool Demonize();
|
|
||||||
void SetStopSignal();
|
|
||||||
bool WasStopSignal();
|
|
||||||
bool Lock();
|
|
||||||
void Unlock();
|
|
||||||
void StartThreads();
|
|
||||||
void WaitForThreads();
|
|
||||||
|
|
||||||
// configuration read from a config file
|
|
||||||
Config config;
|
|
||||||
|
|
||||||
// pointers to the current request and a session
|
|
||||||
Cur cur;
|
|
||||||
|
|
||||||
// temporary one request object
|
|
||||||
// current request
|
|
||||||
Request req;
|
|
||||||
|
|
||||||
// users sessions
|
|
||||||
SessionManager session_manager;
|
|
||||||
|
|
||||||
// database
|
|
||||||
Db db;
|
|
||||||
DbConn db_conn;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
model
|
|
||||||
*/
|
|
||||||
|
|
||||||
// ...
|
|
||||||
System system;
|
|
||||||
|
|
||||||
// functions (ls, cat, emacs, ...)
|
|
||||||
Functions functions;
|
|
||||||
|
|
||||||
// false at the beginning
|
|
||||||
// !! moze to do loggera dac?
|
|
||||||
bool stdout_is_closed;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
view
|
|
||||||
*/
|
|
||||||
|
|
||||||
Templates templates;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
enum Header
|
|
||||||
{
|
|
||||||
h_200,
|
|
||||||
h_404,
|
|
||||||
h_403
|
|
||||||
};
|
|
||||||
|
|
||||||
PostParser post_parser;
|
|
||||||
PostMultiParser post_multi_parser;
|
|
||||||
CookieParser cookie_parser;
|
|
||||||
AcceptEncodingParser accept_encoding_parser;
|
|
||||||
Compress compress;
|
|
||||||
std::wstring clean_html, html_with_debug;
|
|
||||||
FCGX_Request fcgi_request;
|
|
||||||
int fcgi_socket;
|
|
||||||
Synchro synchro;
|
|
||||||
pthread_t signal_thread;
|
|
||||||
std::string url_to_fetch_on_exit;
|
|
||||||
std::string source_a;
|
|
||||||
std::string sendh_t, sendh_t2, sendh_t3;
|
|
||||||
std::string sendfilea, sendfile2a;
|
|
||||||
std::string send_data_buf;
|
|
||||||
PT::SpaceToJSON ajax_generic_serializer;
|
|
||||||
|
|
||||||
bool CheckAccessFromPlugins();
|
|
||||||
void ProcessRequestThrow();
|
|
||||||
void ProcessRequest();
|
|
||||||
void BaseUrlRedirect(int code, bool add_subdomain);
|
|
||||||
bool BaseUrlRedirect();
|
|
||||||
void CheckIfNeedSSLredirect();
|
|
||||||
void SetLocale();
|
|
||||||
void CheckPostRedirect();
|
|
||||||
void MakePage();
|
|
||||||
void Make();
|
|
||||||
void SaveSessionsIfNeeded(); // !! wywalic do menagera sesji??
|
|
||||||
void LogAccess();
|
|
||||||
void SendData(const BinaryPage & page, FCGX_Stream * out);
|
|
||||||
|
|
||||||
void ReadRequest();
|
|
||||||
void SendTextAnswer();
|
|
||||||
void SendBinaryAnswer();
|
|
||||||
void SendAnswer();
|
|
||||||
|
|
||||||
void PrintEnv();
|
|
||||||
|
|
||||||
void SetEnv(const char * & env, const char * name);
|
|
||||||
void ReadEnvVariables();
|
|
||||||
void ReadGetPostVars();
|
|
||||||
|
|
||||||
void CheckIE();
|
|
||||||
void CheckKonqueror();
|
|
||||||
void CheckRequestMethod();
|
|
||||||
void CheckFCGIRole();
|
|
||||||
void CheckSSL();
|
|
||||||
void SetSubdomain();
|
|
||||||
|
|
||||||
void PrepareSessionCookie();
|
|
||||||
void AddDebugInfo(std::wstring & out);
|
|
||||||
void FilterCompressSend(bool compressing, int compress_encoding, const std::wstring & source_ref);
|
|
||||||
bool SendHeadersStaticCreateResource();
|
|
||||||
void SendHeadersStatic();
|
|
||||||
void SendHeaderContentType();
|
|
||||||
void SendHeadersForbidden();
|
|
||||||
void SendHeadersRedirect();
|
|
||||||
void SendHeadersSendFile();
|
|
||||||
void SendHeadersCompression(int compress_encoding);
|
|
||||||
void SendHeadersNormal(Header header);
|
|
||||||
void SendHeaders(bool compressing, int compress_encoding, Header header);
|
|
||||||
int SelectDeflateVersion();
|
|
||||||
void SelectCompression(size_t source_len, bool & compression_allowed, int & compression_encoding);
|
|
||||||
bool CanSendContent(Header header);
|
|
||||||
|
|
||||||
void LogUser(const char * msg, uid_t id);
|
|
||||||
void LogGroup(const char * msg, gid_t id, bool put_logend = true);
|
|
||||||
void LogUsers();
|
|
||||||
void LogEffectiveGroups(std::vector<gid_t> & tab);
|
|
||||||
void LogGroups();
|
|
||||||
bool DropPrivileges(const std::string & user, uid_t uid, gid_t gid, bool additional_groups);
|
|
||||||
|
|
||||||
static void * SpecialThreadForSignals(void*);
|
|
||||||
void FetchPageOnExit();
|
|
||||||
|
|
||||||
void CreateStaticTree();
|
|
||||||
|
|
||||||
// !! dodac do session managera?
|
|
||||||
time_t last_sessions_save;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_compress
|
|
||||||
#define headerfile_winix_core_compress
|
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include <zlib.h>
|
|
||||||
#include "requesttypes.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Compress
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Compress();
|
|
||||||
~Compress();
|
|
||||||
|
|
||||||
int Init(int compress_level_ = 6);
|
|
||||||
|
|
||||||
/*
|
|
||||||
encoding:
|
|
||||||
0 - raw deflate data with no zlib header or trailer, and will not compute an adler32 check value
|
|
||||||
(for Internet Explorer)
|
|
||||||
1 - deflate
|
|
||||||
2 - gzip
|
|
||||||
*/
|
|
||||||
int CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding = 2);
|
|
||||||
int Compressing(const BinaryPage & in, BinaryPage & out, int encoding = 2);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool AllocateMemory();
|
|
||||||
bool InitRawDeflate();
|
|
||||||
bool InitDeflate();
|
|
||||||
bool InitGzip();
|
|
||||||
|
|
||||||
int MakeCompress(z_stream & strm, const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding);
|
|
||||||
int MakeCompress(z_stream & strm, const BinaryPage & page, BinaryPage & out, int encoding);
|
|
||||||
z_stream * SelectStream(int encoding);
|
|
||||||
void ResetStream(z_stream * pstrm, int encoding);
|
|
||||||
void PutLog(size_t source_len, int encoding);
|
|
||||||
void CopyToInputBuffer(BinaryPage::const_iterator & i, size_t len);
|
|
||||||
|
|
||||||
int compress_level;
|
|
||||||
size_t buffer_max_len;
|
|
||||||
|
|
||||||
// size of the last compressed page
|
|
||||||
size_t last_out_size;
|
|
||||||
|
|
||||||
char * buffer_in;
|
|
||||||
char * buffer_out;
|
|
||||||
z_stream strm_raw_deflate, strm_deflate, strm_gzip;
|
|
||||||
bool raw_deflate_inited, deflate_inited, gzip_inited;
|
|
||||||
bool ready_for_compress;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_cookieparser
|
|
||||||
#define headerfile_winix_core_cookieparser
|
|
||||||
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include "httpsimpleparser.h"
|
|
||||||
#include "requesttypes.h"
|
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CookieParser : public HttpSimpleParser
|
|
||||||
{
|
|
||||||
|
|
||||||
const char * cookie_string;
|
|
||||||
CookieTab * cookie_tab;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
virtual int GetChar()
|
|
||||||
{
|
|
||||||
if( !cookie_string || *cookie_string == 0 )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return (int)(unsigned char)*(cookie_string++);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
virtual void Parameter(std::string & name, std::string & value)
|
|
||||||
{
|
|
||||||
// Cookie names are case insensitive according to section 3.1 of RFC 2965
|
|
||||||
ToLower(name);
|
|
||||||
|
|
||||||
std::pair<CookieTab::iterator, bool> res = cookie_tab->insert( std::make_pair(name, value) );
|
|
||||||
|
|
||||||
log << log2 << "Cookie, name: \"" << name << "\", value: \"" << value << "\"";
|
|
||||||
|
|
||||||
if( res.second == false )
|
|
||||||
{
|
|
||||||
res.first->second = value;
|
|
||||||
log << " (overwritten)";
|
|
||||||
}
|
|
||||||
|
|
||||||
log << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
CookieParser()
|
|
||||||
{
|
|
||||||
HttpSimpleParser::separator = ';';
|
|
||||||
HttpSimpleParser::value_can_be_quoted = true;
|
|
||||||
HttpSimpleParser::skip_white_chars = true;
|
|
||||||
HttpSimpleParser::recognize_special_chars = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// cookie_string can be null
|
|
||||||
void Parse(const char * cookie_string_, CookieTab & cookie_tab_)
|
|
||||||
{
|
|
||||||
cookie_string = cookie_string_;
|
|
||||||
cookie_tab = &cookie_tab_;
|
|
||||||
|
|
||||||
HttpSimpleParser::Parse();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
36
core/cur.h
36
core/cur.h
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_cur
|
|
||||||
#define headerfile_winix_core_cur
|
|
||||||
|
|
||||||
#include "request.h"
|
|
||||||
#include "session.h"
|
|
||||||
#include "mount.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
current request and session
|
|
||||||
*/
|
|
||||||
struct Cur
|
|
||||||
{
|
|
||||||
Request * request;
|
|
||||||
Session * session;
|
|
||||||
Mount * mount;
|
|
||||||
|
|
||||||
// those pointers are never null, if there is no a session for the user
|
|
||||||
// the 'session' pointer pointers at a special temporary session
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
43
core/group.h
43
core/group.h
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_group
|
|
||||||
#define headerfile_winix_core_group
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Group
|
|
||||||
{
|
|
||||||
long id;
|
|
||||||
std::wstring name; // group name
|
|
||||||
std::vector<long> members; // users id
|
|
||||||
|
|
||||||
Group()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Clear()
|
|
||||||
{
|
|
||||||
id = -1;
|
|
||||||
name.clear();
|
|
||||||
members.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
116
core/groups.cpp
116
core/groups.cpp
@@ -1,116 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "groups.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Groups::Groups()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Groups::Clear()
|
|
||||||
{
|
|
||||||
table.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Groups::ReadGroups(Db * db)
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
|
|
||||||
db->GetGroups(table);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Group * Groups::GetGroup(long group_id)
|
|
||||||
{
|
|
||||||
Table::Iterator i = table.FindId(group_id);
|
|
||||||
|
|
||||||
if( i == table.End() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return &(*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Group * Groups::GetGroup(const std::wstring & name)
|
|
||||||
{
|
|
||||||
Table::Iterator i = table.FindName(name);
|
|
||||||
|
|
||||||
if( i == table.End() )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return &(*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
long Groups::GetGroupId(const std::wstring & name)
|
|
||||||
{
|
|
||||||
Group * pgroup = GetGroup(name);
|
|
||||||
|
|
||||||
if( !pgroup )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
return pgroup->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Groups::Iterator Groups::Begin()
|
|
||||||
{
|
|
||||||
return table.Begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Groups::Iterator Groups::End()
|
|
||||||
{
|
|
||||||
return table.End();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Groups::SizeType Groups::Size()
|
|
||||||
{
|
|
||||||
return table.Size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Groups::Remove(long group_id)
|
|
||||||
{
|
|
||||||
return table.Remove(group_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_groups
|
|
||||||
#define headerfile_winix_core_groups
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "group.h"
|
|
||||||
#include "ugcontainer.h"
|
|
||||||
#include "db/db.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Groups
|
|
||||||
{
|
|
||||||
typedef UGContainer<Group> Table;
|
|
||||||
|
|
||||||
Table table;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Table::Iterator Iterator;
|
|
||||||
typedef Table::SizeType SizeType;
|
|
||||||
|
|
||||||
Groups();
|
|
||||||
void Clear();
|
|
||||||
void ReadGroups(Db * db);
|
|
||||||
Group * GetGroup(long group_id);
|
|
||||||
Group * GetGroup(const std::wstring & name);
|
|
||||||
long GetGroupId(const std::wstring & name);
|
|
||||||
Iterator Begin();
|
|
||||||
Iterator End();
|
|
||||||
SizeType Size();
|
|
||||||
bool Remove(long group_id);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,235 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "httpsimpleparser.h"
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ToLower(std::string & s)
|
|
||||||
{
|
|
||||||
std::string::iterator i;
|
|
||||||
|
|
||||||
for(i=s.begin() ; i!= s.end() ; ++i)
|
|
||||||
{
|
|
||||||
if( *i>='A' && *i<='Z' )
|
|
||||||
*i = *i - 'A' + 'a';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool HttpSimpleParser::IsWhite(int c)
|
|
||||||
{
|
|
||||||
if( c==' ' || c=='\t' )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::SkipWhiteChars()
|
|
||||||
{
|
|
||||||
while( IsWhite(last_c) )
|
|
||||||
last_c = GetChar();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::TrimWhiteChars(std::string & s)
|
|
||||||
{
|
|
||||||
if( s.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
std::string::size_type i;
|
|
||||||
|
|
||||||
for(i = 0 ; i<s.size() && IsWhite(s[i]) ; ++i);
|
|
||||||
|
|
||||||
if( i == s.size() )
|
|
||||||
{
|
|
||||||
// all characters are white
|
|
||||||
s.clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( i > 0 )
|
|
||||||
// there are some white characters at the beginning
|
|
||||||
s.erase(0, i);
|
|
||||||
|
|
||||||
|
|
||||||
// s is not empty now (i was not equal s.size())
|
|
||||||
// and we have some non white characters
|
|
||||||
// we stops at the last non white character
|
|
||||||
for(i = s.size()-1 ; i>0 && IsWhite(s[i]) ; --i);
|
|
||||||
|
|
||||||
if( i != s.size()-1 )
|
|
||||||
// there are some white characters at the end
|
|
||||||
// we're starting from i+1 even when i==0 (there are some non white characters)
|
|
||||||
s.erase(i+1, s.size() - i - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int HttpSimpleParser::ParseHalfHex(int c)
|
|
||||||
{
|
|
||||||
if( c>='a' && c<='z' )
|
|
||||||
c += 'A' - 'a'; // to upper case
|
|
||||||
|
|
||||||
|
|
||||||
if( c >= 'A' )
|
|
||||||
c = c - 'A' + 10;
|
|
||||||
else
|
|
||||||
c = c - '0';
|
|
||||||
|
|
||||||
c &= 0xf;
|
|
||||||
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::CheckSpecialChar()
|
|
||||||
{
|
|
||||||
if( last_c == '%' )
|
|
||||||
{
|
|
||||||
int c1 = GetChar();
|
|
||||||
int c2 = GetChar();
|
|
||||||
|
|
||||||
if( c1==-1 || c2==-1 )
|
|
||||||
{
|
|
||||||
last_c = -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
c1 = ParseHalfHex(c1);
|
|
||||||
c2 = ParseHalfHex(c2);
|
|
||||||
|
|
||||||
last_c = (c1 << 4) + c2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if( last_c == '+' )
|
|
||||||
{
|
|
||||||
last_c = ' ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadName()
|
|
||||||
{
|
|
||||||
// we're checking 'separator' and '=' because the string is allowed not having '=' (the value is optional)
|
|
||||||
|
|
||||||
for( ; last_c!=-1 && last_c!=separator && last_c!='=' ; last_c = GetChar() )
|
|
||||||
{
|
|
||||||
if( recognize_special_chars )
|
|
||||||
CheckSpecialChar();
|
|
||||||
|
|
||||||
if( last_c != -1 )
|
|
||||||
last_name += last_c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( last_c == '=' )
|
|
||||||
last_c = GetChar();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadQuotedValue()
|
|
||||||
{
|
|
||||||
// skipping '"'
|
|
||||||
last_c = GetChar();
|
|
||||||
|
|
||||||
|
|
||||||
for( ; last_c!=-1 && last_c!='"' ; last_c = GetChar() )
|
|
||||||
{
|
|
||||||
if( recognize_special_chars )
|
|
||||||
CheckSpecialChar();
|
|
||||||
|
|
||||||
if( last_c != -1 )
|
|
||||||
last_value += last_c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( last_c == '"' )
|
|
||||||
last_c = GetChar();
|
|
||||||
|
|
||||||
// looking for a separator (skipping)
|
|
||||||
for( ; last_c!=-1 && last_c!=separator ; last_c = GetChar() );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::ReadValue()
|
|
||||||
{
|
|
||||||
if( skip_white_chars )
|
|
||||||
SkipWhiteChars();
|
|
||||||
|
|
||||||
if( value_can_be_quoted && last_c == '"' )
|
|
||||||
{
|
|
||||||
ReadQuotedValue();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for( ; last_c!=-1 && last_c!=separator ; last_c = GetChar() )
|
|
||||||
{
|
|
||||||
if( recognize_special_chars )
|
|
||||||
CheckSpecialChar();
|
|
||||||
|
|
||||||
if( last_c != -1 )
|
|
||||||
last_value += last_c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( last_c == separator )
|
|
||||||
last_c = GetChar();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void HttpSimpleParser::Parse()
|
|
||||||
{
|
|
||||||
for( last_c = GetChar() ; last_c != -1 ; )
|
|
||||||
{
|
|
||||||
last_name.clear();
|
|
||||||
last_value.clear();
|
|
||||||
|
|
||||||
if( read_name )
|
|
||||||
ReadName();
|
|
||||||
|
|
||||||
ReadValue();
|
|
||||||
|
|
||||||
if( skip_white_chars )
|
|
||||||
{
|
|
||||||
TrimWhiteChars(last_name);
|
|
||||||
TrimWhiteChars(last_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
Parameter(last_name, last_value); // user definied function
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_httpsimpleparser
|
|
||||||
#define headerfile_winix_core_httpsimpleparser
|
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class HttpSimpleParser
|
|
||||||
{
|
|
||||||
protected:
|
|
||||||
|
|
||||||
bool read_name;
|
|
||||||
bool value_can_be_quoted;
|
|
||||||
bool skip_white_chars;
|
|
||||||
bool recognize_special_chars;
|
|
||||||
|
|
||||||
int ParseHalfHex(int c);
|
|
||||||
void ReadName();
|
|
||||||
void ReadQuotedValue();
|
|
||||||
void ReadValue();
|
|
||||||
|
|
||||||
std::string last_name;
|
|
||||||
std::string last_value;
|
|
||||||
|
|
||||||
int last_c;
|
|
||||||
int separator;
|
|
||||||
|
|
||||||
// '-1' means end (eof)
|
|
||||||
virtual int GetChar() = 0;
|
|
||||||
virtual void Parameter(std::string & last_name, std::string & last_value) = 0;
|
|
||||||
|
|
||||||
void ToLower(std::string & s);
|
|
||||||
bool IsWhite(int c);
|
|
||||||
|
|
||||||
void SkipWhiteChars();
|
|
||||||
void TrimWhiteChars(std::string & s);
|
|
||||||
void CheckSpecialChar();
|
|
||||||
|
|
||||||
void Parse();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
HttpSimpleParser()
|
|
||||||
{
|
|
||||||
separator = '&';
|
|
||||||
read_name = true;
|
|
||||||
value_can_be_quoted = false;
|
|
||||||
skip_white_chars = false;
|
|
||||||
recognize_special_chars = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_ipbancontainer
|
|
||||||
#define headerfile_winix_core_ipbancontainer
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include "ipban.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class IPBanContainer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
IPBanContainer();
|
|
||||||
|
|
||||||
IPBan & AddIP(int ip);
|
|
||||||
IPBan * FindIP(int ip);
|
|
||||||
void Sort();
|
|
||||||
size_t Size();
|
|
||||||
IPBan & GetIPBan(size_t index);
|
|
||||||
void SetMaxSize(size_t soft_size, size_t size);
|
|
||||||
void RemoveIP(int ip);
|
|
||||||
void Clear();
|
|
||||||
bool IsSorted();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::vector<IPBan> ipban_tab;
|
|
||||||
bool is_ipban_tab_sorted;
|
|
||||||
size_t soft_max_size, max_size;
|
|
||||||
std::vector<size_t> sort_helper_tab;
|
|
||||||
|
|
||||||
static bool SortIPBansFunction(const IPBan & ip1, const IPBan & ip2);
|
|
||||||
void RemoveOldRecords();
|
|
||||||
void PrintTab();
|
|
||||||
void PrintTab2();
|
|
||||||
|
|
||||||
struct SortByLastUsedHelper
|
|
||||||
{
|
|
||||||
IPBanContainer * container;
|
|
||||||
|
|
||||||
SortByLastUsedHelper(IPBanContainer * c) : container(c) {}
|
|
||||||
bool operator()(size_t index1, size_t index2);
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "item.h"
|
|
||||||
#include "misc.h"
|
|
||||||
#include "crypt.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Item::Item()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// !! IMPROVE ME
|
|
||||||
// now we have Request::start_time and Request::start_date
|
|
||||||
// we can somehow get the current time from the request
|
|
||||||
// may setting the date should be completetly removed from here?
|
|
||||||
void Item::SetDateToNow()
|
|
||||||
{
|
|
||||||
date_creation = std::time(0);
|
|
||||||
date_modification = date_creation;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Item::SetDateModifyToNow()
|
|
||||||
{
|
|
||||||
date_modification = std::time(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Item::Clear()
|
|
||||||
{
|
|
||||||
id = -1;
|
|
||||||
|
|
||||||
user_id = -1;
|
|
||||||
group_id = -1;
|
|
||||||
privileges = 0;
|
|
||||||
modification_user_id = -1;
|
|
||||||
|
|
||||||
guest_name.clear();
|
|
||||||
|
|
||||||
subject.clear();
|
|
||||||
content.clear();
|
|
||||||
modify_index = 0;
|
|
||||||
url.clear();
|
|
||||||
|
|
||||||
content_type = ct_formatted_text;
|
|
||||||
|
|
||||||
type = none;
|
|
||||||
parent_id = -1;
|
|
||||||
|
|
||||||
link_to.clear();
|
|
||||||
link_redirect = false;
|
|
||||||
|
|
||||||
content_id = -1;
|
|
||||||
ref = 1;
|
|
||||||
|
|
||||||
file_path.clear();
|
|
||||||
file_fs = -1;
|
|
||||||
file_type = WINIX_ITEM_FILETYPE_NONE;
|
|
||||||
hash.clear();
|
|
||||||
hash_type = WINIX_CRYPT_HASH_NONE;
|
|
||||||
file_size = 0;
|
|
||||||
has_thumb = false;
|
|
||||||
|
|
||||||
html_template.clear();
|
|
||||||
sort_index = 0;
|
|
||||||
meta.Clear();
|
|
||||||
ameta.Clear();
|
|
||||||
|
|
||||||
SetDateToNow();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
82
core/job.h
82
core/job.h
@@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_jobs
|
|
||||||
#define headerfile_winix_core_jobs
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <queue>
|
|
||||||
#include "basethread.h"
|
|
||||||
#include "space/space.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_JOBS_HOW_MANY_PRIORITIES 32
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Job : public BaseThread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Job();
|
|
||||||
|
|
||||||
/*
|
|
||||||
add a new job to the queue
|
|
||||||
priority: 0-31 (0 - the lowest priority, 31 - the highest priority)
|
|
||||||
*/
|
|
||||||
void Add(PT::Space & job, int priority = 0);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
queue size, and size of all jobs in any priority
|
|
||||||
*/
|
|
||||||
size_t Size(int priority) const;
|
|
||||||
size_t Size() const;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
true if specified queue is empty
|
|
||||||
or if all queues are empty
|
|
||||||
*/
|
|
||||||
bool Empty(int priority) const;
|
|
||||||
bool Empty() const;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
typedef std::queue<PT::Space> JobsQueue;
|
|
||||||
typedef std::vector<JobsQueue> JobsQueueTab;
|
|
||||||
JobsQueueTab jobs_queue_tab;
|
|
||||||
|
|
||||||
void CheckPriority(int & priority) const;
|
|
||||||
void SaveToFile();
|
|
||||||
void ReadFromFile();
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
second thread
|
|
||||||
*/
|
|
||||||
|
|
||||||
// standard winix jobs
|
|
||||||
// Image image;
|
|
||||||
// sending emails
|
|
||||||
// etc.
|
|
||||||
|
|
||||||
bool SignalReceived();
|
|
||||||
void Do();
|
|
||||||
void DoQueue(JobsQueue & jobs_queue);
|
|
||||||
void DoJob(PT::Space & job);
|
|
||||||
void DoWinixJob(PT::Space & job);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2009, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_lastcontainer
|
|
||||||
#define headerfile_winix_core_lastcontainer
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <list>
|
|
||||||
#include <cstring>
|
|
||||||
#include <ctime>
|
|
||||||
#include "date/date.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// how many items we store in the 'last' function
|
|
||||||
#define WINIX_LASTCONTAINER_TABLE_SIZE 100
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct LastItem
|
|
||||||
{
|
|
||||||
long user_id;
|
|
||||||
|
|
||||||
// additional we store the whole string-name
|
|
||||||
// (you can delete a user from the database but we can still print the name)
|
|
||||||
std::wstring name;
|
|
||||||
|
|
||||||
// ip address
|
|
||||||
unsigned int ip;
|
|
||||||
|
|
||||||
// session id (used when logging out)
|
|
||||||
long session_id;
|
|
||||||
|
|
||||||
// start logging and end logging
|
|
||||||
PT::Date start;
|
|
||||||
PT::Date end;
|
|
||||||
|
|
||||||
|
|
||||||
LastItem();
|
|
||||||
bool IsLoggedOut();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class LastContainer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef std::list<LastItem> LastTab;
|
|
||||||
typedef LastTab::iterator Iterator;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Iterator Begin();
|
|
||||||
Iterator End();
|
|
||||||
void UserLogin(long user_id, const std::wstring & name, unsigned int ip, long session_id);
|
|
||||||
void UserLogout(long user_id, long session_id);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
LastTab last_tab;
|
|
||||||
Iterator FindNotLoggedOut(long user_id, long session_id);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "lock.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Lock::Lock()
|
|
||||||
{
|
|
||||||
synchro = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Lock::Lock(Synchro * synchro_)
|
|
||||||
{
|
|
||||||
synchro = synchro_;
|
|
||||||
synchro->Lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Lock::Lock(Synchro & synchro_)
|
|
||||||
{
|
|
||||||
synchro = &synchro_;
|
|
||||||
synchro->Lock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Lock::~Lock()
|
|
||||||
{
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Lock::Unlock()
|
|
||||||
{
|
|
||||||
if( synchro )
|
|
||||||
{
|
|
||||||
synchro->Unlock();
|
|
||||||
synchro = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
37
core/lock.h
37
core/lock.h
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_lock
|
|
||||||
#define headerfile_winix_core_lock
|
|
||||||
|
|
||||||
#include "synchro.h"
|
|
||||||
|
|
||||||
|
|
||||||
class Lock
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Lock(Synchro * synchro_);
|
|
||||||
Lock(Synchro & synchro_);
|
|
||||||
|
|
||||||
~Lock();
|
|
||||||
|
|
||||||
void Unlock();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Synchro * synchro;
|
|
||||||
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
480
core/log.cpp
480
core/log.cpp
@@ -1,480 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "log.h"
|
|
||||||
#include <ctime>
|
|
||||||
#include <string.h>
|
|
||||||
#include "utf8/utf8.h"
|
|
||||||
#include "timezones.h"
|
|
||||||
|
|
||||||
|
|
||||||
Log::Log()
|
|
||||||
{
|
|
||||||
log_level = 1;
|
|
||||||
current_level = 100; // nothing to log (call Init() first)
|
|
||||||
request = 0;
|
|
||||||
max_requests = 1;
|
|
||||||
lines = 0;
|
|
||||||
max_lines = 5000;
|
|
||||||
log_file_open = false;
|
|
||||||
time_zones = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Log::~Log()
|
|
||||||
{
|
|
||||||
SaveLogAndClear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Log::SetTimeZones(TimeZones * ptime_zones)
|
|
||||||
{
|
|
||||||
time_zones = ptime_zones;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int Log::LogLevel()
|
|
||||||
{
|
|
||||||
return log_level;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Log::Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests)
|
|
||||||
{
|
|
||||||
log_level = log_level_;
|
|
||||||
log_file = log_file_;
|
|
||||||
log_stdout = log_std;
|
|
||||||
max_requests = log_max_requests;
|
|
||||||
save_each_line = save_each_line_;
|
|
||||||
|
|
||||||
// don't open the file here
|
|
||||||
// because it would be created with the root as an owner
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::OpenFile()
|
|
||||||
{
|
|
||||||
if( !log_file.empty() )
|
|
||||||
{
|
|
||||||
file.open( log_file.c_str(), std::ios_base::out | std::ios_base::app );
|
|
||||||
log_file_open = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::PrintDate(const PT::Date & date, size_t time_zone_id)
|
|
||||||
{
|
|
||||||
if( time_zones )
|
|
||||||
{
|
|
||||||
TimeZone * tz = time_zones->GetZone(time_zone_id);
|
|
||||||
|
|
||||||
if( tz )
|
|
||||||
{
|
|
||||||
PT::Date local_date = tz->ToLocal(date);
|
|
||||||
log << local_date;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(*this) << date << " UTC"; // unknown time zone identifier
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
(*this) << date << " UTC"; // time_zones object was not set
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const void * s)
|
|
||||||
{
|
|
||||||
if( current_level > log_level )
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
buffer << s;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const char * s)
|
|
||||||
{
|
|
||||||
if( current_level > log_level )
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
if( !s )
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
buffer << s;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const std::string & s)
|
|
||||||
{
|
|
||||||
if( current_level > log_level )
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
buffer << s;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const std::string * s)
|
|
||||||
{
|
|
||||||
if( current_level > log_level )
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
buffer << *s;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const wchar_t * s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
if( s )
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const std::wstring & s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const std::wstring * s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << *s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(int s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(long s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(char s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(wchar_t s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(size_t s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(double s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const PT::Space & s)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << s;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(const PT::Date & date)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << date;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log & Log::operator<<(LogManipulators m)
|
|
||||||
{
|
|
||||||
switch(m)
|
|
||||||
{
|
|
||||||
case logend:
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
buffer << '\n';
|
|
||||||
lines += 1;
|
|
||||||
|
|
||||||
if( save_each_line )
|
|
||||||
SaveLogAndClear();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case logsave:
|
|
||||||
SaveLogAndClear();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case logendrequest:
|
|
||||||
if( ++request >= max_requests || lines > max_lines )
|
|
||||||
SaveLogAndClear();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case log1:
|
|
||||||
current_level = 1;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case log2:
|
|
||||||
current_level = 2;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case log3:
|
|
||||||
current_level = 3;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case log4:
|
|
||||||
current_level = 4;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
char Log::GetHEXdigit(unsigned char c)
|
|
||||||
{
|
|
||||||
if( c < 10 )
|
|
||||||
return c + '0';
|
|
||||||
|
|
||||||
return c - 10 + 'A';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Log::ToHEX(char * buf, unsigned char c)
|
|
||||||
{
|
|
||||||
buf[0] = GetHEXdigit(c >> 4);
|
|
||||||
buf[1] = GetHEXdigit(c & 0xf);
|
|
||||||
buf[2] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::LogBinary(const char * blob, size_t blob_len)
|
|
||||||
{
|
|
||||||
size_t i=0;
|
|
||||||
char buf[3];
|
|
||||||
|
|
||||||
|
|
||||||
while( i < blob_len )
|
|
||||||
{
|
|
||||||
size_t oldi = i;
|
|
||||||
|
|
||||||
for(size_t a=0 ; a<16 ; ++a)
|
|
||||||
{
|
|
||||||
if( i < blob_len )
|
|
||||||
{
|
|
||||||
ToHEX(buf, blob[i]);
|
|
||||||
buffer << buf << ' ';
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
buffer << " ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if( a == 7 )
|
|
||||||
{
|
|
||||||
if( i < blob_len )
|
|
||||||
buffer << "- ";
|
|
||||||
else
|
|
||||||
buffer << " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i = oldi;
|
|
||||||
buffer << ' ';
|
|
||||||
|
|
||||||
for(size_t a=0 ; a<16 && i<blob_len ; ++a, ++i)
|
|
||||||
{
|
|
||||||
if( blob[i] > 31 && blob[i] < 127 )
|
|
||||||
buffer << blob[i];
|
|
||||||
else
|
|
||||||
buffer << '.';
|
|
||||||
}
|
|
||||||
|
|
||||||
(*this) << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::LogBinary(const std::string & blob)
|
|
||||||
{
|
|
||||||
LogBinary(blob.c_str(), blob.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::SystemErr(int err)
|
|
||||||
{
|
|
||||||
(*this) << "errno: " << err;
|
|
||||||
|
|
||||||
const char * err_msg = strerror(err);
|
|
||||||
|
|
||||||
if( err_msg )
|
|
||||||
(*this) << " (" << err_msg << ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::SaveLogAndClear()
|
|
||||||
{
|
|
||||||
SaveLog();
|
|
||||||
|
|
||||||
buffer.Clear();
|
|
||||||
request = 0;
|
|
||||||
lines = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Log::SaveLog()
|
|
||||||
{
|
|
||||||
if( buffer.Str().empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( log_stdout )
|
|
||||||
PT::WideToUTF8(buffer.Str(), std::cout);
|
|
||||||
|
|
||||||
if( log_file.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( !log_file_open || !file )
|
|
||||||
{
|
|
||||||
file.close();
|
|
||||||
file.clear();
|
|
||||||
|
|
||||||
OpenFile();
|
|
||||||
|
|
||||||
if( !file )
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
PT::WideToUTF8(buffer.Str(), file);
|
|
||||||
file.flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
163
core/log.h
163
core/log.h
@@ -1,163 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_log
|
|
||||||
#define headerfile_winix_core_log
|
|
||||||
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
#include <fstream>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include "textstream.h"
|
|
||||||
#include "logmanipulators.h"
|
|
||||||
#include "textstream/textstream.h"
|
|
||||||
|
|
||||||
|
|
||||||
class TimeZones;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Log
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Log();
|
|
||||||
~Log();
|
|
||||||
|
|
||||||
void SetTimeZones(TimeZones * ptime_zones);
|
|
||||||
void Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests);
|
|
||||||
|
|
||||||
Log & operator<<(const void * s);
|
|
||||||
Log & operator<<(const char * s);
|
|
||||||
Log & operator<<(const std::string * s);
|
|
||||||
Log & operator<<(const std::string & s);
|
|
||||||
Log & operator<<(const wchar_t * s);
|
|
||||||
Log & operator<<(const std::wstring * s);
|
|
||||||
Log & operator<<(const std::wstring & s);
|
|
||||||
Log & operator<<(int s);
|
|
||||||
Log & operator<<(long s);
|
|
||||||
Log & operator<<(char s);
|
|
||||||
Log & operator<<(wchar_t s);
|
|
||||||
Log & operator<<(size_t s);
|
|
||||||
Log & operator<<(double s);
|
|
||||||
Log & operator<<(const PT::Space & space);
|
|
||||||
Log & operator<<(LogManipulators m);
|
|
||||||
Log & operator<<(const PT::Date & date);
|
|
||||||
|
|
||||||
void PrintDate(const PT::Date & date, size_t time_zone_id);
|
|
||||||
|
|
||||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
||||||
Log & operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf);
|
|
||||||
|
|
||||||
|
|
||||||
template<class StringType>
|
|
||||||
void LogString(const StringType & value, size_t max_size);
|
|
||||||
|
|
||||||
void LogBinary(const char * blob, size_t blob_len);
|
|
||||||
void LogBinary(const std::string & blob);
|
|
||||||
|
|
||||||
|
|
||||||
void SystemErr(int err);
|
|
||||||
void SaveLog();
|
|
||||||
void SaveLogAndClear();
|
|
||||||
|
|
||||||
int LogLevel();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// time zones for printing the time in the log file
|
|
||||||
TimeZones * time_zones;
|
|
||||||
|
|
||||||
// buffer for the log
|
|
||||||
TextStream<std::wstring> buffer;
|
|
||||||
|
|
||||||
// log lovel from the config file
|
|
||||||
int log_level;
|
|
||||||
|
|
||||||
// current level set by a modifier (e.g. log << log3)
|
|
||||||
int current_level;
|
|
||||||
|
|
||||||
// current request for logging
|
|
||||||
// starts from zero and incremented after logendrequest modifier
|
|
||||||
int request;
|
|
||||||
|
|
||||||
// how many request to save at once
|
|
||||||
int max_requests;
|
|
||||||
|
|
||||||
// file log
|
|
||||||
std::string log_file;
|
|
||||||
std::ofstream file;
|
|
||||||
|
|
||||||
// logging to stdout
|
|
||||||
bool log_stdout;
|
|
||||||
|
|
||||||
// how many lines there are in the buffer
|
|
||||||
int lines;
|
|
||||||
|
|
||||||
// is the config file already open
|
|
||||||
bool log_file_open;
|
|
||||||
|
|
||||||
// how many lines can be in the config buffer
|
|
||||||
// default: 5000
|
|
||||||
int max_lines;
|
|
||||||
|
|
||||||
// whether to save each line (for debug)
|
|
||||||
bool save_each_line;
|
|
||||||
|
|
||||||
void OpenFile();
|
|
||||||
char GetHEXdigit(unsigned char c);
|
|
||||||
void ToHEX(char * buf, unsigned char c);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class StringType>
|
|
||||||
void Log::LogString(const StringType & value, size_t max_size)
|
|
||||||
{
|
|
||||||
size_t min_size = value.size() < max_size ? value.size() : max_size;
|
|
||||||
|
|
||||||
if( current_level <= log_level )
|
|
||||||
{
|
|
||||||
for(size_t i=0 ; i<min_size ; ++i)
|
|
||||||
{
|
|
||||||
if( value[i] < 32 )
|
|
||||||
buffer << '.';
|
|
||||||
else
|
|
||||||
buffer << value[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
||||||
Log & Log::operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
|
|
||||||
{
|
|
||||||
if( current_level <= log_level )
|
|
||||||
buffer << buf;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern Log log;
|
|
||||||
extern Log nlog;
|
|
||||||
|
|
||||||
// for convenience, we have to use only #include "log.h" in the winix
|
|
||||||
#include "slog.h"
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_logmanipulators
|
|
||||||
#define headerfile_winix_core_logmanipulators
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
log1 - the first level
|
|
||||||
log2
|
|
||||||
log3
|
|
||||||
log4 - the last level (debug level)
|
|
||||||
logend - the end of a line
|
|
||||||
logendrequest - end of a current request
|
|
||||||
logsave - current log buffer is saved and cleared
|
|
||||||
|
|
||||||
manipulators used by the session logger (SLog)
|
|
||||||
loginfo - normal info to a user
|
|
||||||
logerror - we are reporting an error
|
|
||||||
logwarning - we are reporting a warning
|
|
||||||
|
|
||||||
make sure that loginfo, logerror and logwarning have values less than 32 (space)
|
|
||||||
their are used as control codes in a string
|
|
||||||
*/
|
|
||||||
enum LogManipulators
|
|
||||||
{
|
|
||||||
log1,
|
|
||||||
log2,
|
|
||||||
log3,
|
|
||||||
log4,
|
|
||||||
logend,
|
|
||||||
logendrequest,
|
|
||||||
logsave,
|
|
||||||
|
|
||||||
loginfo,
|
|
||||||
logerror,
|
|
||||||
logwarning
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
71
core/mount.h
71
core/mount.h
@@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2009-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_mount
|
|
||||||
#define headerfile_winix_core_mount
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Mount
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
struct ParamRow
|
|
||||||
{
|
|
||||||
typedef std::vector<std::wstring> ParamArg;
|
|
||||||
|
|
||||||
bool defined;
|
|
||||||
ParamArg arg;
|
|
||||||
|
|
||||||
ParamRow() { defined = false; }
|
|
||||||
void Clear() { defined = false; arg.clear(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef std::vector<ParamRow> Param;
|
|
||||||
|
|
||||||
|
|
||||||
long dir_id;
|
|
||||||
int type;
|
|
||||||
int fs;
|
|
||||||
Param param;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Mount();
|
|
||||||
void ClearParams();
|
|
||||||
|
|
||||||
bool IsPar(int code);
|
|
||||||
|
|
||||||
bool IsArg(int code, const wchar_t * arg);
|
|
||||||
bool IsArg(int code, const std::wstring & arg);
|
|
||||||
bool IsArg(int code, int arg);
|
|
||||||
|
|
||||||
// returning the arg argument if defined (or an empty string)
|
|
||||||
const std::wstring & Arg(int code, int arg) const;
|
|
||||||
|
|
||||||
// returning the first argument (arg=0) if defined (or an empty string)
|
|
||||||
const std::wstring & FirstArg(int code) const;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// for Arg() methods when the argument is not defined
|
|
||||||
const std::wstring empty_str;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "plugindata.h"
|
|
||||||
#include "plugin.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "session.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginData::PluginData()
|
|
||||||
{
|
|
||||||
session = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginData::PluginData(const PluginData & p)
|
|
||||||
{
|
|
||||||
operator=(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginData & PluginData::operator=(const PluginData & p)
|
|
||||||
{
|
|
||||||
// we don't copy all pointers - only resize the table
|
|
||||||
// pointers will be set to zero
|
|
||||||
Resize(p.Size());
|
|
||||||
session = 0;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginData::~PluginData()
|
|
||||||
{
|
|
||||||
DeleteAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PluginData::SetSession(Session * ses)
|
|
||||||
{
|
|
||||||
session = ses;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PluginData::Assign(size_t index, PluginDataBase * data)
|
|
||||||
{
|
|
||||||
if( index >= table.size() )
|
|
||||||
Resize(index+1);
|
|
||||||
|
|
||||||
table[index] = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void PluginData::Assign(PluginDataBase * data)
|
|
||||||
{
|
|
||||||
if( plugin.current_plugin == -1 )
|
|
||||||
{
|
|
||||||
log << log1 << "PD: Assign(PluginDataBase*) should be called only from plugins" << logend;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Assign(plugin.current_plugin, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
PluginDataBase * PluginData::Get(size_t index)
|
|
||||||
{
|
|
||||||
if( index >= table.size() )
|
|
||||||
Resize(index+1);
|
|
||||||
|
|
||||||
return table[index];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PluginDataBase * PluginData::Get()
|
|
||||||
{
|
|
||||||
if( plugin.current_plugin == -1 )
|
|
||||||
{
|
|
||||||
log << log1 << "PD: Get() should be called only from plugins" << logend;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Get(plugin.current_plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PluginData::DeleteAll()
|
|
||||||
{
|
|
||||||
bool all_null = true;
|
|
||||||
|
|
||||||
/*
|
|
||||||
when we copy a session's object (and this object then)
|
|
||||||
we resize the table and there are only null pointers there
|
|
||||||
consequently if all pointers are null there is no sens
|
|
||||||
to send WINIX_PLUGIN_SESSION_DATA_REMOVE
|
|
||||||
*/
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<table.size() ; ++i)
|
|
||||||
{
|
|
||||||
if( table[i] != 0 )
|
|
||||||
{
|
|
||||||
all_null = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
in the future this message may be removed
|
|
||||||
and we directly 'delete' the pointers
|
|
||||||
*/
|
|
||||||
|
|
||||||
if( !all_null )
|
|
||||||
plugin.Call(session, WINIX_PLUGIN_SESSION_DATA_REMOVE);
|
|
||||||
|
|
||||||
table.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
size_t PluginData::Size() const
|
|
||||||
{
|
|
||||||
return table.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PluginData::Resize(size_t new_size)
|
|
||||||
{
|
|
||||||
size_t old_size = table.size();
|
|
||||||
|
|
||||||
if( old_size == new_size )
|
|
||||||
return;
|
|
||||||
|
|
||||||
table.resize(new_size);
|
|
||||||
|
|
||||||
for(size_t i = old_size ; i<new_size ; ++i)
|
|
||||||
table[i] = 0;
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_plugindata
|
|
||||||
#define headerfile_winix_core_plugindata
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
struct Session;
|
|
||||||
|
|
||||||
|
|
||||||
struct PluginDataBase
|
|
||||||
{
|
|
||||||
virtual ~PluginDataBase() {}
|
|
||||||
|
|
||||||
/*
|
|
||||||
!! CHECK ME
|
|
||||||
it is still in use?
|
|
||||||
|
|
||||||
when deleting sessions we first call Clear() method
|
|
||||||
consequently the destructor has nothing to do
|
|
||||||
(and it does not throw an exception)
|
|
||||||
*/
|
|
||||||
virtual void Clear() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PluginData
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
PluginData();
|
|
||||||
PluginData(const PluginData & p);
|
|
||||||
PluginData & operator=(const PluginData & p);
|
|
||||||
~PluginData();
|
|
||||||
|
|
||||||
void SetSession(Session * ses);
|
|
||||||
|
|
||||||
void Assign(size_t index, PluginDataBase * data);
|
|
||||||
void Assign(PluginDataBase * data);
|
|
||||||
|
|
||||||
PluginDataBase * Get(size_t index);
|
|
||||||
PluginDataBase * Get();
|
|
||||||
|
|
||||||
void DeleteAll();
|
|
||||||
|
|
||||||
size_t Size() const;
|
|
||||||
void Resize(size_t new_size);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Session * session;
|
|
||||||
std::vector<PluginDataBase*> table;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_postparser
|
|
||||||
#define headerfile_winix_core_postparser
|
|
||||||
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include <string>
|
|
||||||
#include "httpsimpleparser.h"
|
|
||||||
#include "requesttypes.h"
|
|
||||||
#include "misc.h"
|
|
||||||
#include "utf8/utf8.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "plugin.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class PostParser : public HttpSimpleParser
|
|
||||||
{
|
|
||||||
|
|
||||||
FCGX_Stream * in;
|
|
||||||
PostTab * post_tab;
|
|
||||||
std::wstring temp_name, temp_value;
|
|
||||||
bool input_as_utf8;
|
|
||||||
size_t log_value_size;
|
|
||||||
int var_index;
|
|
||||||
bool has_winix_post_params_msg;
|
|
||||||
bool has_winix_raw_post_msg;
|
|
||||||
std::string raw_post;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
|
|
||||||
virtual int GetChar()
|
|
||||||
{
|
|
||||||
int c = FCGX_GetChar(in);
|
|
||||||
|
|
||||||
if( c != -1 && has_winix_raw_post_msg )
|
|
||||||
raw_post += c;
|
|
||||||
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CreateLog(bool param_added)
|
|
||||||
{
|
|
||||||
log << log2 << "Method POST, name: \"" << temp_name << "\"";
|
|
||||||
|
|
||||||
if( log_value_size > 0 && !IsSubStringNoCase(L"pass", temp_name.c_str()) )
|
|
||||||
{
|
|
||||||
log << ", value: ";
|
|
||||||
|
|
||||||
if( temp_value.size() > log_value_size )
|
|
||||||
log << "(first " << log_value_size << " characters) ";
|
|
||||||
|
|
||||||
log << "\"";
|
|
||||||
log.LogString(temp_value, log_value_size);
|
|
||||||
log << "\" (size: " << temp_value.size() << ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
if( param_added == false )
|
|
||||||
log << log2 << " (skipped)";
|
|
||||||
|
|
||||||
log << log2 << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ConvStr(const std::string & src, std::wstring & dst)
|
|
||||||
{
|
|
||||||
if( input_as_utf8 )
|
|
||||||
PT::UTF8ToWide(src, dst);
|
|
||||||
else
|
|
||||||
AssignString(src, dst);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
virtual void Parameter(std::string & name, std::string & value)
|
|
||||||
{
|
|
||||||
bool added;
|
|
||||||
std::pair<PostTab::iterator, bool> res;
|
|
||||||
|
|
||||||
if( has_winix_post_params_msg )
|
|
||||||
plugin.Call(0, WINIX_POST_PARAMS, &name, &value);
|
|
||||||
|
|
||||||
ConvStr(name, temp_name);
|
|
||||||
ConvStr(value, temp_value);
|
|
||||||
|
|
||||||
res = post_tab->insert( std::make_pair(temp_name, temp_value) );
|
|
||||||
added = res.second;
|
|
||||||
|
|
||||||
if( !added )
|
|
||||||
{
|
|
||||||
temp_name += L"_inc";
|
|
||||||
temp_name += Toa(var_index);
|
|
||||||
res = post_tab->insert( std::make_pair(temp_name, temp_value) );
|
|
||||||
added = res.second;
|
|
||||||
var_index += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateLog(added);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
PostParser()
|
|
||||||
{
|
|
||||||
input_as_utf8 = false;
|
|
||||||
log_value_size = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UTF8(bool utf)
|
|
||||||
{
|
|
||||||
input_as_utf8 = utf;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LogValueSize(size_t s)
|
|
||||||
{
|
|
||||||
log_value_size = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Parse(FCGX_Stream * in_, PostTab & post_tab_)
|
|
||||||
{
|
|
||||||
in = in_;
|
|
||||||
post_tab = &post_tab_;
|
|
||||||
var_index = 1;
|
|
||||||
raw_post.clear();
|
|
||||||
|
|
||||||
has_winix_post_params_msg = plugin.HasMessage(WINIX_POST_PARAMS);
|
|
||||||
has_winix_raw_post_msg = plugin.HasMessage(WINIX_RAW_POST_STRING);
|
|
||||||
|
|
||||||
HttpSimpleParser::Parse();
|
|
||||||
|
|
||||||
if( has_winix_raw_post_msg )
|
|
||||||
plugin.Call(0, WINIX_RAW_POST_STRING, &raw_post);
|
|
||||||
|
|
||||||
raw_post.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
51
core/rebus.h
51
core/rebus.h
@@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_rebus
|
|
||||||
#define headerfile_winix_core_rebus
|
|
||||||
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
struct Cur;
|
|
||||||
|
|
||||||
|
|
||||||
class Rebus
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
struct Item
|
|
||||||
{
|
|
||||||
int key;
|
|
||||||
std::wstring question;
|
|
||||||
int answer;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SetCur(Cur * pcur);
|
|
||||||
void Init();
|
|
||||||
Item * Rand();
|
|
||||||
bool IsAnswerOk(Item * item, const std::wstring & answer);
|
|
||||||
bool CheckRebus();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Cur * cur;
|
|
||||||
|
|
||||||
bool InitPair(int a, int b, Item & item);
|
|
||||||
|
|
||||||
std::vector<Item> table;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
235
core/request.h
235
core/request.h
@@ -1,235 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_request
|
|
||||||
#define headerfile_winix_core_request
|
|
||||||
|
|
||||||
#include <fcgiapp.h>
|
|
||||||
#include <sstream>
|
|
||||||
#include <vector>
|
|
||||||
#include "requesttypes.h"
|
|
||||||
#include "item.h"
|
|
||||||
#include "error.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "textstream.h"
|
|
||||||
#include "templates/htmltextstream.h"
|
|
||||||
#include "date/date.h"
|
|
||||||
#include "space/space.h"
|
|
||||||
#include "space/spacetojson.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionBase;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Request
|
|
||||||
{
|
|
||||||
// request id
|
|
||||||
// is incremented for each request and is never 0
|
|
||||||
// (from -1 will be incremented twice)
|
|
||||||
// it's used for some optimalizations e.g. in templates
|
|
||||||
size_t id;
|
|
||||||
|
|
||||||
// !! moze pozbyc sie tego none?
|
|
||||||
enum Method { get, post, head, none } method;
|
|
||||||
enum Role { responder, authorizer } role;
|
|
||||||
|
|
||||||
// headers, page and debug
|
|
||||||
//std::ostringstream headers, page, debug;
|
|
||||||
TextStream<std::string> headers;
|
|
||||||
HtmlTextStream page, debug;
|
|
||||||
TextStream<std::wstring> ajaxpage;
|
|
||||||
|
|
||||||
// binary page
|
|
||||||
BinaryPage binary_page;
|
|
||||||
|
|
||||||
// a compressed page ready to send to the client
|
|
||||||
BinaryPage compressed_page;
|
|
||||||
|
|
||||||
// if true then either page or ajaxpage will be sent to the client
|
|
||||||
// if false then binary_page is sent
|
|
||||||
// default: true
|
|
||||||
bool use_text_page;
|
|
||||||
|
|
||||||
// if set to true then the standard template system will not be generated
|
|
||||||
// default: false
|
|
||||||
bool page_generated;
|
|
||||||
|
|
||||||
// whether or not the html filter should be used
|
|
||||||
// default: true
|
|
||||||
bool use_html_filter;
|
|
||||||
|
|
||||||
// raw parameters
|
|
||||||
PostTab post_tab;
|
|
||||||
PostFileTab post_file_tab;
|
|
||||||
CookieTab cookie_tab;
|
|
||||||
|
|
||||||
// html anchor (those part of URI after '#' character)
|
|
||||||
std::wstring anchor;
|
|
||||||
|
|
||||||
// environment variables
|
|
||||||
// they are not null -- when the server doesn't have such a variable
|
|
||||||
// it will be pointing into 'char_empty' which is default '\0'
|
|
||||||
const char * env_request_method;
|
|
||||||
const char * env_request_uri;
|
|
||||||
const char * env_http_cookie;
|
|
||||||
const char * env_remote_addr;
|
|
||||||
const char * env_http_host;
|
|
||||||
const char * env_http_user_agent;
|
|
||||||
const char * env_http_accept_encoding;
|
|
||||||
const char * env_fcgi_role;
|
|
||||||
const char * env_content_type;
|
|
||||||
const char * env_https;
|
|
||||||
|
|
||||||
// current IP address of the remote host (read from REMOTE_ADDR environment variable)
|
|
||||||
// (at the moment only IPv4 are supported)
|
|
||||||
int ip;
|
|
||||||
|
|
||||||
// true if the browser is Microsoft Internet Explorer
|
|
||||||
bool browser_msie;
|
|
||||||
|
|
||||||
// true if the browser is Konqueror
|
|
||||||
bool browser_konqueror;
|
|
||||||
|
|
||||||
// true if we are using encrypted connection (SSL)
|
|
||||||
bool using_ssl;
|
|
||||||
|
|
||||||
// current directory
|
|
||||||
std::vector<Item*> dir_tab;
|
|
||||||
|
|
||||||
// true if a file exists
|
|
||||||
bool is_item;
|
|
||||||
|
|
||||||
// current file (if exists)
|
|
||||||
Item item;
|
|
||||||
|
|
||||||
// current winix function
|
|
||||||
// null if there is no a function
|
|
||||||
FunctionBase * function;
|
|
||||||
|
|
||||||
// parameters (name:value)
|
|
||||||
ParamTab param_tab;
|
|
||||||
|
|
||||||
// request status
|
|
||||||
Error status;
|
|
||||||
|
|
||||||
// usually items in the current directory (depends on the function)
|
|
||||||
std::vector<Item> item_tab;
|
|
||||||
|
|
||||||
// if not empty means an address for redirecting to
|
|
||||||
// it should be url-encoded
|
|
||||||
std::wstring redirect_to;
|
|
||||||
std::string aredirect_to;
|
|
||||||
|
|
||||||
// a redirect type
|
|
||||||
// following redirect types are supported:
|
|
||||||
// 300 Multiple Choices
|
|
||||||
// 301 Moved Permanently
|
|
||||||
// 302 Found
|
|
||||||
// 303 See Other (default)
|
|
||||||
// 307 Temporary Redirect
|
|
||||||
int redirect_type;
|
|
||||||
|
|
||||||
// send header X-LIGHTTPD-send-file with path to a file
|
|
||||||
std::wstring x_sendfile;
|
|
||||||
|
|
||||||
// send as attachment (causes header: content-disposition: attachment)
|
|
||||||
bool send_as_attachment;
|
|
||||||
|
|
||||||
// this is a pointer either to the item (if exists) or to the last directory
|
|
||||||
Item * last_item;
|
|
||||||
|
|
||||||
// request start time
|
|
||||||
// Time() methods are very slow so it is better to directly use those two values
|
|
||||||
// they are set when a request starts
|
|
||||||
time_t start_time;
|
|
||||||
PT::Date start_date;
|
|
||||||
|
|
||||||
// a subdomain
|
|
||||||
// subdomain = HTTP_HOST environment variable - config->base_url
|
|
||||||
std::wstring subdomain;
|
|
||||||
|
|
||||||
// used as a JSON output (when ajax_serializer is defined)
|
|
||||||
// it will be serialized and have at least:
|
|
||||||
// 'content' string - the whole html content
|
|
||||||
// 'http_status' integer - http status code (e.g. 200) !! FIXME this is not added at the moment
|
|
||||||
PT::Space ajax;
|
|
||||||
|
|
||||||
// if not null then the request will have a JSON as an output
|
|
||||||
PT::SpaceToJSON * ajax_serializer;
|
|
||||||
|
|
||||||
// if this variable is true then winix always return 200 OK header
|
|
||||||
// when the status would be 404 (not found) or 403 (permission denied)
|
|
||||||
// default: false
|
|
||||||
bool use_200_status_for_not_found_and_permission_denied;
|
|
||||||
|
|
||||||
// options used by ezc generators
|
|
||||||
bool gen_trim_white;
|
|
||||||
bool gen_skip_new_line;
|
|
||||||
bool gen_use_special_chars;
|
|
||||||
|
|
||||||
|
|
||||||
Request();
|
|
||||||
void SetConfig(Config * pconfig);
|
|
||||||
void RequestStarts();
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool IsParam(const wchar_t * param_name);
|
|
||||||
bool IsParam(const std::wstring & param_name);
|
|
||||||
|
|
||||||
const std::wstring & ParamValue(const wchar_t * param_name); // returns an empty string if there is no such a parameter
|
|
||||||
const std::wstring & ParamValue(const std::wstring & param_name); // returns an empty string if there is no such a parameter
|
|
||||||
|
|
||||||
void SetCookie(const char * name, const char * value, PT::Date * expires = 0);
|
|
||||||
void SetCookie(const char * name, long value, PT::Date * expires = 0);
|
|
||||||
|
|
||||||
bool IsPostVar(const wchar_t * var);
|
|
||||||
bool IsPostVar(const std::wstring & var);
|
|
||||||
|
|
||||||
const std::wstring & PostVar(const wchar_t * var); // returns an empty string if there is no such a parameter
|
|
||||||
const std::wstring & PostVar(const std::wstring & var); // returns an empty string if there is no such a parameter
|
|
||||||
|
|
||||||
|
|
||||||
bool PostVar(const wchar_t * var, std::wstring & result);
|
|
||||||
bool PostVar(const std::wstring & var, std::wstring & result);
|
|
||||||
|
|
||||||
std::wstring * PostVarp(const wchar_t * var);
|
|
||||||
std::wstring * PostVarp(const std::wstring & var);
|
|
||||||
|
|
||||||
bool AllPostVarEmpty(); // returning true if all post vars are empty
|
|
||||||
|
|
||||||
void SendAll();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Config * config;
|
|
||||||
|
|
||||||
// contains '\0'
|
|
||||||
// used to set env_* pointers to the empty value
|
|
||||||
const char char_empty;
|
|
||||||
|
|
||||||
// used in ParamValue() and PostVar() when there is no such a param
|
|
||||||
const std::wstring str_empty;
|
|
||||||
|
|
||||||
void ClearAjax();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_requesttypes
|
|
||||||
#define headerfile_winix_core_requesttypes
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <map>
|
|
||||||
#include "textstream/textstream.h"
|
|
||||||
|
|
||||||
|
|
||||||
// !! narazie uzywane tylko w post multi parserze
|
|
||||||
// dodac do zwyklego parsera post
|
|
||||||
#define WINIX_POSTTABLE_MAXSIZE 50
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct PostFile
|
|
||||||
{
|
|
||||||
std::wstring filename; // original file name
|
|
||||||
std::wstring tmp_filename; // file with content (in /tmp)
|
|
||||||
size_t file_size;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// parameters from get name:value
|
|
||||||
struct Param
|
|
||||||
{
|
|
||||||
std::wstring name;
|
|
||||||
std::wstring value;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// some global types used by Request class
|
|
||||||
typedef std::map<std::wstring, std::wstring> PostTab;
|
|
||||||
typedef std::map<std::wstring, PostFile> PostFileTab;
|
|
||||||
typedef std::vector<Param> ParamTab;
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> CookieTab;
|
|
||||||
|
|
||||||
|
|
||||||
typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "session.h"
|
|
||||||
#include "misc.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Session::Session()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
plugin_data.SetSession(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Session::Session(const Session & ses)
|
|
||||||
{
|
|
||||||
operator=(ses);
|
|
||||||
}
|
|
||||||
|
|
||||||
Session & Session::operator=(const Session & ses)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
we can only copy ses.id because it is needen in SessionContainer
|
|
||||||
it have indexes to id
|
|
||||||
*/
|
|
||||||
|
|
||||||
Clear();
|
|
||||||
id = ses.id;
|
|
||||||
plugin_data.SetSession(this);
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Session::SetTimesTo(time_t time)
|
|
||||||
{
|
|
||||||
start_time = time;
|
|
||||||
start_date = time;
|
|
||||||
|
|
||||||
last_time = start_time;
|
|
||||||
last_date = start_date;
|
|
||||||
|
|
||||||
// the first request can be a POST (it doesn't matter)
|
|
||||||
last_time_get = start_time;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// clear_plugin_data is used when clearing the temporary session
|
|
||||||
void Session::Clear(bool clear_plugin_data)
|
|
||||||
{
|
|
||||||
id = 0;
|
|
||||||
puser = 0;
|
|
||||||
rebus_item = 0;
|
|
||||||
rebus_checked = false;
|
|
||||||
remember_me = false;
|
|
||||||
new_session = true;
|
|
||||||
spam_score = 0;
|
|
||||||
remove_me = false;
|
|
||||||
|
|
||||||
start_time = 0;
|
|
||||||
last_time = 0;
|
|
||||||
last_time_get = 0;
|
|
||||||
start_date.Clear();
|
|
||||||
last_date.Clear();
|
|
||||||
|
|
||||||
log_buffer.Clear();
|
|
||||||
last_css.clear();
|
|
||||||
ip_ban = 0;
|
|
||||||
|
|
||||||
if( clear_plugin_data )
|
|
||||||
plugin_data.Resize(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// clearing some variables when a request is ended (just for safety)
|
|
||||||
void Session::ClearOnEndRequest()
|
|
||||||
{
|
|
||||||
// ip_ban list can be sorted by SessionManager (in the special thread)
|
|
||||||
ip_ban = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessioncontainer
|
|
||||||
#define headerfile_winix_core_sessioncontainer
|
|
||||||
|
|
||||||
#include <list>
|
|
||||||
#include <map>
|
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
#include "session.h"
|
|
||||||
#include "cur.h"
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionContainer
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef std::list<Session> Table;
|
|
||||||
typedef Table::iterator Iterator;
|
|
||||||
typedef std::map<long, Iterator> IndexId;
|
|
||||||
typedef IndexId::iterator IdIterator;
|
|
||||||
|
|
||||||
|
|
||||||
SessionContainer();
|
|
||||||
|
|
||||||
void SetCur(Cur * pcur);
|
|
||||||
void SetConfig(Config * pconfig);
|
|
||||||
void SetTmpSession(Session * psession);
|
|
||||||
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
size_t Size();
|
|
||||||
Iterator Begin();
|
|
||||||
Iterator End();
|
|
||||||
Session & Back();
|
|
||||||
Iterator AddSession(long id);
|
|
||||||
Iterator FindById(long);
|
|
||||||
|
|
||||||
IdIterator IdBegin();
|
|
||||||
IdIterator IdEnd();
|
|
||||||
|
|
||||||
void EraseById(long id);
|
|
||||||
|
|
||||||
bool ChangeSessionId(Iterator ses, long new_id);
|
|
||||||
bool ChangeSessionId(long old_id, long new_id);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Table table;
|
|
||||||
IndexId index_id;
|
|
||||||
|
|
||||||
Cur * cur;
|
|
||||||
Config * config;
|
|
||||||
Session * tmp_session;
|
|
||||||
|
|
||||||
Session empty_session;
|
|
||||||
|
|
||||||
// in FreeBSD implementation (GCC) list::size() has linear complexity
|
|
||||||
// so we use our own table_size with O(1)
|
|
||||||
size_t table_size;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,605 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include "sessionmanager.h"
|
|
||||||
#include "request.h"
|
|
||||||
#include "log.h"
|
|
||||||
#include "session.h"
|
|
||||||
#include "sessionparser.h"
|
|
||||||
#include "plugin.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SessionManager::SessionManager()
|
|
||||||
{
|
|
||||||
temporary_session.id = 0;
|
|
||||||
session = &temporary_session;
|
|
||||||
session_tab.SetTmpSession(&temporary_session);
|
|
||||||
|
|
||||||
// thread work mode
|
|
||||||
work_mode = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetCur(Cur * pcur)
|
|
||||||
{
|
|
||||||
cur = pcur;
|
|
||||||
session_tab.SetCur(pcur);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetConfig(Config * pconfig)
|
|
||||||
{
|
|
||||||
config = pconfig;
|
|
||||||
session_tab.SetConfig(pconfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetSystem(System * psystem)
|
|
||||||
{
|
|
||||||
system = psystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetLastContainer(LastContainer * plast_container)
|
|
||||||
{
|
|
||||||
last_container = plast_container;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::InitBanList()
|
|
||||||
{
|
|
||||||
ban_tab.SetMaxSize(config->ban_list_soft_max_size, config->ban_list_max_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
size_t SessionManager::Size()
|
|
||||||
{
|
|
||||||
return session_tab.Size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool SessionManager::IsSession(long id)
|
|
||||||
{
|
|
||||||
if( session_tab.FindById(id) == session_tab.End() )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
long SessionManager::CreateSessionId()
|
|
||||||
{
|
|
||||||
long id;
|
|
||||||
|
|
||||||
// make sure to call std::srand() somewhere at the beginning
|
|
||||||
// id must be != 0 (0 is reserved)
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if( sizeof(long) == 8 )
|
|
||||||
{
|
|
||||||
id = (((unsigned long)std::rand()) << 32) + std::rand();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
id = std::rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
id += std::time(0);
|
|
||||||
|
|
||||||
if( id < 0 )
|
|
||||||
id = -id;
|
|
||||||
|
|
||||||
}
|
|
||||||
while( id == 0 ); // 0 reserved for a temporary session
|
|
||||||
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::CreateSession()
|
|
||||||
{
|
|
||||||
int attempts = 100;
|
|
||||||
SessionContainer::Iterator i = session_tab.End();
|
|
||||||
|
|
||||||
if( config->session_max == 0 || session_tab.Size() < config->session_max )
|
|
||||||
{
|
|
||||||
for( ; i == session_tab.End() && attempts > 0 ; --attempts )
|
|
||||||
{
|
|
||||||
long id = CreateSessionId();
|
|
||||||
i = session_tab.AddSession(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log2 << "SM: sessions limit exceeded (" << config->session_max << ")" << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( i != session_tab.End() )
|
|
||||||
{
|
|
||||||
session = &(*i);
|
|
||||||
session->new_session = true;
|
|
||||||
session->SetTimesTo(cur->request->start_time);
|
|
||||||
|
|
||||||
log << log2 << "SM: created a new session: " << session->id << logend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// there is a problem with generating a new session id
|
|
||||||
// we do not set a session cookie
|
|
||||||
log << log1 << "SM: cannot create a session id (temporary used: with id 0)" << logend;
|
|
||||||
SetTemporarySession();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetTemporarySession()
|
|
||||||
{
|
|
||||||
session = &temporary_session;
|
|
||||||
session->Clear(false);
|
|
||||||
session->SetTimesTo(cur->request->start_time);
|
|
||||||
session->new_session = false; // temporary session was initialized at the beginning
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool SessionManager::SetSessionFromCookie(const std::string & cookie)
|
|
||||||
{
|
|
||||||
long id = Tol(cookie.c_str());
|
|
||||||
SessionContainer::Iterator s = session_tab.FindById(id);
|
|
||||||
|
|
||||||
if( s == session_tab.End() || s->remove_me )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// that session is in the table
|
|
||||||
session = &(*s);
|
|
||||||
session->new_session = false;
|
|
||||||
session->last_time = cur->request->start_time;
|
|
||||||
session->last_date = cur->request->start_time;
|
|
||||||
|
|
||||||
if( cur->request->method == Request::get )
|
|
||||||
session->last_time_get = cur->request->start_time;
|
|
||||||
|
|
||||||
log << log2 << "SM: session: " << session->id;
|
|
||||||
|
|
||||||
if( session->puser )
|
|
||||||
log << log2 << ", user: " << session->puser->name << ", id: " << session->puser->id;
|
|
||||||
|
|
||||||
log << log2 << logend;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SetSession()
|
|
||||||
{
|
|
||||||
current_ip_ban = ban_tab.FindIP(cur->request->ip);
|
|
||||||
|
|
||||||
if( current_ip_ban && current_ip_ban->IsIPBanned() )
|
|
||||||
{
|
|
||||||
if( current_ip_ban->expires != 0 && cur->request->start_time >= current_ip_ban->expires )
|
|
||||||
{
|
|
||||||
log << log2 << "SM: removing a ban from this IP and resetting events counter" << logend;
|
|
||||||
current_ip_ban->ClearAfterRemovingBan();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log2 << "SM: this ip is bannned, using a temporary session" << logend;
|
|
||||||
SetTemporarySession();
|
|
||||||
session->ip_ban = current_ip_ban;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CookieTab::iterator i = cur->request->cookie_tab.find(config->http_session_id_name);
|
|
||||||
|
|
||||||
if( i == cur->request->cookie_tab.end() )
|
|
||||||
{
|
|
||||||
CreateSession();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( !SetSessionFromCookie(i->second) )
|
|
||||||
{
|
|
||||||
// there is no such a session
|
|
||||||
// deleting the old cookie
|
|
||||||
cur->request->cookie_tab.erase(i);
|
|
||||||
|
|
||||||
// and creating a new one
|
|
||||||
CreateSession();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
session->ip_ban = current_ip_ban;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Session * SessionManager::FindSession(long id)
|
|
||||||
{
|
|
||||||
SessionContainer::Iterator i = session_tab.FindById(id);
|
|
||||||
|
|
||||||
if( i != session_tab.End() )
|
|
||||||
return &*i;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SessionContainer::Iterator SessionManager::SessionBegin()
|
|
||||||
{
|
|
||||||
return session_tab.Begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SessionContainer::Iterator SessionManager::SessionEnd()
|
|
||||||
{
|
|
||||||
return session_tab.End();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::DeleteSessions()
|
|
||||||
{
|
|
||||||
SessionContainer::Iterator i;
|
|
||||||
|
|
||||||
for(i=session_tab.Begin() ; i!=session_tab.End() ; ++i)
|
|
||||||
{
|
|
||||||
if( i->puser && !i->remember_me )
|
|
||||||
{
|
|
||||||
plugin.Call(&(*i), WINIX_PREPARE_USER_TO_LOGOUT, i->puser);
|
|
||||||
last_container->UserLogout(i->puser->id, i->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
session_tab.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
don't change a session's id when a user is logged
|
|
||||||
the session id is in last_container and the user would not be
|
|
||||||
correctly removed from the container
|
|
||||||
*/
|
|
||||||
bool SessionManager::ChangeSessionId(long old_id)
|
|
||||||
{
|
|
||||||
int attempts = 100;
|
|
||||||
bool changed = false;
|
|
||||||
long new_id;
|
|
||||||
SessionContainer::Iterator i = session_tab.FindById(old_id);
|
|
||||||
|
|
||||||
if( i != session_tab.End() )
|
|
||||||
{
|
|
||||||
for( ; !changed && attempts > 0 ; --attempts )
|
|
||||||
{
|
|
||||||
new_id = CreateSessionId();
|
|
||||||
changed = session_tab.ChangeSessionId(i, new_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( changed )
|
|
||||||
plugin.Call(&(*i), WINIX_SESSION_CHANGED_ID, old_id, new_id);
|
|
||||||
else
|
|
||||||
log << log1 << "SM: I cannot create a new session id (still uses old one)" << logend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log2 << "SM: there is no a session with id: " << old_id << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
return changed;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::InitTmpSession()
|
|
||||||
{
|
|
||||||
Session * old_session = cur->session;
|
|
||||||
|
|
||||||
log << log4 << "SM: initializing temporary session" << logend;
|
|
||||||
cur->session = &temporary_session;
|
|
||||||
plugin.Call(WINIX_SESSION_CREATED);
|
|
||||||
|
|
||||||
cur->session = old_session;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::UninitTmpSession()
|
|
||||||
{
|
|
||||||
Session * old_session = cur->session;
|
|
||||||
|
|
||||||
log << log4 << "SM: uninitializing temporary session" << logend;
|
|
||||||
cur->session = &temporary_session;
|
|
||||||
cur->session->plugin_data.DeleteAll(); // this will call plugin.Call(WINIX_PLUGIN_SESSION_DATA_REMOVE);
|
|
||||||
cur->session->plugin_data.Resize(0);
|
|
||||||
|
|
||||||
cur->session = old_session;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::LoadSessions()
|
|
||||||
{
|
|
||||||
SessionParser sp;
|
|
||||||
SessionContainer::Iterator i;
|
|
||||||
|
|
||||||
// sessions will be overwritten (pointers are invalidated)
|
|
||||||
cur->session = &temporary_session;
|
|
||||||
|
|
||||||
sp.SetUsers(&system->users);
|
|
||||||
sp.Parse(config->session_file, session_tab);
|
|
||||||
|
|
||||||
for(i=session_tab.Begin() ; i != session_tab.End() ; ++i)
|
|
||||||
{
|
|
||||||
i->plugin_data.Resize(plugin.Size());
|
|
||||||
plugin.Call(&(*i), WINIX_SESSION_CREATED);
|
|
||||||
|
|
||||||
/*
|
|
||||||
!! IMPROVE ME
|
|
||||||
we do not add it to the last_container (we don't have IP address stored yet)
|
|
||||||
*/
|
|
||||||
|
|
||||||
if( i->puser )
|
|
||||||
plugin.Call(&(*i), WINIX_USER_LOGGED);
|
|
||||||
}
|
|
||||||
|
|
||||||
cur->session = &temporary_session;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::SaveSessions()
|
|
||||||
{
|
|
||||||
if( config->session_file.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
std::ofstream file(config->session_file.c_str());
|
|
||||||
|
|
||||||
if( !file )
|
|
||||||
{
|
|
||||||
log << log1 << "SM: cannot open the session file for writing - sessions lost" << logend;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
log << log2 << "SM: saving sessions" << logend;
|
|
||||||
long len = 0;
|
|
||||||
|
|
||||||
SessionContainer::Iterator i = session_tab.Begin();
|
|
||||||
|
|
||||||
for( ; i!=session_tab.End() ; ++i )
|
|
||||||
{
|
|
||||||
if( i->id != 0 && i->puser && !i->remove_me )
|
|
||||||
{
|
|
||||||
file << i->id << ' ' << i->puser->id << ' ' << i->remember_me << ' ';
|
|
||||||
file << (long)i->start_time << ' ' << (long)i->last_time << std::endl;
|
|
||||||
|
|
||||||
++len;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
file.close();
|
|
||||||
chmod(config->session_file.c_str(), 0600);
|
|
||||||
|
|
||||||
log << log2 << "SM: saved " << len << " session(s)" << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Session * SessionManager::GetTmpSession()
|
|
||||||
{
|
|
||||||
return &temporary_session;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Session * SessionManager::GetCurSession()
|
|
||||||
{
|
|
||||||
return session;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// returns how many sessions was marked to remove
|
|
||||||
size_t SessionManager::MarkAllSessionsToRemove(long user_id)
|
|
||||||
{
|
|
||||||
size_t how_many = 0;
|
|
||||||
SessionContainer::Iterator i;
|
|
||||||
|
|
||||||
for(i=session_tab.Begin() ; i!=session_tab.End() ; ++i)
|
|
||||||
{
|
|
||||||
if( i->puser && i->puser->id == user_id )
|
|
||||||
{
|
|
||||||
plugin.Call(&(*i), WINIX_PREPARE_USER_TO_LOGOUT, i->puser);
|
|
||||||
last_container->UserLogout(i->puser->id, i->id);
|
|
||||||
i->remove_me = true;
|
|
||||||
i->puser = 0;
|
|
||||||
how_many += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return how_many;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IPBan & SessionManager::AddIPToBanList(int ip)
|
|
||||||
{
|
|
||||||
return ban_tab.AddIP(ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
size_t SessionManager::BanListSize()
|
|
||||||
{
|
|
||||||
return ban_tab.Size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
IPBan & SessionManager::GetIPBan(size_t index)
|
|
||||||
{
|
|
||||||
return ban_tab.GetIPBan(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::RemoveIPBan(int ip)
|
|
||||||
{
|
|
||||||
ban_tab.RemoveIP(ip);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SessionManager::ClearIPBanList()
|
|
||||||
{
|
|
||||||
ban_tab.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* sessions gc (second thread)
|
|
||||||
* sessions are only removed here
|
|
||||||
* SessionContainer::IndexId can be removed from the other thread
|
|
||||||
* (when ChangeSessionId() method is called)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void SessionManager::Work()
|
|
||||||
{
|
|
||||||
bool exit = false;
|
|
||||||
SessionContainer::Iterator i;
|
|
||||||
|
|
||||||
deleted = 0;
|
|
||||||
|
|
||||||
Lock();
|
|
||||||
i = session_tab.Begin();
|
|
||||||
Unlock();
|
|
||||||
|
|
||||||
while( !exit )
|
|
||||||
{
|
|
||||||
Lock();
|
|
||||||
|
|
||||||
CheckWheterIPListIsSorted();
|
|
||||||
CheckSession(i);
|
|
||||||
exit = synchro->was_stop_signal;
|
|
||||||
|
|
||||||
Unlock();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// objects locked
|
|
||||||
void SessionManager::CheckWheterIPListIsSorted()
|
|
||||||
{
|
|
||||||
if( !ban_tab.IsSorted() )
|
|
||||||
{
|
|
||||||
log << log4 << "SM: sorting the ban list" << logend;
|
|
||||||
ban_tab.Sort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// it's called from the other thread (with Lock and Unlock)
|
|
||||||
void SessionManager::CheckSession(SessionContainer::Iterator & i)
|
|
||||||
{
|
|
||||||
const int deleted_max_at_once = 10;
|
|
||||||
|
|
||||||
if( i == session_tab.End() )
|
|
||||||
{
|
|
||||||
if( deleted > 0 )
|
|
||||||
{
|
|
||||||
deleted = 0;
|
|
||||||
log << logsave;
|
|
||||||
}
|
|
||||||
|
|
||||||
i = session_tab.Begin();
|
|
||||||
WaitForSignalSleep(10);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if( i->remove_me || IsSessionOutdated(*i) )
|
|
||||||
{
|
|
||||||
Session * ses = &(*i);
|
|
||||||
++i;
|
|
||||||
DeleteSession(ses);
|
|
||||||
++deleted;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( deleted >= deleted_max_at_once )
|
|
||||||
{
|
|
||||||
log << logsave;
|
|
||||||
WaitForSignalSleep(1);
|
|
||||||
deleted = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// it's called from the other thread (with Lock and Unlock)
|
|
||||||
bool SessionManager::IsSessionOutdated(const Session & s) const
|
|
||||||
{
|
|
||||||
bool outdated;
|
|
||||||
|
|
||||||
if( s.remember_me )
|
|
||||||
{
|
|
||||||
outdated = s.last_time < std::time(0) - config->session_remember_max_idle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outdated = s.last_time < std::time(0) - config->session_max_idle;
|
|
||||||
}
|
|
||||||
|
|
||||||
return outdated;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// it's called from the other thread (with Lock and Unlock)
|
|
||||||
void SessionManager::DeleteSession(Session * del_session)
|
|
||||||
{
|
|
||||||
if( del_session->puser )
|
|
||||||
{
|
|
||||||
plugin.Call(del_session, WINIX_PREPARE_USER_TO_LOGOUT, del_session->puser);
|
|
||||||
last_container->UserLogout(del_session->puser->id, del_session->id);
|
|
||||||
del_session->puser = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long id = del_session->id;
|
|
||||||
|
|
||||||
plugin.Call(del_session, WINIX_PREPARE_SESSION_TO_REMOVE);
|
|
||||||
session_tab.EraseById(del_session->id);
|
|
||||||
plugin.Call((Session*)0, WINIX_SESSION_REMOVED, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* end of sessions gc
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessionmanager
|
|
||||||
#define headerfile_winix_core_sessionmanager
|
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <ctime>
|
|
||||||
|
|
||||||
#include "sessioncontainer.h"
|
|
||||||
#include "ipbancontainer.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "request.h"
|
|
||||||
#include "lastcontainer.h"
|
|
||||||
#include "system.h"
|
|
||||||
#include "synchro.h"
|
|
||||||
#include "basethread.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionManager : public BaseThread
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
SessionManager();
|
|
||||||
|
|
||||||
void SetCur(Cur * pcur);
|
|
||||||
void SetConfig(Config * pconfig);
|
|
||||||
void SetSystem(System * psystem);
|
|
||||||
void SetLastContainer(LastContainer * plast_container);
|
|
||||||
|
|
||||||
|
|
||||||
// can return a null pointer
|
|
||||||
Session * FindSession(long id);
|
|
||||||
|
|
||||||
void SetSession();
|
|
||||||
void DeleteSessions(); // deleting all sessions
|
|
||||||
bool ChangeSessionId(long old_id);
|
|
||||||
|
|
||||||
void InitBanList();
|
|
||||||
void InitTmpSession();
|
|
||||||
void UninitTmpSession();
|
|
||||||
|
|
||||||
Session * GetTmpSession();
|
|
||||||
Session * GetCurSession();
|
|
||||||
|
|
||||||
void LoadSessions();
|
|
||||||
void SaveSessions();
|
|
||||||
|
|
||||||
SessionContainer::Iterator SessionBegin();
|
|
||||||
SessionContainer::Iterator SessionEnd();
|
|
||||||
|
|
||||||
size_t Size();
|
|
||||||
size_t MarkAllSessionsToRemove(long user_id);
|
|
||||||
|
|
||||||
IPBan & AddIPToBanList(int ip);
|
|
||||||
size_t BanListSize();
|
|
||||||
IPBan & GetIPBan(size_t index);
|
|
||||||
void RemoveIPBan(int ip);
|
|
||||||
void ClearIPBanList();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Config * config;
|
|
||||||
Cur * cur;
|
|
||||||
System * system;
|
|
||||||
|
|
||||||
LastContainer * last_container;
|
|
||||||
|
|
||||||
// current session - set by SetSession()
|
|
||||||
Session * session;
|
|
||||||
|
|
||||||
SessionContainer session_tab;
|
|
||||||
IPBanContainer ban_tab;
|
|
||||||
|
|
||||||
IPBan * current_ip_ban;
|
|
||||||
|
|
||||||
// session with id 0
|
|
||||||
Session temporary_session;
|
|
||||||
|
|
||||||
bool IsSession(long s);
|
|
||||||
|
|
||||||
long CreateSessionId();
|
|
||||||
void CreateSession();
|
|
||||||
bool SetSessionFromCookie(const std::string & cookie);
|
|
||||||
void SetTemporarySession();
|
|
||||||
|
|
||||||
// second thread
|
|
||||||
int deleted;
|
|
||||||
virtual void Work();
|
|
||||||
void CheckSession(SessionContainer::Iterator & i);
|
|
||||||
bool IsSessionOutdated(const Session & s) const;
|
|
||||||
void DeleteSession(Session * del_session);
|
|
||||||
void CheckWheterIPListIsSorted();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_sessionparser
|
|
||||||
#define headerfile_winix_core_sessionparser
|
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <string>
|
|
||||||
#include "session.h"
|
|
||||||
#include "sessioncontainer.h"
|
|
||||||
#include "users.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class SessionParser
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
bool Parse(const char * path, SessionContainer & container);
|
|
||||||
bool Parse(const std::string & path, SessionContainer & container);
|
|
||||||
void SetUsers(Users * pusers);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Users * users;
|
|
||||||
|
|
||||||
bool Parse(SessionContainer & container);
|
|
||||||
void MakeSession(long id, long user_id, SessionContainer & container);
|
|
||||||
|
|
||||||
bool IsWhite(int c);
|
|
||||||
bool IsDigit(int c);
|
|
||||||
void SkipWhite();
|
|
||||||
void SkipLine();
|
|
||||||
|
|
||||||
long ReadLong();
|
|
||||||
|
|
||||||
std::ifstream file;
|
|
||||||
int last; // last character
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include "synchro.h"
|
|
||||||
|
|
||||||
|
|
||||||
Synchro::Synchro() : mutex(PTHREAD_MUTEX_INITIALIZER)
|
|
||||||
{
|
|
||||||
was_stop_signal = false;
|
|
||||||
ref = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Synchro::Lock()
|
|
||||||
{
|
|
||||||
int res = pthread_mutex_lock(&mutex);
|
|
||||||
|
|
||||||
if( res == EDEADLK )
|
|
||||||
{
|
|
||||||
// Lock() method in this thread was called before
|
|
||||||
ref += 1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ref = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Synchro::Unlock()
|
|
||||||
{
|
|
||||||
if( ref > 0 )
|
|
||||||
{
|
|
||||||
ref -= 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pthread_mutex_unlock(&mutex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_synchro
|
|
||||||
#define headerfile_winix_core_synchro
|
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Synchro
|
|
||||||
{
|
|
||||||
// one global mutex
|
|
||||||
pthread_mutex_t mutex;
|
|
||||||
|
|
||||||
|
|
||||||
// true when winix is closing
|
|
||||||
volatile bool was_stop_signal;
|
|
||||||
|
|
||||||
|
|
||||||
Synchro();
|
|
||||||
|
|
||||||
bool Lock();
|
|
||||||
void Unlock();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// deadlock counter
|
|
||||||
// we can call Lock() more than one in the same thread
|
|
||||||
int ref;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,136 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <signal.h>
|
|
||||||
#include "threadmanager.h"
|
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
|
|
||||||
ThreadManager::ThreadManager()
|
|
||||||
{
|
|
||||||
were_started = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::SetSynchro(Synchro * psynchro)
|
|
||||||
{
|
|
||||||
synchro = psynchro;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::Init()
|
|
||||||
{
|
|
||||||
sigset_t set;
|
|
||||||
|
|
||||||
sigemptyset(&set);
|
|
||||||
sigaddset(&set, SIGTERM);
|
|
||||||
sigaddset(&set, SIGINT);
|
|
||||||
|
|
||||||
// blocking SIGTERM and SIGINT
|
|
||||||
// new threads will have the signals blocked too
|
|
||||||
pthread_sigmask(SIG_BLOCK, &set, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::Add(BaseThread * pbase, const wchar_t * thread_name)
|
|
||||||
{
|
|
||||||
ThreadItem item;
|
|
||||||
|
|
||||||
item.object = pbase;
|
|
||||||
item.name = thread_name;
|
|
||||||
thread_tab.push_back(item);
|
|
||||||
|
|
||||||
if( were_started )
|
|
||||||
Start(thread_tab.size() - 1);
|
|
||||||
else
|
|
||||||
log << log4 << "TM: added a thread to the queue, number: " << (thread_tab.size()-1)
|
|
||||||
<< ", name: " << thread_name << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::Add(BaseThread & pbase, const wchar_t * thread_name)
|
|
||||||
{
|
|
||||||
Add(&pbase, thread_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::Add(BaseThread * pbase, const std::wstring & thread_name)
|
|
||||||
{
|
|
||||||
Add(pbase, thread_name.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThreadManager::Add(BaseThread & pbase, const std::wstring & thread_name)
|
|
||||||
{
|
|
||||||
Add(&pbase, thread_name.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::StartAll()
|
|
||||||
{
|
|
||||||
synchro->Lock();
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<thread_tab.size() ; ++i)
|
|
||||||
Start(i);
|
|
||||||
|
|
||||||
synchro->Unlock();
|
|
||||||
|
|
||||||
were_started = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::Start(size_t i)
|
|
||||||
{
|
|
||||||
if( i < thread_tab.size() )
|
|
||||||
{
|
|
||||||
thread_tab[i].object->SetSynchro(synchro);
|
|
||||||
|
|
||||||
if( thread_tab[i].object->StartThread() )
|
|
||||||
{
|
|
||||||
log << log4 << "TM: thread " << i << " (" << thread_tab[i].object->ThreadId() << ", name: "
|
|
||||||
<< thread_tab[i].name << ") started" << logend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log4 << "TM: cannot run a thread, thread number: " << i
|
|
||||||
<< ", name: " << thread_tab[i].name << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ThreadManager::StopAll()
|
|
||||||
{
|
|
||||||
if( !were_started )
|
|
||||||
return;
|
|
||||||
|
|
||||||
// WakeUpThread() should be used with Lock/Unlock
|
|
||||||
synchro->Lock();
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<thread_tab.size() ; ++i)
|
|
||||||
thread_tab[i].object->WakeUpThread();
|
|
||||||
|
|
||||||
synchro->Unlock();
|
|
||||||
|
|
||||||
|
|
||||||
for(size_t i=0 ; i<thread_tab.size() ; ++i)
|
|
||||||
{
|
|
||||||
log << log4 << "TM: waiting for thread " << i << " (" << thread_tab[i].object->ThreadId()
|
|
||||||
<< ", name: " << thread_tab[i].name << ")" << logend;
|
|
||||||
|
|
||||||
thread_tab[i].object->WaitForThread();
|
|
||||||
|
|
||||||
log << log4 << "TM: thread " << i << " terminated" << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_threadmanager
|
|
||||||
#define headerfile_winix_core_threadmanager
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "basethread.h"
|
|
||||||
#include "synchro.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ThreadManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
ThreadManager();
|
|
||||||
|
|
||||||
// synchro object
|
|
||||||
void SetSynchro(Synchro * psynchro);
|
|
||||||
|
|
||||||
// initializing
|
|
||||||
void Init();
|
|
||||||
|
|
||||||
// adding a new thread to the queue
|
|
||||||
// the thread will be running only if we call StartAll() before
|
|
||||||
// otherwise the thread will be waiting for StartAll()
|
|
||||||
void Add(BaseThread * pbase, const wchar_t * thread_name);
|
|
||||||
void Add(BaseThread & pbase, const wchar_t * thread_name);
|
|
||||||
void Add(BaseThread * pbase, const std::wstring & thread_name);
|
|
||||||
void Add(BaseThread & pbase, const std::wstring & thread_name);
|
|
||||||
|
|
||||||
// starting all threads
|
|
||||||
void StartAll();
|
|
||||||
|
|
||||||
// sending a stop signal to all threads
|
|
||||||
// and waiting until they finish
|
|
||||||
void StopAll();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
struct ThreadItem
|
|
||||||
{
|
|
||||||
BaseThread * object;
|
|
||||||
std::wstring name;
|
|
||||||
};
|
|
||||||
|
|
||||||
Synchro * synchro;
|
|
||||||
typedef std::vector<ThreadItem> ThreadTab;
|
|
||||||
ThreadTab thread_tab;
|
|
||||||
bool were_started;
|
|
||||||
|
|
||||||
void Start(size_t i);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "user.h"
|
|
||||||
|
|
||||||
|
|
||||||
User::User()
|
|
||||||
{
|
|
||||||
Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void User::Clear()
|
|
||||||
{
|
|
||||||
id = -1;
|
|
||||||
name.clear();
|
|
||||||
super_user = false;
|
|
||||||
groups.clear();
|
|
||||||
email.clear();
|
|
||||||
notify = 0;
|
|
||||||
env.Clear();
|
|
||||||
aenv.Clear();
|
|
||||||
status = WINIX_ACCOUNT_BLOCKED;
|
|
||||||
locale_id = 0;
|
|
||||||
time_zone_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool User::IsMemberOf(long group)
|
|
||||||
{
|
|
||||||
std::vector<long>::iterator i;
|
|
||||||
|
|
||||||
for(i=groups.begin() ; i!=groups.end() ; ++i)
|
|
||||||
if( *i == group )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
78
core/users.h
78
core/users.h
@@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_users
|
|
||||||
#define headerfile_winix_core_users
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include "user.h"
|
|
||||||
#include "ugcontainer.h"
|
|
||||||
#include "lastcontainer.h"
|
|
||||||
#include "cur.h"
|
|
||||||
#include "db/db.h"
|
|
||||||
|
|
||||||
class SessionManager;
|
|
||||||
|
|
||||||
|
|
||||||
class Users
|
|
||||||
{
|
|
||||||
typedef UGContainer<User> Table;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Table::Iterator Iterator;
|
|
||||||
typedef Table::SizeType SizeType;
|
|
||||||
|
|
||||||
LastContainer last;
|
|
||||||
|
|
||||||
Users();
|
|
||||||
|
|
||||||
void SetCur(Cur * pcur);
|
|
||||||
void SetSessionManager(SessionManager * sm);
|
|
||||||
|
|
||||||
void Clear();
|
|
||||||
void ReadUsers(Db * db);
|
|
||||||
bool AddUser(const User & user);
|
|
||||||
bool IsUser(const std::wstring & name);
|
|
||||||
User * GetUser(long user_id);
|
|
||||||
User * GetUser(const std::wstring & name);
|
|
||||||
long GetUserId(const std::wstring & name);
|
|
||||||
Iterator Begin();
|
|
||||||
Iterator End();
|
|
||||||
SizeType Size();
|
|
||||||
bool Remove(long user_id);
|
|
||||||
|
|
||||||
bool LoginUser(long user_id, bool remember_me, bool use_ses_log = false);
|
|
||||||
size_t LogoutUser(long user_id);
|
|
||||||
void LogoutCurrentUser();
|
|
||||||
|
|
||||||
void IncrementLoggedUsers();
|
|
||||||
long HowManyLogged();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Table table;
|
|
||||||
Cur * cur;
|
|
||||||
SessionManager * session_manager;
|
|
||||||
long how_many_logged;
|
|
||||||
|
|
||||||
bool LoginUserCheckSession(bool use_ses_log);
|
|
||||||
User * LoginUserCheckStatus(long user_id, bool use_ses_log);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2013, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_core_version
|
|
||||||
#define headerfile_winix_core_version
|
|
||||||
|
|
||||||
|
|
||||||
#define WINIX_VER_MAJOR 0
|
|
||||||
#define WINIX_VER_MINOR 5
|
|
||||||
#define WINIX_VER_REVISION 4
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
19
db/Makefile
19
db/Makefile
@@ -1,19 +0,0 @@
|
|||||||
include Makefile.o.dep
|
|
||||||
|
|
||||||
|
|
||||||
all: $(o)
|
|
||||||
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) -c $(CXXFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
depend:
|
|
||||||
makedepend -Y. -I.. -I../../ezc/src -I../../pikotools -I../../tito/src -f- *.cpp > Makefile.dep
|
|
||||||
echo -n "o = " > Makefile.o.dep
|
|
||||||
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o
|
|
||||||
|
|
||||||
include Makefile.dep
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
# DO NOT DELETE
|
|
||||||
|
|
||||||
db.o: db.h dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
|
||||||
db.o: ../core/misc.h ../core/item.h ../../pikotools/space/space.h
|
|
||||||
db.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
|
||||||
db.o: ../core/requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
db.o: ../../pikotools/convert/convert.h ../../pikotools/convert/inttostr.h
|
|
||||||
db.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
db.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
db.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
db.o: ../../pikotools/space/space.h dbitemquery.h ../core/item.h
|
|
||||||
db.o: dbitemcolumns.h ../core/user.h ../core/group.h ../core/dircontainer.h
|
|
||||||
db.o: ../core/ugcontainer.h ../core/log.h ../core/textstream.h
|
|
||||||
db.o: ../core/logmanipulators.h ../core/slog.h ../core/cur.h
|
|
||||||
db.o: ../core/request.h ../core/error.h ../core/config.h ../core/htmlfilter.h
|
|
||||||
db.o: ../templates/htmltextstream.h ../../pikotools/space/spacetojson.h
|
|
||||||
db.o: ../core/session.h ../core/user.h ../core/plugindata.h ../core/rebus.h
|
|
||||||
db.o: ../core/ipban.h ../core/mount.h ../templates/locale.h ../core/log.h
|
|
||||||
db.o: ../core/misc.h
|
|
||||||
dbbase.o: dbbase.h dbconn.h dbtextstream.h ../core/textstream.h
|
|
||||||
dbbase.o: ../core/misc.h ../core/item.h ../../pikotools/space/space.h
|
|
||||||
dbbase.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
|
||||||
dbbase.o: ../core/requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
dbbase.o: ../../pikotools/convert/convert.h
|
|
||||||
dbbase.o: ../../pikotools/convert/inttostr.h
|
|
||||||
dbbase.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dbbase.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
dbbase.o: ../core/error.h ../../pikotools/space/spaceparser.h
|
|
||||||
dbbase.o: ../../pikotools/space/space.h ../core/log.h ../core/misc.h
|
|
||||||
dbconn.o: dbconn.h dbtextstream.h ../core/textstream.h ../core/misc.h
|
|
||||||
dbconn.o: ../core/item.h ../../pikotools/space/space.h
|
|
||||||
dbconn.o: ../../pikotools/textstream/types.h ../../pikotools/date/date.h
|
|
||||||
dbconn.o: ../core/requesttypes.h ../../pikotools/textstream/textstream.h
|
|
||||||
dbconn.o: ../../pikotools/convert/convert.h
|
|
||||||
dbconn.o: ../../pikotools/convert/inttostr.h
|
|
||||||
dbconn.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dbconn.o: ../../pikotools/textstream/types.h ../../pikotools/utf8/utf8.h
|
|
||||||
dbconn.o: ../core/log.h ../core/error.h
|
|
||||||
dbitemcolumns.o: dbitemcolumns.h ../core/item.h dbbase.h dbconn.h
|
|
||||||
dbitemcolumns.o: dbtextstream.h ../core/textstream.h ../core/misc.h
|
|
||||||
dbitemcolumns.o: ../core/item.h ../../pikotools/space/space.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/textstream/types.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/date/date.h ../core/requesttypes.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/textstream/textstream.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/convert/convert.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/convert/inttostr.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/textstream/types.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/utf8/utf8.h ../core/error.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/space/spaceparser.h
|
|
||||||
dbitemcolumns.o: ../../pikotools/space/space.h ../core/log.h
|
|
||||||
dbitemquery.o: dbitemquery.h ../core/item.h
|
|
||||||
dbtextstream.o: dbtextstream.h ../core/textstream.h ../core/misc.h
|
|
||||||
dbtextstream.o: ../core/item.h ../../pikotools/space/space.h
|
|
||||||
dbtextstream.o: ../../pikotools/textstream/types.h
|
|
||||||
dbtextstream.o: ../../pikotools/date/date.h ../core/requesttypes.h
|
|
||||||
dbtextstream.o: ../../pikotools/textstream/textstream.h
|
|
||||||
dbtextstream.o: ../../pikotools/convert/convert.h
|
|
||||||
dbtextstream.o: ../../pikotools/convert/inttostr.h
|
|
||||||
dbtextstream.o: ../../pikotools/membuffer/membuffer.h
|
|
||||||
dbtextstream.o: ../../pikotools/textstream/types.h
|
|
||||||
dbtextstream.o: ../../pikotools/utf8/utf8.h
|
|
||||||
111
db/dbbase.h
111
db/dbbase.h
@@ -1,111 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_db_dbbase
|
|
||||||
#define headerfile_winix_db_dbbase
|
|
||||||
|
|
||||||
|
|
||||||
#include "dbconn.h"
|
|
||||||
#include "dbtextstream.h"
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
#include "core/error.h"
|
|
||||||
#include "space/spaceparser.h"
|
|
||||||
#include "date/date.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DbBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
DbBase();
|
|
||||||
|
|
||||||
void SetConn(DbConn * conn);
|
|
||||||
void SetConn(DbConn & conn);
|
|
||||||
DbConn * GetConn();
|
|
||||||
|
|
||||||
void LogQueries(bool log_q);
|
|
||||||
|
|
||||||
PGresult * AssertQuery(const char * query);
|
|
||||||
PGresult * AssertQuery(const DbTextStream & query);
|
|
||||||
PGresult * AssertQuery(const char * q, ExecStatusType t);
|
|
||||||
PGresult * AssertQuery(const DbTextStream & query, ExecStatusType t);
|
|
||||||
void AssertResult(PGresult * r, ExecStatusType t);
|
|
||||||
static int AssertColumn(PGresult * r, const char * column_name);
|
|
||||||
|
|
||||||
// static assignments
|
|
||||||
static const char * AssertValue(PGresult * r, int row, int col);
|
|
||||||
static const std::wstring & AssertValueWide(PGresult * r, int row, int col); // warning: this method uses a static buffer
|
|
||||||
static void AssertValueWide(PGresult * r, int row, int col, std::wstring & result);
|
|
||||||
static void AssertValueBin(PGresult * r, int row, int col, std::string & result);
|
|
||||||
static long AssertValueLong(PGresult * r, int row, int col);
|
|
||||||
static int AssertValueInt(PGresult * r, int row, int col);
|
|
||||||
static bool AssertValueBool(PGresult * r, int row, int col);
|
|
||||||
static unsigned long AssertValueULong(PGresult * r, int row, int col);
|
|
||||||
static unsigned int AssertValueUInt(PGresult * r, int row, int col);
|
|
||||||
static PT::Date AssertValueDate(PGresult * r, int row, int col);
|
|
||||||
|
|
||||||
// non static assignments
|
|
||||||
bool AssertValueSpace(PGresult * r, int row, int col, PT::Space & space, bool split_single = true);
|
|
||||||
|
|
||||||
void ClearResult(PGresult * r);
|
|
||||||
long AssertCurrval(const char * table);
|
|
||||||
|
|
||||||
bool IsNull(PGresult * r, int row, int col);
|
|
||||||
int Rows(PGresult * r);
|
|
||||||
int Cols(PGresult * r);
|
|
||||||
long AffectedRows(PGresult * r);
|
|
||||||
|
|
||||||
void CreateIdList(const std::vector<long> & id_tab, std::wstring & list, bool add_parentheses = true);
|
|
||||||
|
|
||||||
Error DoCommand(const DbTextStream & command);
|
|
||||||
Error DoCommand(const char * command);
|
|
||||||
Error BeginTrans();
|
|
||||||
Error RollbackTrans();
|
|
||||||
Error CommitTrans();
|
|
||||||
Error EndTrans(Error err);
|
|
||||||
|
|
||||||
// new API (returns only bool)
|
|
||||||
bool EndTrans(bool everything_ok);
|
|
||||||
|
|
||||||
static void UnescapeBin(const char * str, size_t len, std::string & out, bool clear_out = true);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// a helper method for escaping strings
|
|
||||||
template<class RawType>
|
|
||||||
DbTextStream::RawText<RawType> R(const RawType & par)
|
|
||||||
{
|
|
||||||
return DbTextStream::RawText<RawType>(par);
|
|
||||||
}
|
|
||||||
|
|
||||||
DbConn * db_conn;
|
|
||||||
bool log_queries;
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// static int CharToInt(char c);
|
|
||||||
// static bool IsCorrectOctalDigit(char c);
|
|
||||||
// static int UnescapeBin(const char * str, size_t & i, size_t len);
|
|
||||||
|
|
||||||
static char UnescapeBinHexToDigit(char hex);
|
|
||||||
|
|
||||||
DbTextStream bquery;
|
|
||||||
PT::SpaceParser conf_parser;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
55
db/dbconn.h
55
db/dbconn.h
@@ -1,55 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_db_dbconn
|
|
||||||
#define headerfile_winix_db_dbconn
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <libpq-fe.h>
|
|
||||||
#include "dbtextstream.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DbConn
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
DbConn();
|
|
||||||
~DbConn();
|
|
||||||
|
|
||||||
void SetConnParam(const std::string & database, const std::string & user, const std::string & pass);
|
|
||||||
void Connect();
|
|
||||||
void WaitForConnection();
|
|
||||||
void Close();
|
|
||||||
bool AssertConnection(bool put_log = true, bool throw_if_no_connection = true);
|
|
||||||
void SetDbParameters();
|
|
||||||
PGconn * GetPgConn();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void LogConnectionSocket();
|
|
||||||
|
|
||||||
PGconn * pg_conn;
|
|
||||||
std::string db_database, db_user, db_pass;
|
|
||||||
DbTextStream conn_info;
|
|
||||||
|
|
||||||
// a helper method for escaping strings
|
|
||||||
template<class RawType>
|
|
||||||
DbTextStream::RawText<RawType> R(const RawType & par)
|
|
||||||
{
|
|
||||||
return DbTextStream::RawText<RawType>(par);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "dbitemcolumns.h"
|
|
||||||
#include "dbbase.h"
|
|
||||||
#include "core/log.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DbItemColumns::SetColumns(PGresult * r)
|
|
||||||
{
|
|
||||||
// PQfnumber returns -1 if there is no such a column
|
|
||||||
id = PQfnumber(r, "id");
|
|
||||||
user_id = PQfnumber(r, "user_id");
|
|
||||||
group_id = PQfnumber(r, "group_id");
|
|
||||||
privileges = PQfnumber(r, "privileges");
|
|
||||||
date_creation = PQfnumber(r, "date_creation");
|
|
||||||
date_modification = PQfnumber(r, "date_modification");
|
|
||||||
url = PQfnumber(r, "url");
|
|
||||||
type = PQfnumber(r, "type");
|
|
||||||
parent_id = PQfnumber(r, "parent_id");
|
|
||||||
content_id = PQfnumber(r, "content_id");
|
|
||||||
link_to = PQfnumber(r, "link_to");
|
|
||||||
link_redirect = PQfnumber(r, "link_redirect");
|
|
||||||
subject = PQfnumber(r, "subject");
|
|
||||||
content = PQfnumber(r, "content");
|
|
||||||
content_type = PQfnumber(r, "content_type");
|
|
||||||
guest_name = PQfnumber(r, "guest_name");
|
|
||||||
html_template = PQfnumber(r, "template");
|
|
||||||
modification_user_id = PQfnumber(r, "modification_user_id");
|
|
||||||
file_path = PQfnumber(r, "file_path");
|
|
||||||
file_fs = PQfnumber(r, "file_fs");
|
|
||||||
file_type = PQfnumber(r, "file_type");
|
|
||||||
has_thumb = PQfnumber(r, "has_thumb");
|
|
||||||
hash = PQfnumber(r, "hash");
|
|
||||||
hash_type = PQfnumber(r, "hash_type");
|
|
||||||
file_size = PQfnumber(r, "file_size");
|
|
||||||
ref = PQfnumber(r, "ref");
|
|
||||||
modify_index = PQfnumber(r, "modify_index");
|
|
||||||
sort_index = PQfnumber(r, "sort_index");
|
|
||||||
meta = PQfnumber(r, "meta");
|
|
||||||
ameta = PQfnumber(r, "ameta");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DbItemColumns::SetItem(PGresult * r, long row, Item & item)
|
|
||||||
{
|
|
||||||
if( id != -1 ) item.id = DbBase::AssertValueLong(r, row, id);
|
|
||||||
if( user_id != -1 ) item.user_id = DbBase::AssertValueLong(r, row, user_id);
|
|
||||||
if( group_id != -1 ) item.group_id = DbBase::AssertValueLong(r, row, group_id);
|
|
||||||
if( privileges != -1 ) item.privileges = DbBase::AssertValueInt(r, row, privileges);
|
|
||||||
if( date_creation != -1 ) item.date_creation = DbBase::AssertValueDate(r, row, date_creation);
|
|
||||||
if( date_modification != -1 ) item.date_modification = DbBase::AssertValueDate(r, row, date_modification);
|
|
||||||
if( type != -1 ) item.type = static_cast<Item::Type>( DbBase::AssertValueInt(r, row, type) );
|
|
||||||
if( parent_id != -1 ) item.parent_id = DbBase::AssertValueLong(r, row, parent_id);
|
|
||||||
if( content_id != -1 ) item.content_id = DbBase::AssertValueLong(r, row, content_id);
|
|
||||||
if( link_redirect != -1 ) item.link_redirect = DbBase::AssertValueInt(r, row, link_redirect);
|
|
||||||
if( content_type != -1 ) item.content_type = static_cast<Item::ContentType>( DbBase::AssertValueInt(r, row, content_type) );
|
|
||||||
if( modification_user_id != -1 ) item.modification_user_id = DbBase::AssertValueLong(r, row, modification_user_id);
|
|
||||||
if( file_fs != -1 ) item.file_fs = DbBase::AssertValueInt(r, row, file_fs);
|
|
||||||
if( file_type != -1 ) item.file_type = DbBase::AssertValueInt(r, row, file_type);
|
|
||||||
if( has_thumb != -1 ) item.has_thumb = DbBase::AssertValueBool(r, row, has_thumb);
|
|
||||||
if( hash != -1 ) DbBase::AssertValueWide(r, row, hash, item.hash);
|
|
||||||
if( hash_type != -1 ) item.hash_type = DbBase::AssertValueInt(r, row, hash_type);
|
|
||||||
if( file_size != -1 ) item.file_size = DbBase::AssertValueLong(r, row, file_size);
|
|
||||||
|
|
||||||
if( ref != -1 ) item.ref = DbBase::AssertValueInt(r, row, ref);
|
|
||||||
if( modify_index != -1 ) item.modify_index = DbBase::AssertValueInt(r, row, modify_index);
|
|
||||||
|
|
||||||
if( url != -1 ) DbBase::AssertValueWide(r, row, url, item.url);
|
|
||||||
if( content != -1 ) DbBase::AssertValueWide(r, row, content, item.content);
|
|
||||||
if( subject != -1 ) DbBase::AssertValueWide(r, row, subject, item.subject);
|
|
||||||
if( file_path != -1 ) DbBase::AssertValueWide(r, row, file_path, item.file_path);
|
|
||||||
if( link_to != -1 ) DbBase::AssertValueWide(r, row, link_to, item.link_to);
|
|
||||||
if( guest_name != -1 ) DbBase::AssertValueWide(r, row, guest_name, item.guest_name);
|
|
||||||
if( html_template != -1 ) DbBase::AssertValueWide(r, row, html_template, item.html_template);
|
|
||||||
if( sort_index != -1 ) item.sort_index = DbBase::AssertValueInt(r, row, sort_index);
|
|
||||||
|
|
||||||
if( meta != -1 ) db_base.AssertValueSpace(r, row, meta, item.meta);
|
|
||||||
if( ameta != -1 ) db_base.AssertValueSpace(r, row, ameta, item.ameta);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_db_dbitemcolumns
|
|
||||||
#define headerfile_winix_db_dbitemcolumns
|
|
||||||
|
|
||||||
|
|
||||||
#include <libpq-fe.h>
|
|
||||||
#include "core/item.h"
|
|
||||||
#include "dbbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct DbItemColumns
|
|
||||||
{
|
|
||||||
int id;
|
|
||||||
int user_id;
|
|
||||||
int group_id;
|
|
||||||
int privileges;
|
|
||||||
int date_creation;
|
|
||||||
int date_modification;
|
|
||||||
int url;
|
|
||||||
int type;
|
|
||||||
int parent_id;
|
|
||||||
int content_id;
|
|
||||||
int link_to;
|
|
||||||
int link_redirect;
|
|
||||||
int subject;
|
|
||||||
int content;
|
|
||||||
int content_type;
|
|
||||||
int guest_name;
|
|
||||||
int modification_user_id;
|
|
||||||
int html_template;
|
|
||||||
int file_path;
|
|
||||||
int file_fs;
|
|
||||||
int file_type;
|
|
||||||
int has_thumb;
|
|
||||||
int hash;
|
|
||||||
int hash_type;
|
|
||||||
int file_size;
|
|
||||||
int ref;
|
|
||||||
int modify_index;
|
|
||||||
int sort_index;
|
|
||||||
int meta;
|
|
||||||
int ameta;
|
|
||||||
|
|
||||||
DbItemColumns(DbBase & db_base_) : db_base(db_base_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetColumns(PGresult * r);
|
|
||||||
void SetItem(PGresult * r, long row, Item & item);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
DbBase & db_base;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
include Makefile.o.dep
|
|
||||||
|
|
||||||
|
|
||||||
all: $(o)
|
|
||||||
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) -c $(CXXFLAGS) $<
|
|
||||||
|
|
||||||
|
|
||||||
depend:
|
|
||||||
makedepend -Y. -I.. -I../../ezc/src -I../../pikotools -I../../tito/src -f- *.cpp > Makefile.dep
|
|
||||||
echo -n "o = " > Makefile.o.dep
|
|
||||||
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o
|
|
||||||
|
|
||||||
include Makefile.dep
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
|||||||
o = adduser.o cat.o chmod.o chown.o ckeditor.o cp.o default.o download.o emacs.o env.o functionbase.o functionparser.o functions.o imgcrop.o ipban.o last.o ln.o locale.o login.o logout.o ls.o man.o meta.o mkdir.o mount.o mv.o nicedit.o node.o passwd.o priv.o privchanger.o pw.o reload.o rm.o rmuser.o run.o sort.o specialdefault.o stat.o subject.o template.o timezone.o tinymce.o uname.o upload.o uptime.o vim.o who.o
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_adduser
|
|
||||||
#define headerfile_winix_functions_adduser
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "core/user.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class AddUser : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
AddUser();
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
bool IsLoginCorrect(const std::wstring & login, bool use_ses_log = false);
|
|
||||||
bool IsEmailCorrect(const std::wstring & email, bool use_ses_log = false);
|
|
||||||
|
|
||||||
bool HasLoginCorrectChars(const std::wstring & login);
|
|
||||||
bool AddNewUser(User & user, const std::wstring & pass);
|
|
||||||
|
|
||||||
bool AddNewUser(const std::wstring & login,
|
|
||||||
const std::wstring & pass,
|
|
||||||
const std::wstring & email,
|
|
||||||
bool autoactivate,
|
|
||||||
bool try_login,
|
|
||||||
bool use_ses_log = false);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
UserPass up;
|
|
||||||
User user;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "cat.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Cat::Cat()
|
|
||||||
{
|
|
||||||
fun.url = L"cat";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Cat::MakeGet()
|
|
||||||
{
|
|
||||||
if( !cur->request->is_item )
|
|
||||||
{
|
|
||||||
log << log1 << "Content: cat function requires an item" << logend;
|
|
||||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( !system->HasReadAccess(cur->request->item) )
|
|
||||||
{
|
|
||||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cur->request->send_as_attachment = cur->request->IsParam(L"attachment");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_cat
|
|
||||||
#define headerfile_winix_functions_cat
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Cat : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Cat();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace Fun
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "chmod.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Chmod::Chmod()
|
|
||||||
{
|
|
||||||
fun.url = L"chmod";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Chmod::MakePost()
|
|
||||||
{
|
|
||||||
priv_changer.SetCur(cur);
|
|
||||||
priv_changer.SetSystem(system);
|
|
||||||
priv_changer.SetDb(db);
|
|
||||||
|
|
||||||
priv_changer.Change(false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Chmod::MakeGet()
|
|
||||||
{
|
|
||||||
priv_changer.SetCur(cur);
|
|
||||||
priv_changer.SetSystem(system);
|
|
||||||
priv_changer.SetDb(db);
|
|
||||||
|
|
||||||
priv_changer.CheckAccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_chmod
|
|
||||||
#define headerfile_winix_functions_chmod
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "privchanger.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Chmod : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Chmod();
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
PrivChanger priv_changer;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "chown.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Chown::Chown()
|
|
||||||
{
|
|
||||||
fun.url = L"chown";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Chown::MakePost()
|
|
||||||
{
|
|
||||||
priv_changer.SetCur(cur);
|
|
||||||
priv_changer.SetSystem(system);
|
|
||||||
priv_changer.SetDb(db);
|
|
||||||
|
|
||||||
priv_changer.Change(true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Chown::MakeGet()
|
|
||||||
{
|
|
||||||
priv_changer.SetCur(cur);
|
|
||||||
priv_changer.SetSystem(system);
|
|
||||||
priv_changer.SetDb(db);
|
|
||||||
|
|
||||||
priv_changer.CheckAccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_chown
|
|
||||||
#define headerfile_winix_functions_chown
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "privchanger.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Chown : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Chown();
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
PrivChanger priv_changer;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ckeditor.h"
|
|
||||||
#include "functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Ckeditor::Ckeditor()
|
|
||||||
{
|
|
||||||
fun.url = L"ckeditor";
|
|
||||||
}
|
|
||||||
|
|
||||||
void Ckeditor::Init()
|
|
||||||
{
|
|
||||||
system->AddCommonFileToVar(L"winix/ckeditor_full.js", L"ckeditor_full.js");
|
|
||||||
system->AddCommonFileToVar(L"winix/ckeditor_winix.js", L"ckeditor_winix.js");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Ckeditor::HasAccess()
|
|
||||||
{
|
|
||||||
return functions->fun_emacs.HasAccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ckeditor::MakeGet()
|
|
||||||
{
|
|
||||||
cur->session->last_css.clear();
|
|
||||||
int parcss = system->mounts.MountParCss();
|
|
||||||
|
|
||||||
if( cur->mount->param[parcss].defined )
|
|
||||||
cur->session->last_css = cur->mount->param[parcss].arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ckeditor::MakePost()
|
|
||||||
{
|
|
||||||
functions->fun_emacs.MakePost();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_ckeditor
|
|
||||||
#define headerfile_winix_functions_ckeditor
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Ckeditor : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Ckeditor();
|
|
||||||
void Init();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakeGet();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "default.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Default::Default()
|
|
||||||
{
|
|
||||||
fun.url = L"default";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Default::HasAccess()
|
|
||||||
{
|
|
||||||
return !cur->request->is_item && system->HasWriteAccess(*cur->request->dir_tab.back());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Default::MakePost()
|
|
||||||
{
|
|
||||||
Item & dir = *cur->request->dir_tab.back();
|
|
||||||
|
|
||||||
dir.link_to = cur->request->PostVar(L"linkto");
|
|
||||||
dir.link_redirect = cur->request->IsPostVar(L"makeredirect") ? 1 : 0;
|
|
||||||
TrimWhite(dir.link_to);
|
|
||||||
|
|
||||||
// !! dodac sprawdzenie czy link_to jest pusty teraz
|
|
||||||
|
|
||||||
cur->request->status = db->EditLinkItem(dir.id, dir.link_to, dir.link_redirect);
|
|
||||||
|
|
||||||
if( cur->request->status == WINIX_ERR_OK )
|
|
||||||
{
|
|
||||||
log << log2 << "Default: changed link_to: " << dir.link_to << ", for dir_id: " << dir.id << logend;
|
|
||||||
system->RedirectToLastDir();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_default
|
|
||||||
#define headerfile_winix_functions_default
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Default : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Default();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "download.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Download::Download()
|
|
||||||
{
|
|
||||||
fun.url = L"download";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Download::MakeGet()
|
|
||||||
{
|
|
||||||
// !! moze wywalic to no_item i wszedzie w takich miejscach dac poprostu permission_denied?
|
|
||||||
if( !cur->request->is_item )
|
|
||||||
{
|
|
||||||
log << log1 << "Content: download function requires an item" << logend;
|
|
||||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if( !system->HasReadAccess(cur->request->item) ||
|
|
||||||
cur->request->item.file_type == WINIX_ITEM_FILETYPE_NONE ||
|
|
||||||
cur->request->item.file_path.empty() )
|
|
||||||
{
|
|
||||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cur->request->send_as_attachment = cur->request->IsParam(L"attachment");
|
|
||||||
|
|
||||||
if( cur->request->item.has_thumb && cur->request->IsParam(L"thumb") )
|
|
||||||
system->MakeFilePath(cur->request->item, cur->request->x_sendfile, true);
|
|
||||||
else
|
|
||||||
system->MakeFilePath(cur->request->item, cur->request->x_sendfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_download
|
|
||||||
#define headerfile_winix_functions_download
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Download : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Download();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_emacs
|
|
||||||
#define headerfile_winix_functions_emacs
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Emacs : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Emacs();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool HasAccess(const Item & item); // !! takie funkcje to nie powinny byc skladowe modelu?
|
|
||||||
bool PostEmacsCheckAbuse(bool adding);
|
|
||||||
void PostFunEmacsModifyMountPoint(bool adding);
|
|
||||||
int NotifyCodeEdit();
|
|
||||||
int NotifyCodeAdd();
|
|
||||||
|
|
||||||
std::wstring old_url;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_env
|
|
||||||
#define headerfile_winix_functions_env
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "space/spaceparser.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Env : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Env();
|
|
||||||
|
|
||||||
bool EditAdminEnv(long user_id, const std::wstring & env_str, bool use_ses_log = false);
|
|
||||||
bool EditEnv(long user_id, const std::wstring & env_str, bool use_ses_log = false);
|
|
||||||
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
// used mainly by templates
|
|
||||||
// can return a null pointer
|
|
||||||
User * GetUser();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
PT::SpaceParser conf_parser;
|
|
||||||
PT::Space space;
|
|
||||||
User * puser;
|
|
||||||
size_t req_id;
|
|
||||||
|
|
||||||
bool Parse(const std::wstring & env_str);
|
|
||||||
void SaveEnv();
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
FunctionBase::FunctionBase()
|
|
||||||
{
|
|
||||||
follow_symlinks = true;
|
|
||||||
template_index = size_t(-1);
|
|
||||||
need_ssl = false;
|
|
||||||
|
|
||||||
fun.user_id = -1;
|
|
||||||
fun.group_id = -1;
|
|
||||||
fun.privileges = 07555;
|
|
||||||
fun.parent_id = -1;
|
|
||||||
fun.id = -1;
|
|
||||||
fun.type = Item::file;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetConfig(Config * pconfig)
|
|
||||||
{
|
|
||||||
config = pconfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetCur(Cur * pcur)
|
|
||||||
{
|
|
||||||
cur = pcur;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetDb(Db * pdb)
|
|
||||||
{
|
|
||||||
db = pdb;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetSystem(System * psystem)
|
|
||||||
{
|
|
||||||
system = psystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetFunctions(Functions * pfunctions)
|
|
||||||
{
|
|
||||||
functions = pfunctions;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetTemplates(Templates * ptemplates)
|
|
||||||
{
|
|
||||||
templates = ptemplates;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetSynchro(Synchro * psynchro)
|
|
||||||
{
|
|
||||||
synchro = psynchro;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::SetSessionManager(SessionManager * pmanager)
|
|
||||||
{
|
|
||||||
session_manager = pmanager;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::Init()
|
|
||||||
{
|
|
||||||
// this method is called only once at the beginning
|
|
||||||
// when winix starts
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool FunctionBase::HasAccess()
|
|
||||||
{
|
|
||||||
// true by default
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::MakePost()
|
|
||||||
{
|
|
||||||
// do nothing by default
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void FunctionBase::MakeGet()
|
|
||||||
{
|
|
||||||
// do nothing by default
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_functionbase
|
|
||||||
#define headerfile_winix_functions_functionbase
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include "core/item.h"
|
|
||||||
#include "db/db.h"
|
|
||||||
#include "core/request.h"
|
|
||||||
#include "core/config.h"
|
|
||||||
#include "core/system.h"
|
|
||||||
#include "core/synchro.h"
|
|
||||||
#include "notify/notify.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Functions;
|
|
||||||
class Templates;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
FunctionBase();
|
|
||||||
|
|
||||||
// user, group, permissions, url (function name)
|
|
||||||
Item fun;
|
|
||||||
|
|
||||||
// auto follow sym links, default: true
|
|
||||||
bool follow_symlinks;
|
|
||||||
|
|
||||||
// html template index (for using with 'patterns' object)
|
|
||||||
size_t template_index;
|
|
||||||
|
|
||||||
// try to use SSL
|
|
||||||
// if in the config 'use_ssl' is true and 'use_ssl_only_for_logged_users' is true
|
|
||||||
// then ssl is used only for logged users but sometimes there is a need to use
|
|
||||||
// SSL even if noone is logged (for example for such functions like 'login' or 'adduser')
|
|
||||||
// default: false
|
|
||||||
// (this option is ignored if 'use_ssl' in the config is false)
|
|
||||||
bool need_ssl;
|
|
||||||
|
|
||||||
virtual void Init();
|
|
||||||
virtual bool HasAccess();
|
|
||||||
virtual void MakePost();
|
|
||||||
virtual void MakeGet();
|
|
||||||
|
|
||||||
void SetConfig(Config * pconfig);
|
|
||||||
void SetCur(Cur * pcur);
|
|
||||||
void SetDb(Db * pdb);
|
|
||||||
void SetSystem(System * psystem);
|
|
||||||
void SetFunctions(Functions * pfunctions);
|
|
||||||
void SetTemplates(Templates * ptemplates);
|
|
||||||
void SetSynchro(Synchro * psynchro);
|
|
||||||
void SetSessionManager(SessionManager * pmanager);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
Config * config;
|
|
||||||
Cur * cur;
|
|
||||||
Db * db;
|
|
||||||
System * system;
|
|
||||||
Functions * functions;
|
|
||||||
Templates * templates;
|
|
||||||
Synchro * synchro;
|
|
||||||
SessionManager * session_manager;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_functionparser
|
|
||||||
#define headerfile_winix_functions_functionparser
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include "db/db.h"
|
|
||||||
#include "core/cur.h"
|
|
||||||
#include "core/system.h"
|
|
||||||
|
|
||||||
|
|
||||||
class Functions;
|
|
||||||
|
|
||||||
|
|
||||||
class FunctionParser
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
FunctionParser();
|
|
||||||
bool Parse(Cur * pcur, Db * pdb, Functions * pfunctions, System * psystem);
|
|
||||||
void UTF8(bool use_utf8);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Db * db;
|
|
||||||
Cur * cur;
|
|
||||||
System * system;
|
|
||||||
Functions * functions;
|
|
||||||
|
|
||||||
const char * path;
|
|
||||||
std::string name_ascii, value_ascii;
|
|
||||||
std::wstring name, value;
|
|
||||||
Item * last_dir;
|
|
||||||
Param param;
|
|
||||||
bool utf8;
|
|
||||||
|
|
||||||
void SkipSlashes();
|
|
||||||
|
|
||||||
void ParseDirsItemFunction();
|
|
||||||
void ParseParams();
|
|
||||||
void ParseAnchor();
|
|
||||||
|
|
||||||
bool IsDir();
|
|
||||||
bool CheckAddItem();
|
|
||||||
bool CheckAddFunction();
|
|
||||||
bool AddRootDir();
|
|
||||||
void AddDir();
|
|
||||||
void AddParam();
|
|
||||||
void ParseOrdinaryParams();
|
|
||||||
void ParseWinixParams();
|
|
||||||
|
|
||||||
void ToWide(const std::string & src, std::wstring & dst);
|
|
||||||
|
|
||||||
int FromHex(int c);
|
|
||||||
int GetChar();
|
|
||||||
void ReadName();
|
|
||||||
void ReadOrdinaryParName();
|
|
||||||
void ReadOrdinaryParValue();
|
|
||||||
void ReadWinixParName();
|
|
||||||
void ReadWinixParValue();
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_imgcrop
|
|
||||||
#define headerfile_winix_functions_imgcrop
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class ImgCrop : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
ImgCrop();
|
|
||||||
|
|
||||||
bool HasAccess();
|
|
||||||
void MakeGet();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
DbItemQuery iq;
|
|
||||||
|
|
||||||
void GetDirContent();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include "ipban.h"
|
|
||||||
#include "functions.h"
|
|
||||||
#include "core/sessionmanager.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
IPBanFun::IPBanFun()
|
|
||||||
{
|
|
||||||
fun.url = L"ipban";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool IPBanFun::HasAccess()
|
|
||||||
{
|
|
||||||
return cur->session->puser && cur->session->puser->super_user;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void IPBanFun::MakePost()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void IPBanFun::MakeGet()
|
|
||||||
{
|
|
||||||
if( cur->request->IsParam(L"removeip") )
|
|
||||||
{
|
|
||||||
if( cur->request->ParamValue(L"removeip") == L"all" )
|
|
||||||
{
|
|
||||||
session_manager->ClearIPBanList();
|
|
||||||
cur->session->ip_ban = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int cur_ip = 0;
|
|
||||||
|
|
||||||
if( cur->session->ip_ban )
|
|
||||||
cur_ip = cur->session->ip_ban->ip;
|
|
||||||
|
|
||||||
AssignString(cur->request->ParamValue(L"removeip"), tmp_ip_str);
|
|
||||||
int ip = (int)inet_addr(tmp_ip_str.c_str());
|
|
||||||
session_manager->RemoveIPBan(ip);
|
|
||||||
|
|
||||||
if( cur->session->ip_ban && cur_ip == ip )
|
|
||||||
cur->session->ip_ban = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
system->RedirectToLastFunction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_ipban
|
|
||||||
#define headerfile_winix_functions_ipban
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
// IPBanFun in order to not confused with IPBan from core winix
|
|
||||||
class IPBanFun : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
IPBanFun();
|
|
||||||
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
std::string tmp_ip_str;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "last.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Last::Last()
|
|
||||||
{
|
|
||||||
fun.url = L"last";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Last::HasAccess()
|
|
||||||
{
|
|
||||||
return cur->session->puser != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_last
|
|
||||||
#define headerfile_winix_functions_last
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Last : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Last();
|
|
||||||
bool HasAccess();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
111
functions/ln.cpp
111
functions/ln.cpp
@@ -1,111 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ln.h"
|
|
||||||
#include "core/misc.h"
|
|
||||||
#include "functions/functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Ln::Ln()
|
|
||||||
{
|
|
||||||
fun.url = L"ln";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Ln::HasAccess()
|
|
||||||
{
|
|
||||||
return system->HasWriteAccess(*cur->request->dir_tab.back());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ln::CreateSymbolicLink(const std::wstring & link_to)
|
|
||||||
{
|
|
||||||
item.Clear(); // setting the date to now
|
|
||||||
item.type = Item::symlink;
|
|
||||||
item.parent_id = cur->request->dir_tab.back()->id;
|
|
||||||
item.url = cur->request->PostVar(L"url");
|
|
||||||
item.link_to = link_to;
|
|
||||||
item.link_redirect = cur->request->IsPostVar(L"makeredirect") ? 1 : 0;
|
|
||||||
item.privileges = system->NewFilePrivileges();
|
|
||||||
functions->SetUser(item);
|
|
||||||
functions->PrepareUrl(item);
|
|
||||||
|
|
||||||
cur->request->status = db->AddItem(item);
|
|
||||||
|
|
||||||
if( cur->request->status == WINIX_ERR_OK )
|
|
||||||
log << log3 << "Ln: created a symbolic link to: " << link_to << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ln::CreateHardLink(const std::wstring & link_to)
|
|
||||||
{
|
|
||||||
int res = system->FollowAllLinks(cur->request->dir_tab, link_to, dir_tab, item, false, false);
|
|
||||||
|
|
||||||
if( res == 0 )
|
|
||||||
{
|
|
||||||
log << log2 << "Ln: " << link_to << " is a directory (can't create a hard link)" << logend;
|
|
||||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if( res == 1 )
|
|
||||||
{
|
|
||||||
item.SetDateToNow();
|
|
||||||
item.type = Item::file;
|
|
||||||
item.parent_id = cur->request->dir_tab.back()->id;
|
|
||||||
item.url = cur->request->PostVar(L"url");
|
|
||||||
item.privileges = system->NewFilePrivileges();
|
|
||||||
functions->SetUser(item);
|
|
||||||
functions->PrepareUrl(item);
|
|
||||||
cur->request->status = db->AddHardLink(item);
|
|
||||||
|
|
||||||
if( cur->request->status == WINIX_ERR_OK )
|
|
||||||
log << log3 << "Ln: created a hard link to: " << link_to << logend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if( res == 5 || res == 6 )
|
|
||||||
{
|
|
||||||
cur->request->status = WINIX_ERR_PERMISSION_DENIED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cur->request->status = WINIX_ERR_NO_ITEM;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// we do not use notifications for links
|
|
||||||
void Ln::MakePost()
|
|
||||||
{
|
|
||||||
link_to = cur->request->PostVar(L"linkto");
|
|
||||||
TrimWhite(link_to);
|
|
||||||
|
|
||||||
if( link_to.empty() )
|
|
||||||
return;
|
|
||||||
|
|
||||||
int type = Toi(cur->request->PostVar(L"linktype"));
|
|
||||||
|
|
||||||
if( type == 0 )
|
|
||||||
CreateHardLink(link_to);
|
|
||||||
else
|
|
||||||
CreateSymbolicLink(link_to);
|
|
||||||
|
|
||||||
if( cur->request->status == WINIX_ERR_OK )
|
|
||||||
system->RedirectTo(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_ln
|
|
||||||
#define headerfile_winix_functions_ln
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Ln : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Ln();
|
|
||||||
bool HasAccess();
|
|
||||||
void CreateSymbolicLink(const std::wstring & link_to);
|
|
||||||
void CreateHardLink(const std::wstring & link_to);
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
Item item;
|
|
||||||
std::wstring link_to;
|
|
||||||
std::vector<Item*> dir_tab;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "locale.h"
|
|
||||||
#include "templates/templates.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Locale::Locale()
|
|
||||||
{
|
|
||||||
fun.url = L"locale";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Locale::HasAccess()
|
|
||||||
{
|
|
||||||
return cur->session->puser != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Locale::MakePost()
|
|
||||||
{
|
|
||||||
if( cur->session->puser )
|
|
||||||
{
|
|
||||||
size_t locale_id = size_t(Toi(cur->request->PostVar(L"localeid")));
|
|
||||||
|
|
||||||
if( TemplatesFunctions::locale.HasLanguage(locale_id) )
|
|
||||||
{
|
|
||||||
cur->session->puser->locale_id = locale_id;
|
|
||||||
db->ChangeUserLocale(cur->session->puser->id, locale_id);
|
|
||||||
TemplatesFunctions::locale.SetCurLang(locale_id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log1 << "Locale: incorrect locale id: " << locale_id << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Locale::MakeGet()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_locale
|
|
||||||
#define headerfile_winix_functions_locale
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Locale : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Locale();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_login
|
|
||||||
#define headerfile_winix_functions_login
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "core/user.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Login : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Login();
|
|
||||||
|
|
||||||
void MakePost();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
bool ShouldUseCaptchaForCurrentIP();
|
|
||||||
bool ShouldUseCaptchaFor(const IPBan & ipban);
|
|
||||||
|
|
||||||
bool CannotLoginFromCurrentIP();
|
|
||||||
bool CannotLoginFrom(const IPBan & ipban);
|
|
||||||
|
|
||||||
bool CheckUserPass(const std::wstring & login, const std::wstring & password, long & user_id);
|
|
||||||
bool LoginUser(const std::wstring & login, const std::wstring & password, bool remember_me,
|
|
||||||
bool use_ses_log = false, bool check_abuse = false);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
void ClearTmpStruct();
|
|
||||||
bool CheckPasswords(const std::wstring & password);
|
|
||||||
void AddBanInfo();
|
|
||||||
bool CheckAbuse();
|
|
||||||
|
|
||||||
UserPass up, up2;
|
|
||||||
std::string pass_decrypted;
|
|
||||||
std::wstring pass_hashed;
|
|
||||||
std::wstring salt;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "logout.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Logout::Logout()
|
|
||||||
{
|
|
||||||
fun.url = L"logout";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Logout::MakeGet()
|
|
||||||
{
|
|
||||||
if( cur->session->puser )
|
|
||||||
{
|
|
||||||
system->users.LogoutCurrentUser();
|
|
||||||
system->RedirectToLastItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_logout
|
|
||||||
#define headerfile_winix_functions_logout
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Logout : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Logout();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ls.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Ls::Ls()
|
|
||||||
{
|
|
||||||
fun.url = L"ls";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Ls::MakeGet()
|
|
||||||
{
|
|
||||||
if( !cur->request->is_item )
|
|
||||||
{
|
|
||||||
DbItemQuery iq;
|
|
||||||
|
|
||||||
iq.sel_content = false;
|
|
||||||
|
|
||||||
iq.WhereParentId(cur->request->dir_tab.back()->id);
|
|
||||||
iq.WhereType(Item::dir, false);
|
|
||||||
|
|
||||||
if( cur->request->IsParam(L"ckeditor_browse") )
|
|
||||||
{
|
|
||||||
iq.WhereFileType(WINIX_ITEM_FILETYPE_IMAGE);
|
|
||||||
db->GetItems(cur->request->item_tab, iq);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
db->GetItems(cur->request->item_tab, iq);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_ls
|
|
||||||
#define headerfile_winix_functions_ls
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Ls : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Ls();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "man.h"
|
|
||||||
#include "functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Man::Man()
|
|
||||||
{
|
|
||||||
fun.url = L"man";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_man
|
|
||||||
#define headerfile_winix_functions_man
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Man : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Man();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_meta
|
|
||||||
#define headerfile_winix_functions_meta
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "space/spaceparser.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Meta : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Meta();
|
|
||||||
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
bool EditAdminMeta(long item_id, const std::wstring & meta_str, bool use_ses_log = false);
|
|
||||||
bool EditMeta(long item_id, const std::wstring & meta_str, bool use_ses_log = false);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
PT::SpaceParser conf_parser;
|
|
||||||
PT::Space space;
|
|
||||||
|
|
||||||
bool Parse(const std::wstring & meta_str);
|
|
||||||
void ChangeAdminMeta();
|
|
||||||
void ChangeMeta();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "mkdir.h"
|
|
||||||
#include "functions.h"
|
|
||||||
#include "core/plugin.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Mkdir::Mkdir()
|
|
||||||
{
|
|
||||||
fun.url = L"mkdir";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Mkdir::HasAccess(const Item & item)
|
|
||||||
{
|
|
||||||
// you can create a directory only in a directory
|
|
||||||
if( item.type != Item::dir )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( cur->session->puser && cur->session->puser->super_user )
|
|
||||||
// super user can use mkdir everywhere
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if( !system->HasWriteAccess(item) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if( !system->mounts.pmount->IsPar(system->mounts.MountParMkdirOn()) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if( system->mounts.pmount->IsArg(system->mounts.MountParMkdirOn(), cur->request->dir_tab.size()) )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Mkdir::HasAccess()
|
|
||||||
{
|
|
||||||
if( cur->request->is_item || !HasAccess(*cur->request->dir_tab.back()) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Mkdir::PostFunMkdir(bool add_to_dir_tab, int privileges)
|
|
||||||
{
|
|
||||||
functions->ReadItem(cur->request->item, Item::dir);
|
|
||||||
functions->SetUser(cur->request->item);
|
|
||||||
cur->request->item.privileges = privileges;
|
|
||||||
Item * pdir;
|
|
||||||
|
|
||||||
cur->request->status = system->dirs.AddDirectory(cur->request->item, add_to_dir_tab, &pdir);
|
|
||||||
|
|
||||||
if( cur->request->status == WINIX_ERR_OK )
|
|
||||||
{
|
|
||||||
if( pdir )
|
|
||||||
plugin.Call(WINIX_DIR_ADDED, pdir);
|
|
||||||
|
|
||||||
system->RedirectTo(cur->request->item);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log1 << "Content: PostFunMkdir: Error: " << cur->request->status << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Mkdir::MakePost()
|
|
||||||
{
|
|
||||||
PostFunMkdir(false, system->NewDirPrivileges());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_mkdir
|
|
||||||
#define headerfile_winix_functions_mkdir
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Mkdir : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Mkdir();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool HasAccess(const Item & item); // !! moze to powinien byc skladnik modelu?
|
|
||||||
bool FunMkdirCheckAccess();
|
|
||||||
void PostFunMkdir(bool add_to_dir_tab, int privileges);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "mount.h"
|
|
||||||
#include "functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Mount::Mount()
|
|
||||||
{
|
|
||||||
fun.url = L"mount";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Mount::HasAccess()
|
|
||||||
{
|
|
||||||
if( cur->session->puser && cur->session->puser->super_user )
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Mount::MakeGet()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_mount
|
|
||||||
#define headerfile_winix_functions_mount
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Mount : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Mount();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "nicedit.h"
|
|
||||||
#include "functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Nicedit::Nicedit()
|
|
||||||
{
|
|
||||||
fun.url = L"nicedit";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Nicedit::HasAccess()
|
|
||||||
{
|
|
||||||
return functions->fun_emacs.HasAccess();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Nicedit::MakePost()
|
|
||||||
{
|
|
||||||
functions->fun_emacs.MakePost();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_nicedit
|
|
||||||
#define headerfile_winix_functions_nicedit
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Nicedit : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Nicedit();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -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 "node.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
Node::Node()
|
|
||||||
{
|
|
||||||
fun.url = L"node";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Node::MakeGet()
|
|
||||||
{
|
|
||||||
if( cur->request->param_tab.empty() )
|
|
||||||
{
|
|
||||||
//cur->request->status = Error
|
|
||||||
//!!zglosic 404
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
long id = Tol(cur->request->param_tab[0].name);
|
|
||||||
system->RedirectTo(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2010, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_node
|
|
||||||
#define headerfile_winix_functions_node
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Node : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Node();
|
|
||||||
void MakeGet();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011-2012, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "passwd.h"
|
|
||||||
#include "core/slog.h"
|
|
||||||
#include "functions/functions.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
Passwd::Passwd()
|
|
||||||
{
|
|
||||||
fun.url = L"passwd";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Passwd::HasAccess()
|
|
||||||
{
|
|
||||||
return cur->session->puser != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Passwd::IsPasswordCorrect(const std::wstring & pass, const std::wstring & conf_pass, bool use_ses_log)
|
|
||||||
{
|
|
||||||
if( pass != conf_pass )
|
|
||||||
{
|
|
||||||
log << log2 << "Passwd: passwords are different" << logend;
|
|
||||||
|
|
||||||
if( use_ses_log )
|
|
||||||
slog << logerror << T("adduser_err_passwords_different") << logend;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pass.size() < config->pass_min_size )
|
|
||||||
{
|
|
||||||
log << log2 << "Passwd: password is too small" << logend;
|
|
||||||
|
|
||||||
if( use_ses_log )
|
|
||||||
slog << logerror << T("adduser_err_password_too_small") << " "
|
|
||||||
<< config->pass_min_size << " " << T("adduser_err_password_too_small2") << logend;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pass.size() > WINIX_ACCOUNT_MAX_PASSWORD_SIZE )
|
|
||||||
{
|
|
||||||
log << log2 << "Passwd: password can't be longer than: " << WINIX_ACCOUNT_MAX_PASSWORD_SIZE << " characters" << logend;
|
|
||||||
|
|
||||||
if( use_ses_log )
|
|
||||||
slog << logerror << T("adduser_err_password_too_big") << " " << WINIX_ACCOUNT_MAX_PASSWORD_SIZE
|
|
||||||
<< " " << T("adduser_err_password_too_big2") << logend;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Passwd::ChangePassword(long user_id, const std::wstring & new_password)
|
|
||||||
{
|
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
User * puser = system->users.GetUser(user_id);
|
|
||||||
|
|
||||||
if( puser )
|
|
||||||
{
|
|
||||||
up.pass = new_password;
|
|
||||||
system->crypt.PassHashCrypt(up);
|
|
||||||
result = (db->ChangeUserPass(user_id, up) == WINIX_ERR_OK);
|
|
||||||
|
|
||||||
if( result )
|
|
||||||
log << log2 << "Passwd: password for user " << puser->name << " has been changed" << logend;
|
|
||||||
else
|
|
||||||
log << log1 << "Passwd: I cannot change password -- database problem" << logend;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log << log1 << "Passwd: there is no a user with id: " << user_id << logend;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void Passwd::ChangePassword(User * puser)
|
|
||||||
{
|
|
||||||
long user_id;
|
|
||||||
|
|
||||||
const std::wstring & pass_cur = cur->request->PostVar(L"passwordcur");
|
|
||||||
const std::wstring & pass_new = cur->request->PostVar(L"passwordnew");
|
|
||||||
const std::wstring & pass_conf = cur->request->PostVar(L"passwordconfirm");
|
|
||||||
|
|
||||||
if( !cur->session->puser->super_user && !functions->fun_login.CheckUserPass(puser->name, pass_cur, user_id) )
|
|
||||||
{
|
|
||||||
log << log3 << "Passwd: incorrect current password" << logend;
|
|
||||||
slog << logerror << T("passwd_err_bad_current_password") << logend;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( !IsPasswordCorrect(pass_new, pass_conf, true) )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if( ChangePassword(puser->id, pass_new) )
|
|
||||||
{
|
|
||||||
slog << loginfo << T("passwd_password_changed") << logend;
|
|
||||||
system->RedirectToLastItem();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
if you are a root (super_user) you can change a password for everyone
|
|
||||||
(the html form has a select option)
|
|
||||||
|
|
||||||
but if you are not a root you can change only your password
|
|
||||||
and you should provide your current password as well
|
|
||||||
*/
|
|
||||||
void Passwd::MakePost()
|
|
||||||
{
|
|
||||||
const std::wstring * plogin;
|
|
||||||
|
|
||||||
if( cur->session->puser )
|
|
||||||
{
|
|
||||||
if( cur->session->puser->super_user )
|
|
||||||
plogin = &cur->request->PostVar(L"login");
|
|
||||||
else
|
|
||||||
plogin = &cur->session->puser->name;
|
|
||||||
|
|
||||||
User * puser = system->users.GetUser(*plogin);
|
|
||||||
|
|
||||||
if( puser )
|
|
||||||
ChangePassword(puser);
|
|
||||||
else
|
|
||||||
log << log1 << "Passwd: there is no such a user: " << *plogin << logend;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is a part of Winix
|
|
||||||
* and is not publicly distributed
|
|
||||||
*
|
|
||||||
* Copyright (c) 2011, Tomasz Sowa
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef headerfile_winix_functions_passwd
|
|
||||||
#define headerfile_winix_functions_passwd
|
|
||||||
|
|
||||||
#include "functionbase.h"
|
|
||||||
#include "core/user.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Fun
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
class Passwd : public FunctionBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
Passwd();
|
|
||||||
bool HasAccess();
|
|
||||||
void MakePost();
|
|
||||||
|
|
||||||
bool IsPasswordCorrect(const std::wstring & pass, const std::wstring & conf_pass, bool use_ses_log = false);
|
|
||||||
bool ChangePassword(long user_id, const std::wstring & new_password);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
UserPass up;
|
|
||||||
|
|
||||||
void ChangePassword(User * puser);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user