Code

Fixed goExportEntry management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 May 2006 06:08:46 +0000 (06:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 May 2006 06:08:46 +0000 (06:08 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3274 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_servService.inc
plugins/admin/systems/servservice.tpl

index c6d31ed68e29426251506d7e2f82fbac1f0e212a..4c18c49e2952122ad3393d32982ff1af5ac1a320 100644 (file)
@@ -8,6 +8,7 @@ class servservice extends plugin
   var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
 
   var $goExportEntry    = array();
+  var $goExportEntryList= array();
   var $goTimeSource     = array();
   var $goLdapBase       = "";
   var $goXdmcpIsEnabled = "";
@@ -69,18 +70,17 @@ class servservice extends plugin
       $this->$name= $tmp;
     }
 
-
     $tmp =array();
     $tmp2=array();
     if(isset($this->attrs['goExportEntry'])){
       if(isset($this->attrs['goExportEntry']['count'])){
         for($i= 0; $i<$this->attrs['goExportEntry']['count']; $i++){
           $entry= $this->attrs['goExportEntry'][$i];
-          $tmp[preg_replace('/|.*$/', '', $entry)]= $entry;
+          $tmp[preg_replace('/\|.*$/', '', $entry)]= $entry;
         }
       }
     }
-    $this->goExportEntry = $tmp;
+    $this->goExportEntryList = $tmp;
 
     /* Always is account... */
     $this->is_account= TRUE;
@@ -95,11 +95,11 @@ class servservice extends plugin
 
   function addToList($entry){
     $key =  key($entry);
-    $this->goExportEntry[$key]=$entry[$key];
+    $this->goExportEntryList[$key]=$entry[$key];
   }
 
   function deleteFromList($id){
-    unset($this->goExportEntry[$id]);
+    unset($this->goExportEntryList[$id]);
   }
   
   function addToMountList($entry) {
@@ -128,11 +128,15 @@ class servservice extends plugin
     $smarty= get_smarty();
     $smarty->assign("staticAddress", "");
 
-    if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntry']))){
+    if((isset($_POST['DelNfsEnt']))&&(isset($_POST['goExportEntryList']))){
       if($this->allow_mounts){
-        $this->deleteFromMountList($this->goExportEntry[$_POST['goExportEntry']]);
+        foreach($_POST['goExportEntryList'] as $entry){
+          $this->deleteFromMountList($this->goExportEntryList[$entry]);
+        }
+      }
+      foreach($_POST['goExportEntryList'] as $entry){
+        $this->deleteFromList($entry);
       }
-      $this->deleteFromList($_POST['goExportEntry']);
     }
 
     if(isset($_POST['NewNfsAdd'])){
@@ -141,8 +145,8 @@ class servservice extends plugin
       $this->dialog = true;
     }
 
-    if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntry']))){
-      $entry = $this->goExportEntry[$_POST['goExportEntry'][0]];
+    if((isset($_POST['NewNfsEdit']))&&(isset($_POST['goExportEntryList']))){
+      $entry = $this->goExportEntryList[$_POST['goExportEntryList'][0]];
       $add_mount=isset($this->mounts_to_add[$entry]);
       $this->oldone=$entry;
       $this->o_subWindow = new servnfs($this->config,$this->acl,$this->allow_mounts,$this->dn,$entry,$add_mount);
@@ -211,8 +215,8 @@ class servservice extends plugin
     }
     
     $tellSmarty=array();
-    ksort($this->goExportEntry);
-    foreach($this->goExportEntry as $name=>$values){
+    ksort($this->goExportEntryList);
+    foreach($this->goExportEntryList as $name=>$values){
        $tmp = split("\|",$values);
        $tellSmarty[$name] = $tmp[0]." ".$tmp[4]." (".$tmp[2].")";
     }
@@ -345,10 +349,10 @@ class servservice extends plugin
     $this->attrs['objectClass']= $tmp;
 
     /* Arrays */
-    foreach (array("goTimeSource", "goExportEntry") as $name){
-      $this->attrs[$name]= array();
-      foreach ($this->$name as $element){
-        $this->attrs[$name][]= $element;
+    foreach (array("goTimeSource"=>"goTimeSource", "goExportEntryList"=>"goExportEntry") as $source => $destination){
+      $this->attrs[$destination]= array();
+      foreach ($this->$source as $element){
+        $this->attrs[$destination][]= $element;
       }
     }
     
index 46ca099d7b43d535d8cfe11faefaaed54e23c7d8..f865aad27644edb3415d5431fcdaa7e25cc82aab 100644 (file)
@@ -12,7 +12,7 @@
    <table summary="" style="width:100%">
     <tr>
      <td>
-               <select style="width:100%" id="goExportEntry" name="goExportEntry[]" {$goExportEntryACL} {$goShareServerState} size=12 multiple >
+               <select style="width:100%" id="goExportEntry" name="goExportEntryList[]" {$goExportEntryACL} {$goShareServerState} size=12 multiple >
                {html_options values=$goExportEntry output=$goExportEntryKeys}
                        <option disabled>&nbsp;</option>
            </select>