[pLog-svn] r2807 - plog/trunk/class/dao/userdata

oscar at devel.lifetype.net oscar at devel.lifetype.net
Tue Jan 17 20:30:36 GMT 2006


Author: oscar
Date: 2006-01-17 20:30:36 +0000 (Tue, 17 Jan 2006)
New Revision: 2807

Modified:
   plog/trunk/class/dao/userdata/ploguserdataprovider.class.php
Log:
Fixes.

Modified: plog/trunk/class/dao/userdata/ploguserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/ploguserdataprovider.class.php	2006-01-17 19:49:07 UTC (rev 2806)
+++ plog/trunk/class/dao/userdata/ploguserdataprovider.class.php	2006-01-17 20:30:36 UTC (rev 2807)
@@ -117,7 +117,11 @@
 				return $users;
 
             while ($row = $result->FetchRow()) {
-                $users[] = $this->mapRow( $row );
+				$user = $this->mapRow( $row );
+                $users[] = $user;
+				// cache the data for later use
+				$this->_cache->setData( $user->getId(), $user, CACHE_USERINFO );
+				$this->_cache->setData( $user->getUsername(), $user, CACHE_USERIDBYNAME );
 			}
 
             return $users;
@@ -174,7 +178,7 @@
 
 			if( $userId ) {        	
 	        	$this->_cache->setData( $user->getId(), CACHE_USERINFO, $user );
-    	    	$this->_cache->setData( $user->getUsername(), CACHE_USERIDBYNAME, $user->getId());
+    	    	$this->_cache->setData( $user->getUsername(), CACHE_USERIDBYNAME, $user );
     	    }
         	
         	return( $userId );
@@ -363,7 +367,8 @@
          * check if the email account has been registered
          * @return true if the email account has been registered
          */
-        function emailExists($email){
+        function emailExists($email) 
+		{
             $query = "SELECT email 
                       FROM ".$this->getPrefix()."users 
                       WHERE email = '".Db::qstr($email)."'";



More information about the pLog-svn mailing list