[pLog-svn] r4118 - plog/branches/lifetype-1.1.1/class/dao/userdata

oscar at devel.lifetype.net oscar at devel.lifetype.net
Tue Oct 10 21:57:55 GMT 2006


Author: oscar
Date: 2006-10-10 21:57:54 +0000 (Tue, 10 Oct 2006)
New Revision: 4118

Modified:
   plog/branches/lifetype-1.1.1/class/dao/userdata/lifetypeuserdataprovider.class.php
Log:
fixed issue 1080 (http://bugs.lifetype.net/view.php?id=1080) where usernames with accented letters were causing some trouble.


Modified: plog/branches/lifetype-1.1.1/class/dao/userdata/lifetypeuserdataprovider.class.php
===================================================================
--- plog/branches/lifetype-1.1.1/class/dao/userdata/lifetypeuserdataprovider.class.php	2006-10-10 21:18:09 UTC (rev 4117)
+++ plog/branches/lifetype-1.1.1/class/dao/userdata/lifetypeuserdataprovider.class.php	2006-10-10 21:57:54 UTC (rev 4118)
@@ -34,7 +34,7 @@
          */
         function authenticateUser( $user, $pass )
         {
-        	$user = $this->getUserInfoFromUsername( $user );			
+        	$user = $this->getUserInfoFromUsername( $user );
         	if( $user ) {
 	        	return( $user->getPassword() == md5($pass));
 	        }
@@ -68,7 +68,15 @@
          */
         function getUserInfoFromUsername( $username )
         {
-        	return( $this->get( "user", $username, CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" )));        	
+        	$user = $this->get( "user", $username, CACHE_USERIDBYNAME, Array( CACHE_USERINFO => "getId" ));
+		if( $user ) {
+			if( $user->getUsername() != $username ) {
+				$this->log->error( "MySQL returned object (".$user->getId().",".$user->getUsername().") for username = ".$username );
+				$user = false;
+			}
+		}
+
+		return( $user );
         }
 
         /**



More information about the pLog-svn mailing list