From 3b596f061e5a1c66010c02b65c8577e136e7b097 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 18 Sep 2015 07:18:58 +0000 Subject: [PATCH] UCS lowercases email when storing --- .../inc/class.addressbook_univention.inc.php | 14 ++++++++++++++ phpgwapi/inc/class.accounts_univention.inc.php | 3 +++ 2 files changed, 17 insertions(+) diff --git a/addressbook/inc/class.addressbook_univention.inc.php b/addressbook/inc/class.addressbook_univention.inc.php index 9ccfb7b516..347300d54b 100644 --- a/addressbook/inc/class.addressbook_univention.inc.php +++ b/addressbook/inc/class.addressbook_univention.inc.php @@ -23,4 +23,18 @@ class addressbook_univention extends addressbook_ldap ); parent::__construct($ldap_config, $ds); } + + /** + * saves the content of data to the db + * + * @param array $keys if given $keys are copied to data before saveing => allows a save as + * @return int 0 on success and errno != 0 else + */ + function save($keys=null) + { + // UCS lowercases email when storing + $keys['email'] = strtolower(!empty($keys['email']) ? $keys['email'] : $this->data['email']); + + return parent::save($keys); + } } diff --git a/phpgwapi/inc/class.accounts_univention.inc.php b/phpgwapi/inc/class.accounts_univention.inc.php index dbd7dc1828..a45549d3ee 100644 --- a/phpgwapi/inc/class.accounts_univention.inc.php +++ b/phpgwapi/inc/class.accounts_univention.inc.php @@ -47,6 +47,9 @@ class accounts_univention extends accounts_ldap */ function save(&$data) { + // UCS lowercases email when storing + $data['account_email'] = strtolower($data['account_email']); + if (self::available()) { $config = $this->frontend->config && $this->frontend->config['ldap_context'] ?