Code

Updated get_category_permissions
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Aug 2006 11:50:31 +0000 (11:50 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 3 Aug 2006 11:50:31 +0000 (11:50 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4380 594d385d-05f5-0310-b6e9-bd551577e9d8

html/main.php
include/class_userinfo.inc
plugins/admin/users/class_userManagement.inc

index 365763c9c3f639bdf34df1a41fc8ac4bdc443879..93c71f5ac0546fb5323acff28621342ba19174e4 100644 (file)
@@ -157,6 +157,11 @@ textdomain($domain);
 /* Prepare plugin list */
 if (!isset($_SESSION['plist'])){
   $_SESSION['plist']= new pluglist($config, $ui);
+  
+  /* Load ocMapping into userinfo */
+  $tmp= new acl($config, NULL, $ui->dn);
+  $ui->ocMapping= $tmp->ocMapping;
+  $_SESSION['ui']= $ui;
 }
 $plist= $_SESSION['plist'];
 
index 066b57e031a96d92dc660b0574273c620de8818d..9c8deabb105061a9dfebc5327a0ef4c408c7fd46 100644 (file)
@@ -31,6 +31,7 @@ class userinfo
   var $gosaUnitTag= "";
   var $subtreeACL= array();
   var $ACL= array();
+  var $ocMapping= array();
   var $groups= array();
 
   /* get acl's an put them into the userinfo object
@@ -93,6 +94,7 @@ class userinfo
 #echo "NEW ACL LOADING --------------------------------------------------------------------------------------------<br>";
 
     $this->ACL= array();    
+    $this->ocMapping= array();
     $this->groups= array();    
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
@@ -155,12 +157,21 @@ class userinfo
       }
 
     }
+
   }
 
 
   function get_category_permissions($dn, $category)
   {
-    return ("cdmrw");
+    /* Get list of objectClasses and get the permissions for it */
+    $acl= "";
+    if (isset($this->ocMapping[$category])){
+      foreach($this->ocMapping[$category] as $oc){
+        $acl.= $this->get_permissions($dn, $oc, "");
+      }
+    }
+
+    return ($acl);
   }
 
 
@@ -213,6 +224,14 @@ class userinfo
             continue;
           }
 
+          /* If attribute is "", we want to know, if we've *any* permissions here... */
+          if ($attribute == "" && isset($subacl['acl'][$object])){
+            foreach($subacl['acl'][$object] as $attr => $dummy){
+              $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attr]);
+            }
+            continue;
+          }
+
         }
       }
     }
index 0c2e864a5a82fc7fc97574b901ddf0f89d1f8911..8e7f6415f5d3211649881503dfbdf87600bf5d9c 100644 (file)
@@ -717,11 +717,11 @@ class userManagement extends plugin
     $ldap= $this->config->get_ldap_link(TRUE);
 
     if ($SubSearch){
-      $ListTemp =  get_list($filter, "user", $base,
+      $ListTemp =  get_list($filter, "users", $base,
                             array("uid", "givenName", "sn", "objectClass"), GL_SUBSEARCH | GL_SIZELIMIT);
     } else {
       $base= get_people_ou().$base;
-      $ListTemp = get_list($filter, "user", $base, 
+      $ListTemp = get_list($filter, "users", $base, 
                             array("uid", "givenName", "sn", "objectClass"), GL_SIZELIMIT);
     }
     $SortTemp = array();