[geeklog-cvs] Geeklog-1.x/public_html usersettings.php, 1.170, 1.171

Dirk Haun dhaun at qs1489.pair.com
Sun Feb 24 14:43:55 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv46118/public_html

Modified Files:
	usersettings.php 
Log Message:
Ease restriction that email addresses have to be unique to make handling of remote / OpenID accounts easier


Index: usersettings.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/usersettings.php,v
retrieving revision 1.170
retrieving revision 1.171
diff -C2 -d -r1.170 -r1.171
*** usersettings.php	20 Feb 2008 20:07:59 -0000	1.170
--- usersettings.php	24 Feb 2008 19:43:53 -0000	1.171
***************
*** 724,728 ****
  * @param   uid     int      user id of current user
  * @return          bool     true = exists, false = does not exist
! *
  */
  function emailAddressExists ($email, $uid)
--- 724,728 ----
  * @param   uid     int      user id of current user
  * @return          bool     true = exists, false = does not exist
! * @note    Allows remote accounts to have duplicate email addresses
  */
  function emailAddressExists ($email, $uid)
***************
*** 730,741 ****
      global $_TABLES;
  
!     $result = DB_query ("SELECT uid FROM {$_TABLES['users']} WHERE email = '{$email}'");
!     $numrows = DB_numRows ($result);
!     for ($i = 0; $i < $numrows; $i++) {
!         $A = DB_fetchArray ($result);
!         if ($A['uid'] != $uid) {
!             // email address is already in use for another account
!             return true;
!         }
      }
  
--- 730,744 ----
      global $_TABLES;
  
!     $old_email = DB_getItem($_TABLES['users'], 'email', "uid = '$uid'");
!     if ($email == $old_email) {
!         // email address didn't change so don't care
!         return false;
!     }
! 
!     $email = addslashes($email);
!     $result = DB_query("SELECT uid FROM {$_TABLES['users']} WHERE email = '$email' AND uid <> '$uid' AND (remoteservice IS NULL OR remoteservice = '')");
!     if (DB_numRows($result) > 0) {
!         // email address is already in use for another non-remote account
!         return true;
      }
  




More information about the geeklog-cvs mailing list