fixed: Config::Text() returned a reference to a local variable (std::string)

added: 'static' directory with *.css and images
       we have a default layout
moved: locale from data to templates       
       notification templates have its own locale object
added: reload function reloades locale now too
added: 'nice' form of item_info in templates



git-svn-id: svn://ttmath.org/publicrep/winix/trunk@582 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2010-02-15 00:31:14 +00:00
parent c58031cbf4
commit fa8d8f9ea0
38 changed files with 678 additions and 574 deletions

View File

@ -1,12 +1,17 @@
# Makefile for GNU make
ifndef CXX
CXX = g++
CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/ezc/src -L/usr/local/lib
CXXFLAGSMAIN = -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/ezc/src -L/usr/local/lib
endif
ifndef CXXFLAGS
CXXFLAGS = -fPIC -Wall -pedantic -O2 -I/usr/local/include -I/home/tomek/roboczy/winix -I/home/tomek/roboczy/ezc/src -L/usr/local/lib -DEZC_USE_WINIX_LOGGER
endif
export CXX
export CXXFLAGS
export CXXFLAGSMAIN
all: winix
@ -21,7 +26,7 @@ winix: FORCE
$(CXX) -shared -o winix.so $(CXXFLAGS) core/*.o content/*.o templates/*.o templatesnotify/*.o confparser/*.o ../ezc/src/ezc.a -lfcgi -lpq -lz
@cd main ; $(MAKE) -e
# use the full path with winix.so
$(CXX) -o winix $(CXXFLAGSMAIN) main/*.o /home/tomek/roboczy/winix/winix.so
$(CXX) -o winix $(CXXFLAGS) main/*.o /home/tomek/roboczy/winix/winix.so
clean:

View File

@ -28,7 +28,7 @@ content.o: ../core/db.h ../core/group.h ../core/dircontainer.h
content.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
content.o: ../core/users.h ../core/groups.h ../core/functions.h
content.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
content.o: ../core/locale.h ../core/loadavg.h ../core/misc.h ../core/plugin.h
content.o: ../core/loadavg.h ../core/misc.h ../core/plugin.h
content.o: ../core/request.h ../core/data.h ../core/pluginmsg.h
createthread.o: content.h ../core/item.h ../templates/templates.h
createthread.o: ../templates/patterncacher.h ../templates/misc.h
@ -46,7 +46,7 @@ createthread.o: ../core/db.h ../core/group.h ../core/dircontainer.h
createthread.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
createthread.o: ../core/dirs.h ../core/users.h ../core/groups.h
createthread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
createthread.o: ../core/mount.h ../core/locale.h ../core/loadavg.h
createthread.o: ../core/mount.h ../core/loadavg.h
createticket.o: content.h ../core/item.h ../templates/templates.h
createticket.o: ../templates/patterncacher.h ../templates/misc.h
createticket.o: ../templates/localefilter.h ../core/locale.h
@ -63,7 +63,7 @@ createticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h
createticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
createticket.o: ../core/dirs.h ../core/users.h ../core/groups.h
createticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
createticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h
createticket.o: ../core/mount.h ../core/loadavg.h
default.o: content.h ../core/item.h ../templates/templates.h
default.o: ../templates/patterncacher.h ../templates/misc.h
default.o: ../templates/localefilter.h ../core/locale.h
@ -80,7 +80,7 @@ default.o: ../core/db.h ../core/group.h ../core/dircontainer.h
default.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h
default.o: ../core/users.h ../core/groups.h ../core/functions.h
default.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
default.o: ../core/locale.h ../core/loadavg.h
default.o: ../core/loadavg.h
editticket.o: content.h ../core/item.h ../templates/templates.h
editticket.o: ../templates/patterncacher.h ../templates/misc.h
editticket.o: ../templates/localefilter.h ../core/locale.h
@ -97,7 +97,7 @@ editticket.o: ../core/db.h ../core/group.h ../core/dircontainer.h
editticket.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
editticket.o: ../core/dirs.h ../core/users.h ../core/groups.h
editticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
editticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h
editticket.o: ../core/mount.h ../core/loadavg.h
emacs.o: content.h ../core/item.h ../templates/templates.h
emacs.o: ../templates/patterncacher.h ../templates/misc.h
emacs.o: ../templates/localefilter.h ../core/locale.h
@ -113,9 +113,9 @@ emacs.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
emacs.o: ../core/db.h ../core/group.h ../core/dircontainer.h
emacs.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
emacs.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
emacs.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h
emacs.o: ../core/notify.h ../templatesnotify/templatesnotify.h
emacs.o: ../core/mount.h ../templates/misc.h ../core/misc.h
emacs.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/notify.h
emacs.o: ../templatesnotify/templatesnotify.h ../core/mount.h
emacs.o: ../templates/misc.h ../core/misc.h
last.o: content.h ../core/item.h ../templates/templates.h
last.o: ../templates/patterncacher.h ../templates/misc.h
last.o: ../templates/localefilter.h ../core/locale.h
@ -137,7 +137,7 @@ login.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
login.o: ../core/db.h ../core/group.h ../core/dircontainer.h
login.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
login.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
login.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h
login.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h
logout.o: content.h ../core/item.h ../templates/templates.h
logout.o: ../templates/patterncacher.h ../templates/misc.h
logout.o: ../templates/localefilter.h ../core/locale.h
@ -153,7 +153,7 @@ logout.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
logout.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
logout.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
logout.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
logout.o: ../core/mount.h ../core/locale.h ../core/loadavg.h
logout.o: ../core/mount.h ../core/loadavg.h
ls.o: content.h ../core/item.h ../templates/templates.h
ls.o: ../templates/patterncacher.h ../templates/misc.h
ls.o: ../templates/localefilter.h ../core/locale.h ../confparser/confparser.h
@ -197,8 +197,7 @@ misc_specialfile.o: ../core/ticket.h ../core/data.h ../core/dirs.h
misc_specialfile.o: ../core/dircontainer.h ../core/users.h
misc_specialfile.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
misc_specialfile.o: ../core/functions.h ../core/lastcontainer.h
misc_specialfile.o: ../core/mounts.h ../core/mount.h ../core/locale.h
misc_specialfile.o: ../core/loadavg.h
misc_specialfile.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h
mkdir.o: content.h ../core/item.h ../templates/templates.h
mkdir.o: ../templates/patterncacher.h ../templates/misc.h
mkdir.o: ../templates/localefilter.h ../core/locale.h
@ -214,9 +213,9 @@ mkdir.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
mkdir.o: ../core/db.h ../core/group.h ../core/dircontainer.h
mkdir.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
mkdir.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
mkdir.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h
mkdir.o: ../core/notify.h ../templatesnotify/templatesnotify.h
mkdir.o: ../core/mount.h ../templates/misc.h
mkdir.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/notify.h
mkdir.o: ../templatesnotify/templatesnotify.h ../core/mount.h
mkdir.o: ../templates/misc.h
node.o: content.h ../core/item.h ../templates/templates.h
node.o: ../templates/patterncacher.h ../templates/misc.h
node.o: ../templates/localefilter.h ../core/locale.h
@ -244,7 +243,7 @@ priv.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h
priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h
priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
priv.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h
priv.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h
reload.o: content.h ../core/item.h ../templates/templates.h
reload.o: ../templates/patterncacher.h ../templates/misc.h
reload.o: ../templates/localefilter.h ../core/locale.h
@ -273,7 +272,7 @@ rm.o: ../core/postmultiparser.h ../core/ticket.h ../core/error.h ../core/db.h
rm.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
rm.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
rm.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
rm.o: ../core/mount.h ../core/locale.h ../core/loadavg.h
rm.o: ../core/mount.h ../core/loadavg.h
run.o: content.h ../core/item.h ../templates/templates.h
run.o: ../templates/patterncacher.h ../templates/misc.h
run.o: ../templates/localefilter.h ../core/locale.h
@ -301,7 +300,7 @@ thread.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
thread.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
thread.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
thread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
thread.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/mount.h
thread.o: ../core/mount.h ../core/loadavg.h ../core/mount.h
ticket.o: content.h ../core/item.h ../templates/templates.h
ticket.o: ../templates/patterncacher.h ../templates/misc.h
ticket.o: ../templates/localefilter.h ../core/locale.h
@ -317,7 +316,7 @@ ticket.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
ticket.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
ticket.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
ticket.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
ticket.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/mount.h
ticket.o: ../core/mount.h ../core/loadavg.h ../core/mount.h
upload.o: content.h ../core/item.h ../templates/templates.h
upload.o: ../templates/patterncacher.h ../templates/misc.h
upload.o: ../templates/localefilter.h ../core/locale.h
@ -333,7 +332,7 @@ upload.o: ../core/postmultiparser.h ../core/ticket.h ../core/data.h
upload.o: ../core/dirs.h ../core/dircontainer.h ../core/users.h
upload.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
upload.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
upload.o: ../core/mount.h ../core/locale.h ../core/loadavg.h ../core/misc.h
upload.o: ../core/mount.h ../core/loadavg.h ../core/misc.h
who.o: content.h ../core/item.h ../templates/templates.h
who.o: ../templates/patterncacher.h ../templates/misc.h
who.o: ../templates/localefilter.h ../core/locale.h

View File

@ -59,7 +59,7 @@ return with_url;
void Content::ReadItemContentWithType(Item & item)
{
item.content_type = Item::ct_formatted_text; // default is formatted text
request.PostVar("content", request.item.content);
request.PostVar("itemcontent", request.item.content);
request.PostVar("contenttype", temp);
// ct_text and ct_formatted_text can use everyone

View File

@ -5,14 +5,13 @@ compress.o: compress.h log.h
config.o: config.h ../confparser/confparser.h log.h data.h dirs.h item.h
config.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
config.o: functions.h function.h lastcontainer.h mounts.h mount.h error.h
config.o: rebus.h locale.h loadavg.h plugin.h request.h requesttypes.h
config.o: session.h done.h thread.h compress.h acceptencodingparser.h
config.o: rebus.h loadavg.h plugin.h request.h requesttypes.h session.h
config.o: done.h thread.h compress.h acceptencodingparser.h
config.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
config.o: pluginmsg.h misc.h
data.o: data.h dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
data.o: log.h groups.h group.h functions.h function.h lastcontainer.h
data.o: mounts.h mount.h error.h rebus.h locale.h ../confparser/confparser.h
data.o: loadavg.h
data.o: mounts.h mount.h error.h rebus.h loadavg.h
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
db.o: ugcontainer.h ticket.h misc.h
db_itemcolumns.o: db.h item.h user.h group.h thread.h error.h log.h
@ -20,8 +19,7 @@ db_itemcolumns.o: dircontainer.h ugcontainer.h ticket.h
dircontainer.o: dircontainer.h item.h log.h
dirs.o: dirs.h item.h dircontainer.h error.h log.h db.h user.h group.h
dirs.o: thread.h ugcontainer.h ticket.h data.h users.h groups.h functions.h
dirs.o: function.h lastcontainer.h mounts.h mount.h rebus.h locale.h
dirs.o: ../confparser/confparser.h loadavg.h
dirs.o: function.h lastcontainer.h mounts.h mount.h rebus.h loadavg.h
done.o: done.h
error.o: error.h log.h
function.o: function.h item.h
@ -29,10 +27,9 @@ functioncodeparser.o: functioncodeparser.h item.h function.h log.h
functionparser.o: functionparser.h requesttypes.h log.h item.h error.h data.h
functionparser.o: dirs.h dircontainer.h users.h user.h ugcontainer.h groups.h
functionparser.o: group.h functions.h function.h lastcontainer.h mounts.h
functionparser.o: mount.h rebus.h locale.h ../confparser/confparser.h
functionparser.o: loadavg.h db.h thread.h ticket.h request.h session.h done.h
functionparser.o: compress.h acceptencodingparser.h acceptbaseparser.h
functionparser.o: htmlfilter.h postmultiparser.h
functionparser.o: mount.h rebus.h loadavg.h db.h thread.h ticket.h request.h
functionparser.o: session.h done.h compress.h acceptencodingparser.h
functionparser.o: acceptbaseparser.h htmlfilter.h postmultiparser.h
functions.o: functions.h function.h item.h
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
groups.o: error.h dircontainer.h ticket.h
@ -44,39 +41,36 @@ locale.o: locale.h ../confparser/confparser.h log.h
log.o: log.h
misc.o: misc.h item.h log.h data.h dirs.h dircontainer.h users.h user.h
misc.o: ugcontainer.h groups.h group.h functions.h function.h lastcontainer.h
misc.o: mounts.h mount.h error.h rebus.h locale.h ../confparser/confparser.h
misc.o: loadavg.h
misc.o: mounts.h mount.h error.h rebus.h loadavg.h
mount.o: mount.h
mountparser.o: mountparser.h mount.h item.h error.h log.h data.h dirs.h
mountparser.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
mountparser.o: functions.h function.h lastcontainer.h mounts.h rebus.h
mountparser.o: locale.h ../confparser/confparser.h loadavg.h misc.h
mountparser.o: loadavg.h misc.h
mounts.o: mounts.h mount.h error.h log.h data.h dirs.h item.h dircontainer.h
mounts.o: users.h user.h ugcontainer.h groups.h group.h functions.h
mounts.o: function.h lastcontainer.h rebus.h locale.h
mounts.o: ../confparser/confparser.h loadavg.h request.h requesttypes.h
mounts.o: session.h done.h thread.h compress.h acceptencodingparser.h
mounts.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
mounts.o: mountparser.h db.h
mounts.o: function.h lastcontainer.h rebus.h loadavg.h request.h
mounts.o: requesttypes.h session.h done.h thread.h compress.h
mounts.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
mounts.o: postmultiparser.h ticket.h mountparser.h db.h
notify.o: log.h notify.h ../templatesnotify/templatesnotify.h ../core/mount.h
notify.o: ../core/locale.h ../confparser/confparser.h ../templates/misc.h
notify.o: ../templates/localefilter.h data.h dirs.h item.h dircontainer.h
notify.o: users.h user.h ugcontainer.h groups.h group.h functions.h
notify.o: function.h lastcontainer.h mounts.h mount.h error.h rebus.h
notify.o: locale.h loadavg.h misc.h request.h requesttypes.h session.h done.h
notify.o: thread.h compress.h acceptencodingparser.h acceptbaseparser.h
notify.o: htmlfilter.h postmultiparser.h ticket.h
notify.o: loadavg.h misc.h request.h requesttypes.h session.h done.h thread.h
notify.o: compress.h acceptencodingparser.h acceptbaseparser.h htmlfilter.h
notify.o: postmultiparser.h ticket.h
plugin.o: plugin.h request.h requesttypes.h session.h done.h item.h error.h
plugin.o: log.h user.h rebus.h function.h thread.h compress.h
plugin.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
plugin.o: postmultiparser.h ticket.h data.h dirs.h dircontainer.h users.h
plugin.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h mounts.h
plugin.o: mount.h locale.h ../confparser/confparser.h loadavg.h pluginmsg.h
plugin.o: mount.h loadavg.h pluginmsg.h
postmultiparser.o: postmultiparser.h error.h log.h requesttypes.h data.h
postmultiparser.o: dirs.h item.h dircontainer.h users.h user.h ugcontainer.h
postmultiparser.o: groups.h group.h functions.h function.h lastcontainer.h
postmultiparser.o: mounts.h mount.h rebus.h locale.h
postmultiparser.o: ../confparser/confparser.h loadavg.h
postmultiparser.o: mounts.h mount.h rebus.h loadavg.h
rebus.o: log.h rebus.h misc.h item.h
request.o: request.h requesttypes.h session.h done.h item.h error.h log.h
request.o: user.h rebus.h function.h thread.h compress.h
@ -84,43 +78,39 @@ request.o: acceptencodingparser.h acceptbaseparser.h htmlfilter.h
request.o: postmultiparser.h ticket.h getparser.h httpsimpleparser.h
request.o: postparser.h cookieparser.h data.h dirs.h dircontainer.h users.h
request.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h
request.o: mounts.h mount.h locale.h ../confparser/confparser.h loadavg.h
request.o: plugin.h pluginmsg.h misc.h db.h
request.o: mounts.h mount.h loadavg.h plugin.h pluginmsg.h misc.h db.h
requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h
requestcontroller.o: ../templates/templates.h ../templates/patterncacher.h
requestcontroller.o: misc.h item.h ../templates/ckeditorgetparser.h
requestcontroller.o: ../core/httpsimpleparser.h ../core/log.h
requestcontroller.o: ../core/locale.h ../confparser/confparser.h
requestcontroller.o: ../core/thread.h ../core/ticket.h ../core/done.h
requestcontroller.o: sessionmanager.h sessioncontainer.h session.h done.h
requestcontroller.o: error.h log.h user.h rebus.h functionparser.h
requestcontroller.o: requesttypes.h data.h dirs.h dircontainer.h users.h
requestcontroller.o: ugcontainer.h groups.h group.h functions.h function.h
requestcontroller.o: lastcontainer.h mounts.h mount.h locale.h
requestcontroller.o: ../confparser/confparser.h loadavg.h request.h thread.h
requestcontroller.o: compress.h acceptencodingparser.h acceptbaseparser.h
requestcontroller.o: htmlfilter.h postmultiparser.h ticket.h postparser.h
requestcontroller.o: httpsimpleparser.h cookieparser.h notify.h
requestcontroller.o: ../templatesnotify/templatesnotify.h ../core/mount.h
requestcontroller.o: ../core/locale.h ../templates/misc.h
requestcontroller.o: lastcontainer.h mounts.h mount.h loadavg.h request.h
requestcontroller.o: thread.h compress.h acceptencodingparser.h
requestcontroller.o: acceptbaseparser.h htmlfilter.h postmultiparser.h
requestcontroller.o: ticket.h postparser.h httpsimpleparser.h cookieparser.h
requestcontroller.o: notify.h ../templatesnotify/templatesnotify.h
requestcontroller.o: ../core/mount.h ../templates/misc.h
requestcontroller.o: ../templates/localefilter.h
session.o: session.h done.h item.h error.h log.h user.h rebus.h
sessioncontainer.o: sessioncontainer.h session.h done.h item.h error.h log.h
sessioncontainer.o: user.h rebus.h data.h dirs.h dircontainer.h users.h
sessioncontainer.o: ugcontainer.h groups.h group.h functions.h function.h
sessioncontainer.o: lastcontainer.h mounts.h mount.h locale.h
sessioncontainer.o: ../confparser/confparser.h loadavg.h
sessioncontainer.o: lastcontainer.h mounts.h mount.h loadavg.h
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h done.h item.h
sessionmanager.o: error.h log.h user.h rebus.h request.h requesttypes.h
sessionmanager.o: function.h thread.h compress.h acceptencodingparser.h
sessionmanager.o: acceptbaseparser.h htmlfilter.h postmultiparser.h ticket.h
sessionmanager.o: data.h dirs.h dircontainer.h users.h ugcontainer.h groups.h
sessionmanager.o: group.h functions.h lastcontainer.h mounts.h mount.h
sessionmanager.o: locale.h ../confparser/confparser.h loadavg.h
sessionmanager.o: sessionparser.h
sessionmanager.o: loadavg.h sessionparser.h
sessionparser.o: sessionparser.h session.h done.h item.h error.h log.h user.h
sessionparser.o: rebus.h sessioncontainer.h data.h dirs.h dircontainer.h
sessionparser.o: users.h ugcontainer.h groups.h group.h functions.h
sessionparser.o: function.h lastcontainer.h mounts.h mount.h locale.h
sessionparser.o: ../confparser/confparser.h loadavg.h
sessionparser.o: function.h lastcontainer.h mounts.h mount.h loadavg.h
users.o: users.h user.h ugcontainer.h log.h db.h item.h group.h thread.h
users.o: error.h dircontainer.h ticket.h

View File

@ -91,6 +91,7 @@ bool Config::ReadConfig(bool errors_to_stdout_)
void Config::AssignValues()
{
data.log_file = Text("log_file");
@ -151,36 +152,34 @@ void Config::AssignValues()
data.locale_dir = Text("locale_dir");
data.locale_dir_default = Text("locale_dir_default");
Locale::Lang lang = Locale::StrToLang(data.locale_str);
data.title_separator = Text("title_separator", " / ");
if( lang != Locale::lang_unknown )
data.locale.SetLang(lang);
}
const std::string & Config::Text(const char * name)
std::string Config::Text(const char * name)
{
return Text(std::string(name), default_str);
}
const std::string & Config::Text(const char * name, const char * def)
std::string Config::Text(const char * name, const char * def)
{
return Text(std::string(name), std::string(def));
}
const std::string & Config::Text(const std::string & name, const std::string & def)
std::string Config::Text(const std::string & name, const std::string & def)
{
ConfParser::Table::iterator i = conf_parser.table.find(name);
if( i == conf_parser.table.end() )
return def;
return i->second;
return i->second;
}

View File

@ -32,10 +32,9 @@ private:
void ShowError();
void AssignValues();
const std::string & Text(const char *);
const std::string & Text(const char * name, const char * def);
const std::string & Text(const std::string & name, const std::string & def);
std::string Text(const char * name);
std::string Text(const char * name, const char * def);
std::string Text(const std::string & name, const std::string & def);
int Int(const char *);
int Int(const char * name, int def);

View File

@ -22,7 +22,6 @@
#include "lastcontainer.h"
#include "mounts.h"
#include "rebus.h"
#include "locale.h"
#include "loadavg.h"
@ -143,8 +142,9 @@ public:
// base_url_static_auth_prefix + base_server
std::string base_url_static_auth;
// separator used in <title> html tag
std::string title_separator;
Locale locale;
// end config members

View File

@ -264,6 +264,29 @@ return out.str();
}
const char * DateToStr(int year, int month, int day)
{
static const char * month_letter[] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" };
static char buffer[100];
--month;
if( month < 0 )
month = 0;
if( month > 11 )
month = 11;
if( year == 0 )
sprintf(buffer, "%s %02d", month_letter[month], day);
else
sprintf(buffer, "%02d %s %02d", year, month_letter[month], day);
// warning: not thread safe (we do not use threads)
return buffer;
}
const char * DateToStr(int year, int month, int day, int hour, int min, int sec)
{
static const char * month_letter[] = { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII" };

View File

@ -37,6 +37,7 @@ void HtmlEscapeFormTxt(std::ostringstream & out, const std::string & in);
std::string HtmlEscape(const std::string & in);
std::string HtmlEscapeFormTxt(const std::string & in);
const char * DateToStr(int year, int month, int day);
const char * DateToStr(int year, int month, int day, int hour, int min, int sec);
const char * DateToStr(tm * ptm);
const char * DateToStr(time_t t);

View File

@ -2,7 +2,7 @@
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* Copyright (c) 2008-2010, Tomasz Sowa
* All rights reserved.
*
*/
@ -138,7 +138,10 @@ Notify::~Notify()
void Notify::ReadTemplates()
{
Lock();
// we are in the first thread here
// the second thread can use our templates and we must Lock()
// (the second thread is using Lock() too)
Lock();
templates_notify.Read();
Unlock();
}
@ -241,7 +244,11 @@ Users::Iterator i;
if( sending )
{
n.email = i->email;
n.lang = data.locale.GetLang(); // !! bedzie osobno dla kazdego uzytkownika
n.lang = Locale::StrToLang(data.locale_str);// !! bedzie osobno dla kazdego uzytkownika
if( n.lang == Locale::lang_unknown )
n.lang = Locale::lang_en;
notify_pool.insert(notify_pool.end(), n);
}
}

