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:
Ralf Becker 2006-03-08 19:34:02 +00:00
parent eb6d8504c1
commit 7a80cb08a6

View File

@ -928,17 +928,25 @@
}
*/
$GLOBALS['_xmlrpcs_egw_time_sig'] = array(array(xmlrpcString,xmlrpcString));
$GLOBALS['_xmlrpcs_egw_time_doc'] = 'Returns system time based on optional format string';
$GLOBALS['_xmlrpcs_egw_time_sig'] = array(array(xmlrpcStruct));
$GLOBALS['_xmlrpcs_egw_time_doc'] = 'returns system-time and -timezone and if loged in user-time and timezone';
function _xmlrpcs_time($server,$m)
{
$param0 = $m->getParam(0);
$format = $param0->scalarval();
$format = $format ? $format : 'Y/m/d H:i:s';
$return = array(
'system' => $GLOBALS['server']->date2iso8601(time()),
'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(
'phpgwapi.xmlrpcresp',
CreateObject('phpgwapi.xmlrpcval', date($format,time()), 'string')
$GLOBALS['server']->build_resp($return,true)
);
}