Code

Shortened the base string
[gosa.git] / plugins / admin / groups / class_groupApplication.inc
index 5e03d69c5428e624e22f11abe590f296d97b4541..05c1160e498545005e44e40f08e595ad7c17ed84 100644 (file)
@@ -273,8 +273,7 @@ class appgroup extends plugin
        plugin::execute();
 
     if((isset($_GET['act']))&&($_GET['act']=="depopen")){
-      print $_GET['id'];
-      $dep = base64_decode($_GET['id']);  
+      $dep = base64_decode($_GET['depid']);  
       if(isset($this->config->idepartments[$dep])){
         $this->curbase =$dep;
       }
@@ -330,27 +329,40 @@ class appgroup extends plugin
 
 
     $this->reload();
+    $only_once = false;
     foreach($_POST as $name => $value){
       
-      if(preg_match("/AddSep_/",$name)){
-        $this->AddSeperator($value);
+      if((preg_match("/AddSep_/",$name))&&(!$only_once)){
+        $only_once = true;
+        $n = preg_replace("/AddSep_/","",$name);
+        $val= preg_replace("/_.*$/","",$n);
+        $this->AddSeperator($val);
       }
-    
 
-      if(preg_match("/DelApp_/",$name)){
-        $app = $value; 
+      if((preg_match("/DelApp_/",$name))&&(!$only_once)){
+        $only_once = true;
+   
+
+        if(preg_match("/DelApp___SEPARATOR__/",$name)) {
+          $n=  preg_replace("/DelApp___SEPARATOR__/","",$name);
+          $val= "__SEPARATOR__".preg_replace("/_.*$/","",$n);
+        }else{
+          $n = preg_replace("/DelApp_/","",$name);
+          $val= preg_replace("/_.*$/","",$n);
+        }
+
         foreach($this->gosaMemberApplication as $key =>  $cat){
           foreach($cat as $key2 => $app){
-            if($app['App'] == $value){
+            if($app['App'] == $val){
               unset($this->gosaMemberApplication[$key][$key2]);
-              if(isset($this->used_apps[$value])){
-                unset($this->used_apps[$value]);
+              if(isset($this->used_apps[$val])){
+                unset($this->used_apps[$val]);
               }
             }
           }
         }
       }
-
+  
       if(preg_match("/DelCat_/",$name)){
         $n = preg_replace("/DelCat_/","",$name);
         $app = base64_decode( preg_replace("/_.*$/","",$n));
@@ -366,12 +378,16 @@ class appgroup extends plugin
         }
       }
       
-      if(preg_match("/EdiApp_/",$name)){
+      if((preg_match("/EdiApp_/",$name))&&(!$only_once)){
+
+        $only_once = true;
         $appname = $value;
+        $appname = preg_replace("/EdiApp_/","",$name);  
+        $appname = preg_replace("/_.*$/","",$appname);
         /* We've got the appname, get parameters from ldap */
         $ldap= $this->config->get_ldap_link();
         $ldap->cd($this->config->current['BASE']);
-        $ldap->search("(&(objectClass=gosaApplication)(cn=$appname))");
+        $ldap->search("(&(objectClass=gosaApplication)(cn=$appname))",array("gosaApplicationParameter"));
         if ($ldap->count() != 1){
           print_red (_("The selected application name is not uniq. Please check your LDAP."));
         } else {
@@ -556,7 +572,7 @@ class appgroup extends plugin
       for($i = 0 ; $i < ($cnt -1 ) ; $i++){
         $bbk .= $tmp[$i];
       }
-      $div2 ->AddEntry(array(array("string"=>sprintf($linkopen,$bbk,"..")),array("string"=>"&nbsp;","attach"=>"style='border-right:0px;'")));
+      $div2 ->AddEntry(array(array("string"=>sprintf($linkopen,base64_encode($bbk),"..")),array("string"=>"&nbsp;","attach"=>"style='border-right:0px;'")));
     }
 
     $this->GetSubdirs($this->curCatDir);
@@ -570,7 +586,7 @@ class appgroup extends plugin
 
     /* Append entries */
 
-    $separator ="<hr height=1  size=1></hr>"; 
+    $separator ="<hr size=1>"; 
 
     $sep = "<input type='image' src='images/back.png' title='"._("Insert seperator")."' value='%s' name='AddSep_%s'>";