57 lines
731 B
C++
57 lines
731 B
C++
|
/*
|
||
|
* This file is a part of Winix
|
||
|
* and is not publicly distributed
|
||
|
*
|
||
|
* Copyright (c) 2012, Tomasz Sowa
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
#include "timezone.h"
|
||
|
|
||
|
|
||
|
namespace Fun
|
||
|
{
|
||
|
|
||
|
TimeZone::TimeZone()
|
||
|
{
|
||
|
fun.url = L"timezone";
|
||
|
}
|
||
|
|
||
|
|
||
|
bool TimeZone::HasAccess()
|
||
|
{
|
||
|
return cur->session->puser != 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void TimeZone::MakePost()
|
||
|
{
|
||
|
if( cur->session->puser )
|
||
|
{
|
||
|
size_t tz_id = size_t(Toi(cur->request->PostVar(L"timezoneid")));
|
||
|
|
||
|
if( system->time_zones.HasZone(tz_id) )
|
||
|
{
|
||
|
cur->session->puser->time_zone_id = tz_id;
|
||
|
db->ChangeUserTimeZone(cur->session->puser->id, tz_id);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
log << log1 << "TimeZone: incorrect time zone id: " << tz_id << logend;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void TimeZone::MakeGet()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
} // namespace
|