* Admin/Addressbook: fixed wrong timezone in created and modified times for contacts and accounts

- fixed typo / wrong direction of conversation when storing contacts
- fixed accounts_sql, which uses addressbook_bo::search() to convert created and modified timestamps to servertime as
- (documented that) accounts class (SQL and LDAP) operate completly in server-time
This commit is contained in:
Ralf Becker 2012-03-14 15:22:51 +00:00
parent 94f1c840d0
commit a1ffcd08e4
3 changed files with 7 additions and 22 deletions

View File

@ -715,7 +715,7 @@ class addressbook_bo extends addressbook_so
{
if (isset($data[$name]))
{
$data[$name] = egw_time::server2user($data[$name], $date_format);
$data[$name] = egw_time::user2server($data[$name], $date_format);
}
}
return $data;

View File

@ -1,11 +1,6 @@
<?php
/**
* API - accounts
*
* This class extends a backend class (at them moment SQL or LDAP) and implements some
* caching on to top of the backend functions. The cache is share for all instances of
* the accounts class and for LDAP it is persistent through the whole session, for SQL
* it's only on a per request basis.
* EGroupware API - accounts
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> complete rewrite in 6/2006 and earlier modifications
@ -31,18 +26,7 @@
* The backend only implements the read, save, delete, name2id and the {set_}members{hips} methods.
* The account class implements all other (eg. name2id, id2name) functions on top of these.
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> complete rewrite in 6/2006
*
* Implements the (now depricated) interfaces on the former accounts class written by
* Joseph Engo <jengo@phpgroupware.org> and Bettina Gille <ceb@phpgroupware.org>
* Copyright (C) 2000 - 2002 Joseph Engo, Copyright (C) 2003 Joseph Engo, Bettina Gille
*
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package api
* @subpackage accounts
* @access public
* @version $Id$
* read and search return timestamps (account_(created|modified|lastlogin) in server-time!
*/
class accounts
{
@ -455,7 +439,7 @@ class accounts
// for current user, add the apps available to him
if ($id == $GLOBALS['egw_info']['user']['account_id'])
{
foreach($GLOBALS['egw_info']['user']['apps'] as $app => $data)
foreach((array)$GLOBALS['egw_info']['user']['apps'] as $app => $data)
{
unset($data['table_defs']); // no need for that on the client
$account['apps'][$app] = $data;

View File

@ -406,8 +406,9 @@ class accounts_sql
'account_email' => $contact['email'],
'person_id' => $contact['id'],
'account_status' => $contact['account_status'],
'account_created' => $contact['created'],
'account_modified' => $contact['modified'],
// addressbook_bo::search() returns everything in user-time, need to convert to server-time
'account_created' => egw_time::user2server($contact['created']),
'account_modified' => egw_time::user2server($contact['modified']),
);
}
}