[pLog-svn] r2191 - plog/trunk/class/dao

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri Jun 10 12:14:28 GMT 2005


Author: oscar
Date: 2005-06-10 12:14:28 +0000 (Fri, 10 Jun 2005)
New Revision: 2191

Modified:
   plog/trunk/class/dao/userpermissions.class.php
Log:
disabled caching in one situation, since it wasn't working...


Modified: plog/trunk/class/dao/userpermissions.class.php
===================================================================
--- plog/trunk/class/dao/userpermissions.class.php	2005-06-10 12:13:56 UTC (rev 2190)
+++ plog/trunk/class/dao/userpermissions.class.php	2005-06-10 12:14:28 UTC (rev 2191)
@@ -88,17 +88,22 @@
         {
             $isAdmin = $this->_cache->getData( $userId, CACHE_SITEADMINS );
 
-            if ( is_bool($isAdmin) ) {
+            //
+            // :TODO: this doesn't work! When there is no cached data, it will return
+            // false but the if() branch below will think that 'false' means that the 
+            // user is not a site admin not that the data is not in the cache!
+            //
+            /*if ( is_bool($isAdmin) ) {
                 // fetched from cache
                 return $isAdmin;
-            } else {
+            } else {*/
                 if( isset($this->cache[$userId])) {
                     //print("user cached<br/>");
                     $result = $this->cache[$userId];
                 }
                 else {
 
-                    $query = "SELECT * FROM ".$this->getPrefix()."users_permissions WHERE permission_id = 1 AND user_id = '".Db::qstr($userId)."'";
+                    $query = "SELECT * FROM ".$this->getPrefix()."users_permissions WHERE permission_id = 1 AND user_id = '".Db::qstr($userId)."'";                   
 
                     $result = $this->Execute( $query );
 
@@ -119,7 +124,7 @@
                     return true;
                 } else
                     return false;
-            }
+            //}
         }
 
         /**




More information about the pLog-svn mailing list