[pLog-svn] r3082 - in plog/trunk/class/dao: . userdata

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sat Mar 18 13:59:48 GMT 2006


Author: oscar
Date: 2006-03-18 13:59:47 +0000 (Sat, 18 Mar 2006)
New Revision: 3082

Modified:
   plog/trunk/class/dao/userdata/baseuserdataprovider.class.php
   plog/trunk/class/dao/userdata/ploguserdataprovider.class.php
   plog/trunk/class/dao/userinfo.class.php
Log:
fixed an issue when updating the user data


Modified: plog/trunk/class/dao/userdata/baseuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/baseuserdataprovider.class.php	2006-03-18 13:33:26 UTC (rev 3081)
+++ plog/trunk/class/dao/userdata/baseuserdataprovider.class.php	2006-03-18 13:59:47 UTC (rev 3082)
@@ -140,7 +140,8 @@
         {
 	        include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
 	        
-            $userInfo = new UserInfo( $query_result["user"], $query_result["password"],
+            $userInfo = new UserInfo( $query_result["user"], 
+			                          $query_result["password"],
                                       $query_result["email"],
                                       $query_result["about"],
                                       $query_result["full_name"],
@@ -179,17 +180,6 @@
         function updateUser( $userInfo )
         {
 			include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );	        
-	        
-            // and now update the permissions, if there has been any change
-            /**
-             * :TODO:
-             *
-             * check if this is really not needed!!!
-             *
-             */
-            //$perms = new UserPermissions();
-            //$perms->updateSiteAdmin( $userInfo->getId(), $userInfo->isSiteAdmin());
-            
             return( true );
         }
 

Modified: plog/trunk/class/dao/userdata/ploguserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/ploguserdataprovider.class.php	2006-03-18 13:33:26 UTC (rev 3081)
+++ plog/trunk/class/dao/userdata/ploguserdataprovider.class.php	2006-03-18 13:59:47 UTC (rev 3082)
@@ -153,14 +153,10 @@
         {
         	$result = $this->update( $user );
 
-			if( $userId ) {
+			if( $result ) {
 				// remove the old data
 	            $this->_cache->removeData( $user->getId(), CACHE_USERINFO );
     	        $this->_cache->removeData( $user->getUsername(), CACHE_USERIDBYNAME );
-    	        // and add the new one
-    	        $user->setMD5Password( $user->getPassword() );
-	        	$this->_cache->setData( $user->getId(), CACHE_USERINFO, $user );
-    	    	$this->_cache->setData( $user->getUsername(), CACHE_USERIDBYNAME, $user->getId());    	        
     	    }
             
             BaseUserDataProvider::updateUser( $user );

Modified: plog/trunk/class/dao/userinfo.class.php
===================================================================
--- plog/trunk/class/dao/userinfo.class.php	2006-03-18 13:33:26 UTC (rev 3081)
+++ plog/trunk/class/dao/userinfo.class.php	2006-03-18 13:59:47 UTC (rev 3082)
@@ -70,7 +70,12 @@
 		
 		function getMD5Password()
 		{
-			return( md5( $this->getPassword()));
+			if( strlen( $this->getPassword()) == 32 )
+				$md5pass = $this->getPassword();
+			else 
+				$md5pass = md5( $this->getPassword());
+				
+			return( $md5pass );
 		}
 
 		function getId()



More information about the pLog-svn mailing list