mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 09:28:29 +01:00
changed system.time for Espen/eGWOsync to return struct with keys:
- system: system-time as datetime.iso8601 - system_tz_offset: tz_offset to UTC in seconds as integer and, if loged in, analog user and user_tz_offset
This commit is contained in:
parent
eb6d8504c1
commit
7a80cb08a6
@ -928,17 +928,25 @@
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$GLOBALS['_xmlrpcs_egw_time_sig'] = array(array(xmlrpcString,xmlrpcString));
|
$GLOBALS['_xmlrpcs_egw_time_sig'] = array(array(xmlrpcStruct));
|
||||||
$GLOBALS['_xmlrpcs_egw_time_doc'] = 'Returns system time based on optional format string';
|
$GLOBALS['_xmlrpcs_egw_time_doc'] = 'returns system-time and -timezone and if loged in user-time and timezone';
|
||||||
function _xmlrpcs_time($server,$m)
|
function _xmlrpcs_time($server,$m)
|
||||||
{
|
{
|
||||||
$param0 = $m->getParam(0);
|
$return = array(
|
||||||
$format = $param0->scalarval();
|
'system' => $GLOBALS['server']->date2iso8601(time()),
|
||||||
$format = $format ? $format : 'Y/m/d H:i:s';
|
'system_tz_offset' => (int) date('Z'),
|
||||||
|
);
|
||||||
|
if ($GLOBALS['server']->authed)
|
||||||
|
{
|
||||||
|
$tz_offset_s = 3600 * (int) $GLOBALS['egw_info']['user']['preferences']['common']['tz_offset'];
|
||||||
|
$return += array(
|
||||||
|
'user' => $GLOBALS['server']->date2iso8601(time()+$tz_offset_s),
|
||||||
|
'user_tz_offset' => (int) date('Z') + $tz_offset_s,
|
||||||
|
);
|
||||||
|
}
|
||||||
return CreateObject(
|
return CreateObject(
|
||||||
'phpgwapi.xmlrpcresp',
|
'phpgwapi.xmlrpcresp',
|
||||||
CreateObject('phpgwapi.xmlrpcval', date($format,time()), 'string')
|
$GLOBALS['server']->build_resp($return,true)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user