[Jaws-commits] r12482 - in branches/0.8/html/include/Jaws: . Session

afz at jaws-project.com afz at jaws-project.com
Mon Jan 23 12:25:29 UTC 2012


Author: afz
Date: 2012-01-23 12:25:29 +0000 (Mon, 23 Jan 2012)
New Revision: 12482

Modified:
   branches/0.8/html/include/Jaws/ACL.php
   branches/0.8/html/include/Jaws/Session/Cache.php
   branches/0.8/html/include/Jaws/User.php
Log:
some changes in Jaws_ACL and Jaws_User for more compatible with new changes in Jaws_Session

Modified: branches/0.8/html/include/Jaws/ACL.php
===================================================================
--- branches/0.8/html/include/Jaws/ACL.php	2012-01-23 08:06:46 UTC (rev 12481)
+++ branches/0.8/html/include/Jaws/ACL.php	2012-01-23 12:25:29 UTC (rev 12482)
@@ -391,7 +391,7 @@
         if (!empty($groups)) {
             $perm['groups'] = null;
             foreach ($groups as $group) {
-                $gPerm = $this->GetGroupPermission($group['id'], $gadget, $task);
+                $gPerm = $this->GetGroupPermission($group, $gadget, $task);
                 if (!is_null($gPerm)) {
                     $perm['groups'] = is_null($perm['groups'])? $gPerm : ($perm['groups'] || $gPerm);
                 }
@@ -622,7 +622,7 @@
 
         $aclGroups = array();
         foreach ($groups as $group) {
-            $acls = $this->GetGroupAclPermissions($group['id']);
+            $acls = $this->GetGroupAclPermissions($group);
             if (!Jaws_Error::IsError($acls)) {
                 $aclGroups = $acls;
             }

Modified: branches/0.8/html/include/Jaws/Session/Cache.php
===================================================================
--- branches/0.8/html/include/Jaws/Session/Cache.php	2012-01-23 08:06:46 UTC (rev 12481)
+++ branches/0.8/html/include/Jaws/Session/Cache.php	2012-01-23 12:25:29 UTC (rev 12482)
@@ -31,14 +31,6 @@
         if (!empty($sid)) {
             // Now we sync with a previous session only if has changed
             if ($GLOBALS['app']->Session->_HasChanged) {
-                require_once JAWS_PATH . 'include/Jaws/User.php';
-                $userModel = new Jaws_User();
-                $groups = $userModel->GetGroupsOfUser($username);
-                if (Jaws_Error::IsError($groups)) {
-                    $groups = array();
-                }
-                $GLOBALS['app']->Session->SetAttribute('groups', $groups);
-
                 $params = array();
                 $serialized = serialize($GLOBALS['app']->Session->_Attributes);
                 $params['sid']        = $sid;

Modified: branches/0.8/html/include/Jaws/User.php
===================================================================
--- branches/0.8/html/include/Jaws/User.php	2012-01-23 08:06:46 UTC (rev 12481)
+++ branches/0.8/html/include/Jaws/User.php	2012-01-23 12:25:29 UTC (rev 12482)
@@ -472,7 +472,7 @@
         $params['user'] = $user;
         $sql = '
             SELECT
-                [[groups]].[id], [[groups]].[name]
+                [[groups]].[id]
             FROM [[users_groups]]
             INNER JOIN [[users]]  ON [[users]].[id] =  [[users_groups]].[user_id]
             INNER JOIN [[groups]] ON [[groups]].[id] = [[users_groups]].[group_id]
@@ -483,7 +483,7 @@
             $sql .= 'WHERE [[users]].[username] = {user}';
         }
 
-        return $GLOBALS['db']->queryAll($sql, $params);
+        return $GLOBALS['db']->queryCol($sql, $params);
     }
 
     /**



More information about the Jaws-commits mailing list