* 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:24:42 +00:00
parent ae0cd9238f
commit 2605f86e1c
3 changed files with 6 additions and 21 deletions

View File

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

View File

@ -1,11 +1,6 @@
<?php <?php
/** /**
* API - accounts * EGroupware 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.
* *
* @link http://www.egroupware.org * @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> complete rewrite in 6/2006 and earlier modifications * @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 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. * The account class implements all other (eg. name2id, id2name) functions on top of these.
* *
* @link http://www.egroupware.org * read and search return timestamps (account_(created|modified|lastlogin) in server-time!
* @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$
*/ */
class accounts class accounts
{ {

View File

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