View File

@ -108,7 +108,6 @@ bool RequestController::Init()
data.groups.ReadGroups();
data.functions.ReadFunctions();
data.mounts.ReadMounts();
data.locale.Read(data.locale_dir, data.locale_dir_default); // call it before content.Init()
data.rebus.Init();
//

View File

@ -1,35 +1,25 @@
<div>
[is mount_page_is "subject"]
[is mount_page_is "info"]
<h1 class="withinfo">
[else]
<h1>
[end]
[item_subject]
</h1>
[end]
[is mount_page_is "info"]
[item_info]
[end]
[if-one item_static_auth_is_image]
<img src="[item_link_static_auth]" alt="[item_subject]">
[is mount_page_is "subject"]
[is mount_page_is "info"]<h1 class="withinfo">[else]<h1>[end][item_subject]</h1>[end]
[is mount_page_is "info"]
[item_info]
[end]
[if-one item_static_auth_is_image]
<img src="[item_link_static_auth]" alt="[item_subject]">
[item_print_content]
[else]
[if-one item_static_auth_is_other]
{download}: <a href="[item_link_static_auth]" title="[item_subject]">[item_subject]</a>
[item_print_content]
[else]
[if-one item_static_auth_is_other]
{download}: <a href="[item_link_static_auth]" title="[item_subject]">[item_subject]</a>
[if-one item_static_auth_is_none]
[item_print_content]
[else]
[if-one item_static_auth_is_none]
[item_print_content]
[end]
[end]
[end]
</div>
[end]

