Code

Added administrative unit array
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Apr 2006 11:05:38 +0000 (11:05 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 28 Apr 2006 11:05:38 +0000 (11:05 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3167 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_config.inc

index ef1c93c669e9b47ec270b12b36545c872f95b1e9..fa1823503c2786c6d0adaa39f61a5d2d93cf2b63 100644 (file)
@@ -45,6 +45,7 @@ class config  {
   /* Keep a copy of the current deparment list */
   var $departments= array();
   var $idepartments= array();
+  var $adepartments= array();
 
   function config($filename, $basedir= "")
   {
@@ -469,14 +470,22 @@ class config  {
 
     /* Initialize result hash */
     $result= array();
+    $administrative= array();
     $result['/']= $this->current['BASE'];
 
     /* Get list of department objects */
     $ldap= $this->get_ldap_link();
     $ldap->cd ($this->current['BASE']);
-    $ldap->search ("(objectClass=gosaDepartment)", array("ou"));
+    $ldap->search ("(objectClass=gosaDepartment)", array("ou", "objectClass", "gosaUnitTag"));
     while ($attrs= $ldap->fetch()){
       $dn= $ldap->getDN();
+
+      /* Save administrative departments */
+      if (in_array_ics("gosaAdministrativeUnit", $attrs['objectClass']) &&
+          isset($attrs['gosaUnitTag'][0])){
+        $administrative[$dn]= $attrs['gosaUnitTag'];
+      }
+    
       if ($dn == $ignore_dn){
         continue;
       }
@@ -487,6 +496,7 @@ class config  {
       }
     }
 
+    $this->adepartments= $administrative;
     $this->departments= $result;
   }