fixed: there were mktime() used on some dirs Items
so sometimes the time of the dir was changed now for converting tm into time_t use: time_t Time(const tm & par); time_t Time(const tm * par); tm Time(time_t par); from core/misc.h now winix internally use GMT time only when printing it is converted to local user time temporarily all users use the same local time (config: time_zone_offset) (only logs are genereted with local system time) added to system: time_t LocalTime(time_t gmt_time); tm LocalTime(const tm * ptm); tm LocalTime(const tm & ptm); they convert GMT time to local user time git-svn-id: svn://ttmath.org/publicrep/winix/trunk@666 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
18
core/app.cpp
18
core/app.cpp
@@ -19,7 +19,7 @@
|
||||
App::App()
|
||||
{
|
||||
stdout_is_closed = false;
|
||||
last_sessions_save = time(0);
|
||||
last_sessions_save = std::time(0);
|
||||
|
||||
db.SetConn(db_conn);
|
||||
|
||||
@@ -278,7 +278,7 @@ void App::Start()
|
||||
|
||||
void App::SaveSessionsIfNeeded()
|
||||
{
|
||||
time_t t = time(0);
|
||||
time_t t = std::time(0);
|
||||
|
||||
if( last_sessions_save + 86400 > t )
|
||||
return;
|
||||
@@ -531,17 +531,9 @@ void App::PrepareSessionCookie()
|
||||
}
|
||||
else
|
||||
{
|
||||
time_t t = time(0) + config.session_remember_max_idle;
|
||||
tm * expires = localtime(&t);
|
||||
|
||||
if( !expires )
|
||||
{
|
||||
// oops, something wrong
|
||||
request.SetCookie(config.http_session_id_name.c_str(), request.session->id);
|
||||
return;
|
||||
}
|
||||
|
||||
request.SetCookie(config.http_session_id_name.c_str(), request.session->id, expires);
|
||||
time_t t = std::time(0) + config.session_remember_max_idle;
|
||||
tm expires = Time(t);
|
||||
request.SetCookie(config.http_session_id_name.c_str(), request.session->id, &expires);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user