View File

@ -29,14 +29,14 @@
[if-one mount_type_is_thread]<p class="withnext">{form_emacs_content_thread}</p>[end]
[if-one mount_type_is_ticket]<p class="withnext">{form_emacs_content_ticket}</p>[end]
<textarea class="multitext" rows="[if-one mount_type_is_cms]30[else]10[end]" cols="60" name="content">[item_content]</textarea>
<textarea class="multitext" rows="[if-one mount_type_is_cms]30[else]10[end]" cols="60" name="itemcontent">[item_content]</textarea>
<input type="hidden" name="contenttype" value="2">
[is winix_function_param_is "full"]
<script type="text/javascript">CKEDITOR.replace('content', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_full.js' \});</script>
<script type="text/javascript">CKEDITOR.replace('itemcontent', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_full.js' \});</script>
[else]
<script type="text/javascript">CKEDITOR.replace('content', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_winix.js' \});</script>
<script type="text/javascript">CKEDITOR.replace('itemcontent', \{filebrowserUploadUrl: '[doc_base_url][dir]upload/', filebrowserBrowseUrl: '[doc_base_url][dir]ls/ckeditor_browse/fullscreen/', customConfig : '[doc_base_url_static_ext]/ckeditor_winix.js' \});</script>
[end]
[if-no user_logged]

View File

@ -7,7 +7,7 @@
[if-one mount_type_is_ticket]<p class="withnext">{form_emacs_content_ticket}</p>[end]
[end]
<textarea class="multitext" rows="[is winix_function_is "upload"]7[else][if-one mount_type_is_cms]30[else]10[end][end]" cols="60" name="content">[item_content]</textarea>
<textarea class="multitext" rows="[is winix_function_is "upload"]7[else][if-one mount_type_is_cms]30[else]10[end][end]" cols="60" name="itemcontent">[item_content]</textarea>
<p class="withnext">{form_emacs_content_type}</p>

View File

@ -15,7 +15,7 @@
<tr>
<td><a href="[doc_base_url][dir][thread_tab_url]">[thread_tab_subject]</a></td>
<td class="smallfont">[thread_tab_author]</td><td class="smallfont">[thread_tab_answers]</td>
<td class="smallfont">[thread_tab_last_item_date_modification] ([thread_tab_last_item_user])</td>
<td class="smallfont">[thread_tab_last_item_date_modification_nice] ([thread_tab_last_item_user])</td>
</tr>
[end]
</table>

View File

@ -1,84 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="{language}">
<head>
<title>[doc_title]</title>
<meta http-equiv="content-type" content="text/html; charset={charset}">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="stylesheet" href="[doc_base_url_static]/css/styles.css" type="text/css">
<link rel="shortcut icon" href="[doc_base_url_static]/favicon.ico">
[is winix_function_is "ckeditor"]<script type="text/javascript" src="[doc_base_url_static_ext]/ckeditor/ckeditor.js"></script>[end]
</head>
[is-no winix_function_param_is "fullscreen"]
<body>
<div id="container">
<div id="header">
[if-one user_logged]
<span id="zalogowany">{logged_as}: [user_name]
<a href="[doc_base_url][if-one dir_can_read_exec][dir][if-any item_is item_can_read][item_url]/[end][else]/[end]logout">{logout}</a></span>
[else]
<form id="loguj" method="post" action="[doc_base_url][if-one dir_can_read_exec][dir][if-any item_is item_can_read][item_url]/[end][else]/[end]login">
<fieldset>
<legend>{form_login_legend}:</legend>
<input class="edit" type="text" name="login">
<input class="edit" type="password" name="password">
<input class="submit" type="submit" value="{button_login}">
<p><label><input class="remember" type="checkbox" name="rememberme">{remember_me}</label></p>
</fieldset>
</form>
[end]
<a href="[doc_base_url]" id="logo">{home_page}</a>
[if-one dir_tab]
<ul id="current_dir">
[for dir_tab]
<li><a href="[dir_tab_link]">[dir_tab_url] /&nbsp;</a></li>
[end]
[if-one item_is]
<li><a href="[item_link]">[item_url]</a></li>
[end]
</ul>
[end]
</div> <!-- header -->
[is-no winix_function_is "ckeditor"]
<div id="contentleft">
</div> <!-- contentleft -->
<div id="contentright">
[content]
</div> <!-- contentright -->
[else]
<div id="contentfull">
[content]
</div> <!-- contentfull -->
[end] [# is-no winix_function_is "ckeditor"]
<div id="footer">
</div> <!-- footer -->
</div> <!-- container -->
</body>
[else]
<body class="white">
<div id="containerfull">
[content]
</div> <!-- containerfull -->
</body>
[end] [# is-no winix_function_param_is "fullscreen"]
</html>
[include "index_root.html"]

12
html/index_contentmenu.html Executable file
View File

@ -0,0 +1,12 @@
<div id="winix_contentleft">
<h2>Menu</h2>
<ul class="winix_menu">
<li><a href="[doc_base_url]/">menu 1</a></li>
<li><a href="[doc_base_url]/">menu 2</a></li>
<li><a href="[doc_base_url]/">menu 3</a></li>
</ul>
</div> <!-- winix_contentleft -->

4
html/index_footer.html Executable file
View File

@ -0,0 +1,4 @@
<div id="winix_footer">
</div> <!-- winix_footer -->

9
html/index_head.html Executable file
View File

@ -0,0 +1,9 @@
<head>
<title>[doc_title]</title>
<meta http-equiv="content-type" content="text/html; charset={charset}">
<meta name="description" content="">
<meta name="keywords" content="">
<link rel="stylesheet" href="[doc_base_url_static]/winix/winix.css" type="text/css">
<link rel="shortcut icon" href="[doc_base_url_static]/favicon.ico">
[is winix_function_is "ckeditor"]<script type="text/javascript" src="[doc_base_url_static_ext]/ckeditor/ckeditor.js"></script>[end]
</head>

32
html/index_header.html Executable file
View File

@ -0,0 +1,32 @@
<div id="winix_header">
[if-one user_logged]
<span id="winix_logged">{logged_as}: [user_name]<br>
<a href="[doc_base_url][if-one dir_can_read_exec][dir][if-any item_is item_can_read][item_url]/[end][else]/[end]logout">{logout}</a></span>
[else]
<form id="winix_login" method="post" action="[doc_base_url][if-one dir_can_read_exec][dir][if-any item_is item_can_read][item_url]/[end][else]/[end]login">
<fieldset>
<legend>{form_login_legend}:</legend>
<input class="edit" type="text" name="login">
<input class="edit" type="password" name="password">
<input class="submit" type="submit" value="{button_login}">
<p><label><input class="remember" type="checkbox" name="rememberme">{remember_me}</label></p>
</fieldset>
</form>
[end]
<a href="[doc_base_url]" id="winix_logo">{home_page}</a>
[if-one dir_tab]
<ul id="winix_current_dir">
[for dir_tab]
<li><a href="[dir_tab_link]">[dir_tab_url] /&nbsp;</a></li>
[end]
[if-one item_is]
<li><a href="[item_link]">[item_url]</a></li>
[end]
</ul>
[end]
</div> <!-- winix_header -->

44
html/index_root.html Executable file
View File

@ -0,0 +1,44 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="{language}">
[include "index_head.html"]
[is-no winix_function_param_is "fullscreen"]
<body>
<div id="winix_container">
[include "index_header.html"]
[is-no winix_function_is "ckeditor"]
[include "index_contentmenu.html"]
<div id="winix_contentright">
[content]
</div> <!-- winix_contentright -->
[else]
<div id="winix_contentfull">
[content]
</div> <!-- winix_contentfull -->
[end] [# is-no winix_function_is "ckeditor"]
[include "index_footer.html"]
</div> <!-- winix_container -->
</body>
[else]
<body>
<div id="winix_containerfull">
[content]
</div> <!-- winix_containerfull -->
</body>
[end] [# is-no winix_function_param_is "fullscreen"]
</html>

View File

@ -1 +1 @@
<p class="iteminfo">{added_by}: [item_user], [item_date_creation][if-no item_dates_equal], {last_modified}: [item_date_modification][end]</p>
<p class="iteminfo">{added_by}: [item_user], [item_date_creation_nice][if-no item_dates_equal], {last_modified}: [item_date_modification_nice][end]</p>

View File

@ -1 +1 @@
<p class="[if-index item_tab odd]itemtabinfo[else][is mount_thread_is "subject"]itemtabinfo[else]itemtabinfo2[end][end]">{added_by}: [item_tab_user], [item_tab_date_creation][if-no item_tab_dates_equal], {last_modified}: [item_tab_date_modification][end]</p>
<p class="[if-index item_tab odd]itemtabinfo[else][is mount_thread_is "subject"]itemtabinfo[else]itemtabinfo2[end][end]">{added_by}: [item_tab_user], [item_tab_date_creation_nice][if-no item_tab_dates_equal], {last_modified}: [item_tab_date_modification_nice][end]</p>

View File

@ -7,7 +7,7 @@ all: $(o)
.SUFFIXES: .cpp .o
.cpp.o:
$(CXX) -c $(CXXFLAGSMAIN) $<
$(CXX) -c $(CXXFLAGS) $<

View File

@ -12,11 +12,11 @@ main.o: ../core/rebus.h ../core/functionparser.h ../core/requesttypes.h
main.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
main.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
main.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
main.o: ../core/mounts.h ../core/mount.h ../core/locale.h ../core/loadavg.h
main.o: ../core/request.h ../core/thread.h ../core/compress.h
main.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
main.o: ../core/htmlfilter.h ../core/postmultiparser.h ../core/ticket.h
main.o: ../core/db.h ../core/config.h ../core/notify.h
main.o: ../core/mounts.h ../core/mount.h ../core/loadavg.h ../core/request.h
main.o: ../core/thread.h ../core/compress.h ../core/acceptencodingparser.h
main.o: ../core/acceptbaseparser.h ../core/htmlfilter.h
main.o: ../core/postmultiparser.h ../core/ticket.h ../core/db.h
main.o: ../core/config.h ../core/notify.h
main.o: ../templatesnotify/templatesnotify.h ../core/mount.h
main.o: ../templates/misc.h ../core/plugin.h ../core/request.h ../core/data.h
main.o: ../core/pluginmsg.h

View File

@ -1,79 +1,126 @@
* {
margin: 0;
border: 0;
padding: 0;
/* ---------------------- clearing -------------------------- */
html, body {
color: black;
background: white;
}
html, body, div, span,
applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dd, dl, dt, li, ol, ul,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
line-height: 1.4em;
font-family: inherit;
text-align: left;
vertical-align: baseline;
}
a img, :link img, :visited img {
border: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
ol, ul {
list-style: none;
}
q:before, q:after,
blockquote:before, blockquote:after {
content: "";
}
/* ---------------------- index template -------------------------- */
html, body {
background: #DEDEDE;
color: #626262;
font-size: 14px;
font-family: Verdana, Tahoma, Arial CE;
line-height: 1.3em;
font-family: Verdana, Tahoma, Arial CE, Sans-Serif;
}
body.white {
background: white;
height: 100%;
}
#container {
#winix_container {
width: 909px;
margin: 10px auto 33px auto;
background: white url('/images/a2.gif') repeat-y right top;
background: white url('/winix/a2.gif') repeat-y right top;
}
#containerfull {
#winix_containerfull {
background: white;
padding: 2em;
overflow: hidden;
}
#contentleft {
#winix_contentleft {
margin: 20px 30px 0 50px;
width: 150px;
float: left;
}
* html #contentleft {
* html #winix_contentleft {
margin-left: 25px;
}
#contentleft h2 {
#winix_contentleft h2 {
margin-top: 0;
}
#contentleft h2.next {
#winix_contentleft h2.next {
margin-top: 1.2em;
}
.menu {
.winix_menu {
list-style-type: none;
margin: 0;
}
.menu li {
.winix_menu li {
width: 150px;
padding: 0 10px 2px 0;
padding: 0 12px 2px 0;
line-height: 1.5;
}
.menu li a {
.winix_menu li a {
text-decoration: none;
color: #666666;
}
.menu li a:hover, .menu li a:focus {
.winix_menu li a:hover, .winix_menu li a:focus {
text-decoration: none;
background: black;
color: white;
}
#contentright {
#winix_contentright {
min-height: 400px;
width: 600px;
float: left;
@ -82,123 +129,127 @@ padding-right: 30px;
}
* html #contentright {
* html #winix_contentright {
height: 400px;
}
#contentfull {
#winix_contentfull {
min-height: 400px;
width: 840px;
margin: 20px 0 40px 0;
padding: 30px;
}
* html #contentfull {
* html #winix_contentfull {
height: 400px;
}
#header {
#winix_header {
height: 130px;
background: url('/images/a1.gif') no-repeat right top;
background: url('/winix/a1.gif') no-repeat right top;
overflow: hidden;
}
#header #logo {
display: block;
float: left;
width: 320px;
padding: 85px 0 0 0;
height: 0;
overflow: hidden;
background: url('/images/slimaczek.gif') no-repeat left top;
margin: 18px 0 0 28px;
}
* html #header #logo {
margin-left: 14px;
}
#header #logo:focus {
border-bottom: 2px solid black;
}
#loguj {
width: 280px;
#winix_login {
width: 240px;
float: right;
margin-top: 20px;
}
#loguj legend {
#winix_login legend {
width: 0;
height: 0;
overflow: hidden;
display: none;
}
#loguj .edit {
#winix_login .edit {
border: #848484 1px solid;
width: 100px;
font-size: 0.9em;
}
#loguj .submit {
background: white;
font-size: 0.9em;
}
#loguj p {
width: 80px;
font-size: 0.8em;
line-height: 1;
}
#winix_login .submit {
background: white;
font-size: 0.8em;
border: 0;
}
#winix_login p {
font-size: 0.7em;
margin: 0.6em 0 0.6em 0;
}
#loguj .remember {
#winix_login .remember {
margin: 0 0.5em 0 0;
vertical-align: middle;
}
#zalogowany {
#winix_logged {
width: 280px;
float: right;
margin-top: 20px;
font-size: 0.8em;
text-align: right;
padding-right: 2em;
padding-right: 30px;
}
#current_dir {
#winix_header #winix_logo {
display: block;
float: left;
list-style-type: none;
margin: 73px 0 0 0;
margin: 20px 0 5px 20px;
}
#current_dir li {
* html #winix_header #winix_logo {
margin-left: 10px;
}
#winix_current_dir {
list-style-type: none;
margin: 20px 0 0 10px;
overflow: hidden;
float: left;
}
#winix_current_dir li {
display: block;
float: left;
}
#current_dir a{
#winix_current_dir a {
text-decoration: none;
color: #666666;
font-size: 0.8em;
font-size: 1em;
}
#current_dir a:focus, #current_dir a:hover {
#winix_current_dir a:focus, #winix_current_dir a:hover {
color: white;
background: black;
}
#footer {
#winix_footer {
clear: both;
height: 40px;
background: url('/images/b.gif') no-repeat left bottom;
background: url('/winix/b.gif') no-repeat left bottom;
}
#menu2 {
#winix_menu_bottom {
font-size: 0.8em;
list-style-type: none;
margin: 0 auto 0 auto;
@ -207,52 +258,37 @@ text-align: center;
}
#menu2 li {
#winix_menu_bottom li {
display: inline;
margin-right: 15px;
padding-right: 15px;
border-right: 1px solid #626262;
}
#menu2 li.last {
#winix_menu_bottom li.last {
margin-right: 0;
padding-right: 0;
border-right: none;
}
#menu2 li a {
#winix_menu_bottom li a {
text-decoration: none;
color: #666666;
}
#menu2 li a:hover, #menu2 li a:focus {
#winix_menu_bottom li a:hover, #winix_menu_bottom li a:focus {
text-decoration: none;
color: white;
background: black;
}
p.iteminfo {
font-size: 0.7em;
color: #AAAAAA;
margin: 0.4em 0 1.8em 0;
}
p.itemtabinfo {
font-size: 0.7em;
color: #AAAAAA;
margin: 0 0 1em 0;
padding: 0.5em 0 0 0;
}
/* ---------------------- content -------------------------- */
p.itemtabinfo2 {
font-size: 0.7em;
color: #AAAAAA;
margin: 0 0 1em 0;
padding: 1.5em 0 0 0;
}
/* ---------------------------------------------------------- */
h1 {
font-size: 1.8em;
@ -261,6 +297,7 @@ color: #FF8700;
font-weight: normal;
}
h1.withinfo {
margin: 0 0 0 0;
}
@ -269,7 +306,8 @@ margin: 0 0 0 0;
h1.next {
margin-top: 1.2em;
}
h2 {
font-size: 1.2em;
margin: 1.2em 0 0.8em 0;
@ -277,6 +315,7 @@ color: #FF8700;
font-weight: normal;
}
h2.withinfo {
margin: 1.2em 0 0.2em 0;
}
@ -287,6 +326,7 @@ color: #065A8B;
text-decoration: none;
}
a:hover, a:focus {
background: #065A8B;
color: white;
@ -299,15 +339,41 @@ margin: 1em 0 1em 0;
line-height: 1.5em;
}
p.withnext {
margin: 1em 0 0 0;
}