[Fusionforge-commits] r7177 - branches/Branch_4_7/gforge/common/include

Gonéri Le Bouder goneri at libremir.placard.fr.eu.org
Wed Mar 18 09:50:13 CET 2009


Author: goneri
Date: 2009-03-18 09:50:12 +0100 (Wed, 18 Mar 2009)
New Revision: 7177

Modified:
   branches/Branch_4_7/gforge/common/include/User.class.php
Log:
backport of 7075, 7076 and 7106


Modified: branches/Branch_4_7/gforge/common/include/User.class.php
===================================================================
--- branches/Branch_4_7/gforge/common/include/User.class.php	2009-03-17 20:39:55 UTC (rev 7176)
+++ branches/Branch_4_7/gforge/common/include/User.class.php	2009-03-18 08:50:12 UTC (rev 7177)
@@ -278,7 +278,7 @@
 			return false;
 		}
 		if ($GLOBALS['sys_require_unique_email']) {
-			if (db_numrows(db_query("SELECT user_id FROM users WHERE email='$email' OR email_new='$email'")) > 0) {
+			if (db_numrows(db_query("SELECT user_id FROM users WHERE email ILIKE '$email' OR email_new ILIKE '$email'")) > 0) {
 				$this->setError(_('User with this email already exists - use people search to recover your login.'));
 				return false;
 			}
@@ -759,6 +759,11 @@
 	 *	@return boolean success.
 	 */
 	function setEmail($email) {
+
+		if (!strcasecmp($this->getEmail(), $email)) {
+			return true;
+		}
+
 		if (!$email || !validate_email($email)) {
 			$this->setError('ERROR: Invalid Email');
 			return false;
@@ -806,7 +811,7 @@
 		}
 
 		if ($GLOBALS['sys_require_unique_email']) {
-			if (db_numrows(db_query("SELECT user_id FROM users WHERE email='$email' OR email_new='$email'")) > 0) {
+			if (db_numrows(db_query("SELECT user_id FROM users WHERE email ILIKE '$email' OR email_new ILIKE '$email'")) > 0) {
 				$this->setError(_('User with this email already exists.'));
 			return false;
 			}




More information about the Fusionforge-commits mailing list