Code

Added parameter remove for mgroup apps
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 May 2006 12:11:31 +0000 (12:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 30 May 2006 12:11:31 +0000 (12:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3563 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/groups/class_groupApplication.inc

index 8644c88b0077101d8a1d8ccac8ce0e06bc9aed94..80839ce16b81f0a2df4529fb66be18e9966f0a56 100644 (file)
@@ -371,7 +371,6 @@ class appgroup extends plugin
     /* Call parent execute */
     plugin::execute();
 
-
     if((isset($_GET['act']))&&($_GET['act']=="depopen")){
       $dep = base64_decode($_GET['depid']);  
       if(isset($this->config->idepartments[$dep])){
@@ -455,9 +454,15 @@ class appgroup extends plugin
 
         foreach($this->gosaMemberApplication as $key =>  $cat){
           foreach($cat as $key2 => $app){
+            
             if($app['App'] == $val){
               unset($this->gosaMemberApplication[$key][$key2]);
               if(isset($this->used_apps[$val])){
+                foreach($this->getParameters($val) as $para){
+                  if(isset($this->appoption[$para])){
+                    unset($this->appoption[$para]);
+                  }
+                }
                 unset($this->used_apps[$val]);
               }
             }
@@ -999,6 +1004,27 @@ class appgroup extends plugin
     $this->is_modified= TRUE;
   }
 
+  function getParameters($app)
+  {
+    $tmp = $this->getReleases();
+    $ret = array();
+    if(in_array($this->FAIrelease,$tmp)){
+      $tmp2 = array_flip($tmp);
+      $base = $tmp2[$this->FAIrelease];
+      $ldap = $this->config->get_ldap_link();
+      $ldap->cd($this->config->current['BASE']);
+      $ldap->search("(&(objectClass=gosaApplication)(cn=".$app.")(gosaApplicationParameter=*))",array("gosaApplicationParameter"));
+      if($ldap->count()){
+        $attrs = $ldap->fetch();
+        for($i = 0 ; $i < $attrs['gosaApplicationParameter']['count'] ; $i ++ ){
+          $name = preg_replace("/:.*$/","",$attrs['gosaApplicationParameter'][$i]);
+          $ret[$name] = $name;
+        } 
+      }
+    }
+    return($ret);
+  }
+
   function GetSubdirs($dir)
   {
     $ret = array();