From 51529a6aa2c144895fb9fa22c632e0bc77646acf Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 19 Aug 2015 14:42:15 +0000 Subject: [PATCH] * PostgreSQL: fix SQL error on login with auto-create accounts enabled and user-name already exists with different case --- phpgwapi/inc/class.accounts_sql.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index 889d7db189..86b5d258df 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -595,6 +595,12 @@ class accounts_sql $table = $this->table; $cols .= ',account_type'; $where[$which] = $name; + // check if we need to treat username case-insensitive + if ($which == 'account_lid' && !$GLOBALS['egw_info']['server']['case_sensitive_username']) // = is case sensitiv eg. on postgres, but not on mysql! + { + $where[] = 'account_lid '.$this->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote($where['account_lid']); + unset($where['account_lid']); + } } if ($account_type) {