Code

Use get_list instead of ldap->ls.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Nov 2006 08:50:16 +0000 (08:50 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Nov 2006 08:50:16 +0000 (08:50 +0000)
get_list filters unit_tags

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5242 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index df6f8c094fa44ec231f94f5bc2b0978c49ce3534..eed4c35cfb23970274a56be20467dee6e94e8224 100644 (file)
@@ -37,11 +37,13 @@ class appgroup extends plugin
 
   var $CopyPasteVars            = array("Categories");
   var $gosaApplicationParameter ;
+  var $ui                       ;
 
 
   function appgroup ($config, $dn= NULL, $parent= NULL)
   {
-   
+    $this->ui = get_userinfo();  
     /* prepare group app for release management */ 
     $tmp = search_config($config->data,"faiManagement","CLASS");
     if(!empty($tmp)){
@@ -930,17 +932,12 @@ class appgroup extends plugin
       }
 
       $base = preg_replace("/ou=apps,.*$/","ou=apps,".$this->curbase,$base);
-    
-      $ldap   = $this->config->get_ldap_link();
-      $ldap->cd ($base);
-      $ldap->ls ("(objectClass=gosaApplication)",$base);
+      $app_res = get_list("(objectClass=gosaApplication)", $this->ui->subtreeACL, $base,array("cn","description"));
     }else{
-      $ldap   = $this->config->get_ldap_link();
-      $ldap->cd ("ou=apps,".$this->curbase);
-      $ldap->ls ("(objectClass=gosaApplication)","ou=apps,".$this->curbase);
+      $app_res = get_list("(objectClass=gosaApplication)", $this->ui->subtreeACL, "ou=apps,".$this->curbase,array("cn","description"));
     }
     
-    while ($attrs= $ldap->fetch()){
+    foreach($app_res as $attrs){
       if (isset($attrs["description"][0])){    
         $this->apps[$attrs["cn"][0]]=
           $attrs["cn"][0]." (".
@@ -951,6 +948,7 @@ class appgroup extends plugin
       }
     }
 
+    $ldap = $this->config->get_ldap_link();
     $ldap->cd($this->config->current['BASE']);
     $ldap->search("objectClass=gosaApplication",array("gosaApplicationParameter","cn"));
     $tmp = search_config($this->config->data,"faiManagement","CLASS");