added: TimeZone struct (core)
this class has information about a time zone (utf offset, daylight saving time)
and methods for converting between UTC and local time
structs User and Config has a TimeZone object
System::ToLocal() and System::ToUTC() uses it for converting
(depending whether a user is logged or not)
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@842 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
|
||||
acceptbaseparser.o: acceptbaseparser.h
|
||||
app.o: app.h config.h ../../pikotools/space/spaceparser.h
|
||||
app.o: ../../pikotools/space/space.h htmlfilter.h system.h job.h basethread.h
|
||||
app.o: synchro.h ../../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 ../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 session.h user.h plugindata.h rebus.h
|
||||
app.o: mount.h ../templates/locale.h ../notify/notify.h
|
||||
app.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
app.o: ../../pikotools/date/date.h ../../pikotools/space/space.h system.h
|
||||
app.o: job.h basethread.h synchro.h dirs.h item.h dircontainer.h ../db/db.h
|
||||
app.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
app.o: ../core/textstream.h misc.h requesttypes.h ../core/error.h
|
||||
app.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
app.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
app.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
||||
app.o: cur.h request.h error.h ../templates/htmltextstream.h session.h user.h
|
||||
app.o: plugindata.h rebus.h mount.h ../templates/locale.h ../notify/notify.h
|
||||
app.o: ../notify/notifypool.h ../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
|
||||
@@ -50,44 +50,45 @@ compress.o: compress.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
compress.o: request.h requesttypes.h item.h ../../pikotools/space/space.h
|
||||
compress.o: ../../pikotools/date/date.h error.h config.h
|
||||
compress.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
compress.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
compress.o: misc.h session.h user.h plugindata.h rebus.h mount.h
|
||||
compress.o: ../templates/locale.h
|
||||
compress.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
compress.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
compress.o: mount.h ../templates/locale.h
|
||||
config.o: config.h ../../pikotools/space/spaceparser.h
|
||||
config.o: ../../pikotools/space/space.h htmlfilter.h log.h textstream.h
|
||||
config.o: logmanipulators.h slog.h cur.h request.h requesttypes.h item.h
|
||||
config.o: ../../pikotools/space/space.h ../../pikotools/date/date.h error.h
|
||||
config.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
config.o: user.h plugindata.h rebus.h mount.h ../templates/locale.h plugin.h
|
||||
config.o: pluginmsg.h system.h job.h basethread.h synchro.h dirs.h
|
||||
config.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
config.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
config.o: ../core/item.h ../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: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
config.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
||||
config.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h
|
||||
config.o: mountparser.h crypt.h run.h users.h groups.h group.h loadavg.h
|
||||
config.o: image.h threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
config.o: ../functions/functions.h ../functions/functionbase.h
|
||||
config.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
config.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
config.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
||||
config.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
||||
config.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
||||
config.o: ../functions/env.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: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
config.o: ../../pikotools/date/date.h ../../pikotools/space/space.h log.h
|
||||
config.o: textstream.h logmanipulators.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 session.h user.h plugindata.h rebus.h
|
||||
config.o: mount.h ../templates/locale.h plugin.h pluginmsg.h system.h job.h
|
||||
config.o: basethread.h synchro.h dirs.h dircontainer.h ../db/db.h
|
||||
config.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
config.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
config.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
config.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
config.o: ../templates/patterns.h ../templates/locale.h
|
||||
config.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
config.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
config.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
config.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.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: sessionmanager.h sessioncontainer.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/last.h ../functions/login.h ../functions/logout.h
|
||||
config.o: ../functions/ln.h ../functions/ls.h ../functions/man.h
|
||||
config.o: ../functions/meta.h ../functions/mkdir.h ../functions/mv.h
|
||||
config.o: ../functions/nicedit.h ../functions/node.h ../functions/passwd.h
|
||||
config.o: ../functions/priv.h ../functions/pw.h ../functions/reload.h
|
||||
config.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h
|
||||
config.o: ../functions/specialdefault.h ../functions/stat.h
|
||||
config.o: ../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
|
||||
@@ -95,17 +96,17 @@ 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 htmlfilter.h user.h
|
||||
crypt.o: ../../pikotools/utf8/utf8.h misc.h item.h
|
||||
crypt.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
crypt.o: requesttypes.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
crypt.o: request.h error.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
crypt.o: session.h plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
crypt.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
crypt.o: ../../pikotools/date/date.h ../../pikotools/space/space.h user.h
|
||||
crypt.o: ../../pikotools/utf8/utf8.h misc.h item.h requesttypes.h log.h
|
||||
crypt.o: textstream.h logmanipulators.h slog.h cur.h request.h error.h
|
||||
crypt.o: ../templates/htmltextstream.h ../core/textstream.h session.h
|
||||
crypt.o: plugindata.h rebus.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 slog.h cur.h request.h requesttypes.h
|
||||
dircontainer.o: error.h config.h ../../pikotools/space/spaceparser.h
|
||||
dircontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
dircontainer.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
dircontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
dircontainer.o: session.h user.h plugindata.h rebus.h mount.h
|
||||
dircontainer.o: ../templates/locale.h
|
||||
@@ -114,7 +115,7 @@ 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 ../core/error.h ../../pikotools/space/spaceparser.h
|
||||
dirs.o: ../../pikotools/space/space.h ../db/dbitemquery.h ../core/item.h
|
||||
dirs.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
dirs.o: ../db/dbitemcolumns.h ../core/user.h timezone.h ../core/group.h
|
||||
dirs.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
||||
dirs.o: logmanipulators.h slog.h cur.h request.h error.h config.h
|
||||
dirs.o: htmlfilter.h ../templates/htmltextstream.h session.h user.h
|
||||
@@ -132,7 +133,7 @@ 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 ../core/error.h ../../pikotools/space/spaceparser.h
|
||||
groups.o: ../../pikotools/space/space.h ../db/dbitemquery.h ../core/item.h
|
||||
groups.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
groups.o: ../db/dbitemcolumns.h ../core/user.h timezone.h ../core/group.h
|
||||
groups.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
||||
groups.o: logmanipulators.h slog.h cur.h request.h error.h config.h
|
||||
groups.o: htmlfilter.h ../templates/htmltextstream.h session.h user.h
|
||||
@@ -145,7 +146,7 @@ image.o: ../core/textstream.h misc.h item.h ../../pikotools/space/space.h
|
||||
image.o: ../../pikotools/date/date.h requesttypes.h ../core/error.h
|
||||
image.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.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/user.h timezone.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: session.h user.h plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
@@ -183,12 +184,12 @@ image.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
||||
item.o: item.h ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
item.o: misc.h requesttypes.h crypt.h run.h config.h
|
||||
item.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
item.o: htmlfilter.h user.h
|
||||
item.o: htmlfilter.h timezone.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 slog.h cur.h
|
||||
job.o: request.h requesttypes.h item.h ../../pikotools/date/date.h error.h
|
||||
job.o: config.h ../../pikotools/space/spaceparser.h
|
||||
job.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
job.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
job.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
job.o: user.h plugindata.h rebus.h mount.h ../templates/locale.h system.h
|
||||
job.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
@@ -229,7 +230,7 @@ lastcontainer.o: lastcontainer.h ../../pikotools/date/date.h log.h
|
||||
lastcontainer.o: textstream.h logmanipulators.h slog.h cur.h request.h
|
||||
lastcontainer.o: requesttypes.h item.h ../../pikotools/space/space.h error.h
|
||||
lastcontainer.o: config.h ../../pikotools/space/spaceparser.h
|
||||
lastcontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
lastcontainer.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
lastcontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
lastcontainer.o: session.h user.h plugindata.h rebus.h mount.h
|
||||
lastcontainer.o: ../templates/locale.h
|
||||
@@ -237,23 +238,23 @@ loadavg.o: loadavg.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
loadavg.o: request.h requesttypes.h item.h ../../pikotools/space/space.h
|
||||
loadavg.o: ../../pikotools/date/date.h error.h config.h
|
||||
loadavg.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
loadavg.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
loadavg.o: misc.h session.h user.h plugindata.h rebus.h mount.h
|
||||
loadavg.o: ../templates/locale.h
|
||||
loadavg.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
loadavg.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
loadavg.o: mount.h ../templates/locale.h
|
||||
log.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
||||
log.o: requesttypes.h item.h ../../pikotools/space/space.h
|
||||
log.o: ../../pikotools/date/date.h error.h config.h
|
||||
log.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
log.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
log.o: session.h user.h plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
log.o: ../../pikotools/utf8/utf8.h
|
||||
log.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
log.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
log.o: mount.h ../templates/locale.h ../../pikotools/utf8/utf8.h
|
||||
misc.o: misc.h item.h ../../pikotools/space/space.h
|
||||
misc.o: ../../pikotools/date/date.h requesttypes.h log.h textstream.h
|
||||
misc.o: logmanipulators.h slog.h cur.h request.h error.h config.h
|
||||
misc.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
misc.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
misc.o: session.h user.h plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
misc.o: ../templates/templates.h ../../ezc/src/ezc.h
|
||||
misc.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
misc.o: ../core/textstream.h session.h user.h plugindata.h rebus.h mount.h
|
||||
misc.o: ../templates/locale.h ../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 ../../pikotools/utf8/utf8.h
|
||||
@@ -274,7 +275,7 @@ mountparser.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
mountparser.o: ../core/textstream.h misc.h requesttypes.h ../core/error.h
|
||||
mountparser.o: ../../pikotools/space/spaceparser.h
|
||||
mountparser.o: ../../pikotools/space/space.h ../db/dbitemquery.h
|
||||
mountparser.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
|
||||
mountparser.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h timezone.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
|
||||
@@ -294,7 +295,7 @@ 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: ../core/error.h ../../pikotools/space/spaceparser.h
|
||||
mounts.o: ../../pikotools/space/space.h ../db/dbitemquery.h ../core/item.h
|
||||
mounts.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
mounts.o: ../db/dbitemcolumns.h ../core/user.h timezone.h ../core/group.h
|
||||
mounts.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
||||
mounts.o: logmanipulators.h slog.h cur.h request.h config.h htmlfilter.h
|
||||
mounts.o: ../templates/htmltextstream.h session.h user.h plugindata.h rebus.h
|
||||
@@ -334,10 +335,10 @@ plugin.o: plugin.h pluginmsg.h log.h textstream.h logmanipulators.h slog.h
|
||||
plugin.o: cur.h request.h requesttypes.h item.h ../../pikotools/space/space.h
|
||||
plugin.o: ../../pikotools/date/date.h error.h config.h
|
||||
plugin.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
plugin.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
plugin.o: misc.h session.h user.h plugindata.h rebus.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: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
plugin.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
plugin.o: mount.h ../templates/locale.h system.h job.h basethread.h synchro.h
|
||||
plugin.o: dirs.h 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
|
||||
@@ -375,7 +376,7 @@ plugindata.o: plugindata.h plugin.h pluginmsg.h log.h textstream.h
|
||||
plugindata.o: logmanipulators.h slog.h cur.h request.h requesttypes.h item.h
|
||||
plugindata.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
plugindata.o: error.h config.h ../../pikotools/space/spaceparser.h
|
||||
plugindata.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
plugindata.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
plugindata.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
plugindata.o: session.h user.h rebus.h mount.h ../templates/locale.h system.h
|
||||
plugindata.o: job.h basethread.h synchro.h dirs.h dircontainer.h ../db/db.h
|
||||
@@ -418,23 +419,23 @@ plugindata.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
||||
plugindata.o: ../core/sessionmanager.h
|
||||
postmultiparser.o: postmultiparser.h error.h requesttypes.h config.h
|
||||
postmultiparser.o: ../../pikotools/space/spaceparser.h
|
||||
postmultiparser.o: ../../pikotools/space/space.h htmlfilter.h misc.h item.h
|
||||
postmultiparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
postmultiparser.o: log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
postmultiparser.o: request.h ../templates/htmltextstream.h
|
||||
postmultiparser.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
postmultiparser.o: ../../pikotools/date/date.h ../../pikotools/space/space.h
|
||||
postmultiparser.o: misc.h item.h log.h textstream.h logmanipulators.h slog.h
|
||||
postmultiparser.o: cur.h request.h ../templates/htmltextstream.h
|
||||
postmultiparser.o: ../core/textstream.h session.h user.h plugindata.h rebus.h
|
||||
postmultiparser.o: mount.h ../templates/locale.h ../../pikotools/utf8/utf8.h
|
||||
rebus.o: log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
||||
rebus.o: requesttypes.h item.h ../../pikotools/space/space.h
|
||||
rebus.o: ../../pikotools/date/date.h error.h config.h
|
||||
rebus.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
rebus.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h
|
||||
rebus.o: misc.h session.h user.h plugindata.h rebus.h mount.h
|
||||
rebus.o: ../templates/locale.h
|
||||
rebus.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
rebus.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
rebus.o: mount.h ../templates/locale.h
|
||||
request.o: request.h requesttypes.h item.h ../../pikotools/space/space.h
|
||||
request.o: ../../pikotools/date/date.h error.h config.h
|
||||
request.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
request.o: htmlfilter.h textstream.h ../templates/htmltextstream.h
|
||||
request.o: htmlfilter.h timezone.h textstream.h ../templates/htmltextstream.h
|
||||
request.o: ../core/textstream.h misc.h log.h logmanipulators.h slog.h cur.h
|
||||
request.o: session.h user.h plugindata.h rebus.h mount.h
|
||||
request.o: ../templates/locale.h plugin.h pluginmsg.h system.h job.h
|
||||
@@ -477,8 +478,9 @@ run.o: run.h log.h textstream.h logmanipulators.h slog.h cur.h request.h
|
||||
run.o: requesttypes.h item.h ../../pikotools/space/space.h
|
||||
run.o: ../../pikotools/date/date.h error.h config.h
|
||||
run.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.h
|
||||
run.o: htmlfilter.h ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
run.o: session.h user.h plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
run.o: htmlfilter.h timezone.h ../templates/htmltextstream.h
|
||||
run.o: ../core/textstream.h misc.h session.h user.h plugindata.h rebus.h
|
||||
run.o: mount.h ../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 misc.h requesttypes.h
|
||||
@@ -487,7 +489,7 @@ sessioncontainer.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
sessioncontainer.o: error.h user.h plugindata.h rebus.h textstream.h cur.h
|
||||
sessioncontainer.o: request.h requesttypes.h config.h
|
||||
sessioncontainer.o: ../../pikotools/space/spaceparser.h
|
||||
sessioncontainer.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
sessioncontainer.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
sessioncontainer.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessioncontainer.o: mount.h log.h logmanipulators.h slog.h
|
||||
sessioncontainer.o: ../templates/locale.h
|
||||
@@ -496,7 +498,7 @@ sessionmanager.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
sessionmanager.o: error.h user.h plugindata.h rebus.h textstream.h cur.h
|
||||
sessionmanager.o: request.h requesttypes.h config.h
|
||||
sessionmanager.o: ../../pikotools/space/spaceparser.h
|
||||
sessionmanager.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
sessionmanager.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
sessionmanager.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessionmanager.o: mount.h lastcontainer.h system.h job.h basethread.h
|
||||
sessionmanager.o: synchro.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
|
||||
@@ -545,14 +547,14 @@ sessionparser.o: ../../pikotools/space/space.h ../../pikotools/date/date.h
|
||||
sessionparser.o: error.h user.h plugindata.h rebus.h textstream.h
|
||||
sessionparser.o: sessioncontainer.h cur.h request.h requesttypes.h config.h
|
||||
sessionparser.o: ../../pikotools/space/spaceparser.h
|
||||
sessionparser.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
sessionparser.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
sessionparser.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessionparser.o: mount.h users.h log.h logmanipulators.h slog.h
|
||||
sessionparser.o: ../templates/locale.h
|
||||
slog.o: slog.h cur.h request.h requesttypes.h item.h
|
||||
slog.o: ../../pikotools/space/space.h ../../pikotools/date/date.h error.h
|
||||
slog.o: config.h ../../pikotools/space/spaceparser.h
|
||||
slog.o: ../../pikotools/space/space.h htmlfilter.h textstream.h
|
||||
slog.o: ../../pikotools/space/space.h htmlfilter.h timezone.h textstream.h
|
||||
slog.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
slog.o: user.h plugindata.h rebus.h mount.h logmanipulators.h
|
||||
slog.o: ../templates/locale.h
|
||||
@@ -563,7 +565,7 @@ system.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
system.o: ../core/textstream.h misc.h requesttypes.h ../core/error.h
|
||||
system.o: ../../pikotools/space/spaceparser.h ../../pikotools/space/space.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/user.h timezone.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 session.h user.h plugindata.h rebus.h
|
||||
@@ -604,15 +606,18 @@ threadmanager.o: logmanipulators.h slog.h cur.h request.h requesttypes.h
|
||||
threadmanager.o: item.h ../../pikotools/space/space.h
|
||||
threadmanager.o: ../../pikotools/date/date.h error.h config.h
|
||||
threadmanager.o: ../../pikotools/space/spaceparser.h
|
||||
threadmanager.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
threadmanager.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
threadmanager.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
threadmanager.o: session.h user.h plugindata.h rebus.h mount.h
|
||||
threadmanager.o: ../templates/locale.h
|
||||
timezone.o: timezone.h ../../pikotools/date/date.h
|
||||
timezone.o: ../../pikotools/space/space.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 cur.h request.h
|
||||
users.o: requesttypes.h config.h ../../pikotools/space/spaceparser.h
|
||||
users.o: ../../pikotools/space/space.h htmlfilter.h
|
||||
users.o: ../../pikotools/space/space.h htmlfilter.h timezone.h
|
||||
users.o: ../templates/htmltextstream.h ../core/textstream.h misc.h mount.h
|
||||
users.o: lastcontainer.h system.h job.h basethread.h synchro.h dirs.h
|
||||
users.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
|
||||
@@ -1 +1 @@
|
||||
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 item.o job.o lastcontainer.o loadavg.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 users.o
|
||||
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 item.o job.o lastcontainer.o loadavg.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 user.o users.o
|
||||
|
||||
@@ -210,9 +210,6 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||
NoLastSlash(plugins_dir);
|
||||
ListText(L"plugins", plugin_file);
|
||||
|
||||
time_zone_offset = Int(L"time_zone_offset", 0);
|
||||
time_zone_offset_guest = Int(L"time_zone_offset_guest", 0);
|
||||
|
||||
utf8 = Bool(L"utf8", true);
|
||||
symlinks_follow_max = Size(L"symlinks_follow_max", 20);
|
||||
|
||||
@@ -238,6 +235,9 @@ void Config::AssignValues(bool stdout_is_closed)
|
||||
|
||||
account_need_email_verification = Bool(L"account_need_email_verification", true);
|
||||
reset_password_code_expiration_time = Long(L"reset_password_code_expiration_time", 86400);
|
||||
|
||||
time_zone.SetTz(space);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <string>
|
||||
#include "space/spaceparser.h"
|
||||
#include "htmlfilter.h"
|
||||
#include "timezone.h"
|
||||
|
||||
|
||||
|
||||
@@ -374,15 +375,6 @@ public:
|
||||
// (if true the html code for root is not filtered)
|
||||
bool editors_html_safe_mode_skip_root;
|
||||
|
||||
// temporarily we do not support time zones per user
|
||||
// there is one offset for all users
|
||||
// default: 0
|
||||
int time_zone_offset;
|
||||
|
||||
// time zone offset for guests (not logged users)
|
||||
// default: 0
|
||||
int time_zone_offset_guest;
|
||||
|
||||
// charset used in templates, locales, logs etc.
|
||||
// default: true (UTF-8)
|
||||
// if false it means 8-bit ASCII
|
||||
@@ -478,6 +470,18 @@ public:
|
||||
// default: 86400 (24 hours)
|
||||
long reset_password_code_expiration_time;
|
||||
|
||||
// time zone for guests
|
||||
// or for users who don't have time zone set
|
||||
// following options are read:
|
||||
// "tz_offset" (long)
|
||||
// "tz_has_dst" (bool)
|
||||
// if tz_has_dst is true then also:
|
||||
// "tz_dst_start" date in the following format: MM:DD HH[:MM[:SS]]
|
||||
// "tz_dst_end" the same as above
|
||||
// "tz_dst_offset" (long)
|
||||
TimeZone time_zone;
|
||||
|
||||
|
||||
|
||||
Config();
|
||||
bool ReadConfig(bool errors_to_stdout_, bool stdout_is_closed = true);
|
||||
|
||||
@@ -75,7 +75,6 @@ void Session::Clear(bool clear_plugin_data)
|
||||
last_time_get = 0;
|
||||
start_date.Clear();
|
||||
last_date.Clear();
|
||||
tz_add = 0;
|
||||
|
||||
log_buffer.Clear();
|
||||
last_css.clear();
|
||||
|
||||
@@ -53,14 +53,6 @@ struct Session
|
||||
// (used to calculate spam)
|
||||
time_t last_time_get;
|
||||
|
||||
// how many seconds should be added/substructed from the universal time
|
||||
// to create the local time for this session/user
|
||||
// it has combined time zone offset and daylight saving time
|
||||
// so when reading a value from a user (e.g. in html form) you should
|
||||
// substract tz_add and when printing you should add it
|
||||
time_t tz_add;
|
||||
|
||||
|
||||
|
||||
// 0 - means that nobody is logged
|
||||
User * puser;
|
||||
|
||||
@@ -71,7 +71,6 @@ void System::Init()
|
||||
users.SetCur(cur);
|
||||
users.SetSessionManager(session_manager);
|
||||
users.ReadUsers(db);
|
||||
users.SetTimeZoneOffset(config->time_zone_offset);
|
||||
groups.ReadGroups(db); // !! chwilowe przekazanie argumentu, db bedzie zmienione
|
||||
|
||||
rebus.SetCur(cur);
|
||||
@@ -870,29 +869,60 @@ return status;
|
||||
}
|
||||
|
||||
|
||||
// !! IMPROVE ME will be removed or changed
|
||||
time_t System::LocalTime(time_t gmt_time)
|
||||
|
||||
time_t System::ToLocal(time_t gmt_time)
|
||||
{
|
||||
int time_offset;
|
||||
time_t local_time;
|
||||
|
||||
if( cur->session && cur->session->puser )
|
||||
time_offset = cur->session->puser->time_zone_offset;
|
||||
local_time = cur->session->puser->time_zone.ToLocal(gmt_time);
|
||||
else
|
||||
time_offset = config->time_zone_offset_guest;
|
||||
local_time = config->time_zone.ToLocal(gmt_time);
|
||||
|
||||
return gmt_time + (time_t)time_offset;
|
||||
return local_time;
|
||||
}
|
||||
|
||||
|
||||
// !! IMPROVE ME will be removed or changed
|
||||
PT::Date System::LocalTime(const PT::Date & date)
|
||||
|
||||
PT::Date System::ToLocal(const PT::Date & gmt_date)
|
||||
{
|
||||
time_t t;
|
||||
PT::Date local_date;
|
||||
|
||||
t = date.ToTime();
|
||||
t = LocalTime(t);
|
||||
if( cur->session && cur->session->puser )
|
||||
local_date = cur->session->puser->time_zone.ToLocal(gmt_date);
|
||||
else
|
||||
local_date = config->time_zone.ToLocal(gmt_date);
|
||||
|
||||
return PT::Date(t);
|
||||
return local_date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
time_t System::ToUTC(time_t local_time)
|
||||
{
|
||||
time_t utc_time;
|
||||
|
||||
if( cur->session && cur->session->puser )
|
||||
utc_time = cur->session->puser->time_zone.ToUTC(local_time);
|
||||
else
|
||||
utc_time = config->time_zone.ToUTC(local_time);
|
||||
|
||||
return utc_time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PT::Date System::ToUTC(const PT::Date & local_date)
|
||||
{
|
||||
PT::Date utc_date;
|
||||
|
||||
if( cur->session && cur->session->puser )
|
||||
utc_date = cur->session->puser->time_zone.ToUTC(local_date);
|
||||
else
|
||||
utc_date = config->time_zone.ToUTC(local_date);
|
||||
|
||||
return utc_date;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -134,10 +134,13 @@ public:
|
||||
Error AddFile(Item & item, int notify_code = 0, bool call_plugins = true);
|
||||
Error EditFile(Item & item, bool with_url = true, int notify_code = 0, bool call_plugins = true);
|
||||
|
||||
// converting GMT time to local time (different for each user)
|
||||
// !! IMPROVE ME will be removed or changed
|
||||
time_t LocalTime(time_t gmt_time);
|
||||
PT::Date LocalTime(const PT::Date & date);
|
||||
|
||||
time_t ToLocal(time_t gmt_time);
|
||||
PT::Date ToLocal(const PT::Date & gmt_date);
|
||||
|
||||
time_t ToUTC(time_t local_time);
|
||||
PT::Date ToUTC(const PT::Date & local_date);
|
||||
|
||||
|
||||
int FollowLink(const std::vector<Item*> & current_dir_tab, const std::wstring & link_to,
|
||||
std::vector<Item*> & out_dir_tab, Item & out_item);
|
||||
|
||||
163
core/timezone.cpp
Normal file
163
core/timezone.cpp
Normal file
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "timezone.h"
|
||||
|
||||
|
||||
|
||||
|
||||
TimeZone::TimeZone()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TimeZone::Clear()
|
||||
{
|
||||
tz_offset = 0;
|
||||
tz_has_dst = false;
|
||||
tz_dst_offset = 0;
|
||||
tz_dst_start.Clear();
|
||||
tz_dst_end.Clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
time_t TimeZone::CalcLocalOffset(const PT::Date & utc_date)
|
||||
{
|
||||
time_t offset;
|
||||
|
||||
offset = tz_offset;
|
||||
|
||||
// !! CHECK ME need to be tested
|
||||
|
||||
if( tz_has_dst )
|
||||
{
|
||||
PT::Date local(utc_date);
|
||||
|
||||
local += tz_offset;
|
||||
local.year = tz_dst_start.year;
|
||||
tz_dst_end.year = tz_dst_start.year;
|
||||
|
||||
if( tz_dst_start <= local && local < tz_dst_end )
|
||||
offset += tz_dst_offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
time_t TimeZone::ToLocal(time_t utc_time)
|
||||
{
|
||||
time_t offset = CalcLocalOffset(PT::Date(utc_time));
|
||||
|
||||
return utc_time + offset;
|
||||
}
|
||||
|
||||
|
||||
PT::Date TimeZone::ToLocal(const PT::Date & utc_date)
|
||||
{
|
||||
PT::Date local(utc_date);
|
||||
local += CalcLocalOffset(utc_date);
|
||||
|
||||
return local;
|
||||
}
|
||||
|
||||
|
||||
time_t TimeZone::CalcUTCOffset(const PT::Date & local_date)
|
||||
{
|
||||
time_t offset;
|
||||
|
||||
offset = tz_offset;
|
||||
|
||||
if( tz_has_dst )
|
||||
{
|
||||
// !! CHECK ME need to be tested
|
||||
|
||||
PT::Date local(local_date);
|
||||
local -= tz_dst_offset;
|
||||
local.year = tz_dst_start.year;
|
||||
tz_dst_end.year = tz_dst_start.year;
|
||||
|
||||
if( tz_dst_start <= local && local < tz_dst_end )
|
||||
offset += tz_dst_offset;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
time_t TimeZone::ToUTC(time_t local_time)
|
||||
{
|
||||
time_t offset = CalcUTCOffset(PT::Date(local_time));
|
||||
|
||||
return local_time - offset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PT::Date TimeZone::ToUTC(const PT::Date & local_date)
|
||||
{
|
||||
time_t offset;
|
||||
PT::Date utc(local_date);
|
||||
|
||||
offset = CalcUTCOffset(local_date);
|
||||
utc -= offset;
|
||||
|
||||
return utc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool TimeZone::SetTz(PT::Space & space)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
tz_offset = space.Long(L"tz_offset", 0);
|
||||
tz_has_dst = space.Bool(L"tz_has_dst", false);
|
||||
|
||||
time_t h13 = 60 * 60 * 13; // 13 hours
|
||||
time_t h15 = 60 * 60 * 15; // 15 hours
|
||||
time_t h24 = 60 * 60 * 24; // 24 hours
|
||||
|
||||
if( tz_offset < -h13 || tz_offset > h15 )
|
||||
result = false;
|
||||
|
||||
if( tz_has_dst )
|
||||
{
|
||||
tz_dst_start.year = 1970;
|
||||
tz_dst_end.year = 1970;
|
||||
|
||||
if( !tz_dst_start.ParseMonthDayTime(space.Text(L"tz_dst_start")) )
|
||||
result = false;
|
||||
|
||||
if( !tz_dst_end.ParseMonthDayTime(space.Text(L"tz_dst_end")) )
|
||||
result = false;
|
||||
|
||||
tz_dst_offset = space.Long(L"tz_dst_offset");
|
||||
|
||||
if( tz_dst_offset < -h24 || tz_dst_offset > h24 )
|
||||
result = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
tz_dst_start.Clear();
|
||||
tz_dst_end.Clear();
|
||||
tz_dst_offset = 0;
|
||||
}
|
||||
|
||||
if( !result )
|
||||
Clear();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
93
core/timezone.h
Normal file
93
core/timezone.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_core_timezone
|
||||
#define headerfile_winix_core_timezone
|
||||
|
||||
#include <ctime>
|
||||
#include "date/date.h"
|
||||
#include "space/space.h"
|
||||
|
||||
|
||||
|
||||
class TimeZone
|
||||
{
|
||||
public:
|
||||
|
||||
TimeZone();
|
||||
|
||||
|
||||
/*
|
||||
setting:
|
||||
tz_offset = 0
|
||||
tz_has_dst = false
|
||||
*/
|
||||
void Clear();
|
||||
|
||||
|
||||
/*
|
||||
reading zime zone values from Space struct
|
||||
the struct should have:
|
||||
"tz_offset" (long)
|
||||
"tz_has_dst" (bool)
|
||||
if tz_has_dst is true then also:
|
||||
"tz_dst_start" date in the following format: MM:DD HH[:MM[:SS]]
|
||||
"tz_dst_end" the same as above
|
||||
"tz_dst_offset" (long)
|
||||
*/
|
||||
bool SetTz(PT::Space & space);
|
||||
|
||||
|
||||
/*
|
||||
converting from UTC to local time
|
||||
*/
|
||||
time_t CalcLocalOffset(const PT::Date & utc_date);
|
||||
time_t ToLocal(time_t utc_time);
|
||||
PT::Date ToLocal(const PT::Date & utc_date);
|
||||
|
||||
|
||||
/*
|
||||
converting from local time to UTC
|
||||
*/
|
||||
time_t CalcUTCOffset(const PT::Date & local_date);
|
||||
time_t ToUTC(time_t local_time);
|
||||
PT::Date ToUTC(const PT::Date & local_date);
|
||||
|
||||
|
||||
|
||||
|
||||
// time zone offset (in seconds)
|
||||
time_t tz_offset;
|
||||
|
||||
// true if the time zone has daylight saving time
|
||||
bool tz_has_dst;
|
||||
|
||||
// time zone daylight saving time (used if tz_has_dst is true)
|
||||
// the 'year' field is ignored (is always 1970)
|
||||
// these values (hours) are represented in local time (UTC + tz_offset)
|
||||
PT::Date tz_dst_start, tz_dst_end;
|
||||
|
||||
// time zone daylight saving time offset
|
||||
// used when tz_has_dst is true and the current date is whithin tz_dst_start and tz_dst_end
|
||||
time_t tz_dst_offset;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
63
core/user.cpp
Executable file
63
core/user.cpp
Executable file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
68
core/user.h
68
core/user.h
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "timezone.h"
|
||||
#include "space/space.h"
|
||||
#include "date/date.h"
|
||||
|
||||
@@ -75,10 +76,6 @@ struct User
|
||||
int notify;
|
||||
|
||||
|
||||
// !! currently all users have the same offset
|
||||
// option in config: time_zone_offset
|
||||
int time_zone_offset;
|
||||
|
||||
// environment variables which can be set by this user
|
||||
// use 'env' winix function
|
||||
PT::Space env;
|
||||
@@ -92,69 +89,18 @@ struct User
|
||||
// a user can normally login only when status is WINIX_ACCOUNT_READY
|
||||
int status;
|
||||
|
||||
|
||||
|
||||
// time zone
|
||||
// values here are the same as those in env space
|
||||
// we provide they here to speed up the process of calculating times
|
||||
|
||||
// time zone offset
|
||||
time_t tz_offset;
|
||||
|
||||
// true if the time zone has daylight saving time
|
||||
bool tz_has_dst;
|
||||
|
||||
// time zone daylight saving time (used if tz_has_dst is true)
|
||||
// the 'year' field is ignored
|
||||
PT::Date tz_dst_start, tz_dst_end;
|
||||
TimeZone time_zone;
|
||||
|
||||
|
||||
|
||||
User()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
User();
|
||||
|
||||
|
||||
void Clear()
|
||||
{
|
||||
id = -1;
|
||||
name.clear();
|
||||
super_user = false;
|
||||
groups.clear();
|
||||
email.clear();
|
||||
notify = 0;
|
||||
time_zone_offset = 0;
|
||||
env.Clear();
|
||||
aenv.Clear();
|
||||
status = WINIX_ACCOUNT_BLOCKED;
|
||||
tz_offset = 0;
|
||||
tz_has_dst = false;
|
||||
tz_dst_start.Clear();
|
||||
tz_dst_end.Clear();
|
||||
}
|
||||
|
||||
|
||||
bool IsMemberOf(long group)
|
||||
{
|
||||
std::vector<long>::iterator i;
|
||||
|
||||
for(i=groups.begin() ; i!=groups.end() ; ++i)
|
||||
if( *i == group )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// lepsza nazwe dac
|
||||
void SetTz()
|
||||
{
|
||||
tz_offset = env.Long(L"tz_offset");
|
||||
|
||||
|
||||
|
||||
}
|
||||
void Clear();
|
||||
bool IsMemberOf(long group);
|
||||
bool ReadMonthDayTime(PT::Date & date, const wchar_t * str);
|
||||
bool SetTzFromEnv();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -47,15 +47,6 @@ void Users::ReadUsers(Db * db)
|
||||
}
|
||||
|
||||
|
||||
void Users::SetTimeZoneOffset(int offset)
|
||||
{
|
||||
Table::Iterator i;
|
||||
|
||||
for(i=table.Begin() ; i!=table.End() ; ++i)
|
||||
{
|
||||
i->time_zone_offset = offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Users::AddUser(const User & user)
|
||||
|
||||
@@ -38,7 +38,6 @@ public:
|
||||
|
||||
void Clear();
|
||||
void ReadUsers(Db * db);
|
||||
void SetTimeZoneOffset(int offset); // !! temporarily one time_zone for all users
|
||||
bool AddUser(const User & user);
|
||||
bool IsUser(const std::wstring & name);
|
||||
User * GetUser(long user_id);
|
||||
|
||||
Reference in New Issue
Block a user