Code

update goShare
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Aug 2005 10:51:00 +0000 (10:51 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 23 Aug 2005 10:51:00 +0000 (10:51 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1207 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index bb85475f5f9fc6e2d6ac7a8a6b208b3aa9218774..78429e35b1957da9735565c9671e73126fa1e6c7 100644 (file)
@@ -9,26 +9,26 @@ class servnfs extends plugin
 
   /* attribute list for save action */
   var $ignore_account   = TRUE;
-  var $attributes       = array("NFSdescription","NFStype","NFScharset","NFSpath","NFSoption");
+  var $attributes       = array("description","type","charset","path","option");
   var $objectclasses    = array("whatever");
   var $is_account       = true;
 
-  var $NFSname          ="";  // Name of NFS 
-  var $NFSdescription   ="";  // description
-  var $NFStype          ="";  // Type NFS/Samba/NCP
-  var $NFScharset       ="";  // charset
-  var $NFStypes         =array();  // Array Types NFS/Samba/NCP
-  var $NFScharsets      =array();  // Array with charsets
-  var $NFSpath          ="";  // Path
-  var $NFSoption        ="";  // Options
+  var $name          ="";  // Name of  
+  var $description   ="";  // description
+  var $type          ="";  // Type FS/Samba/NCP
+  var $charset       ="";  // charset
+  var $types         =array();  // Array Types NFS/Samba/NCP
+  var $charsets      =array();  // Array with charsets
+  var $path          ="";  // Path
+  var $option        ="";  // Options
   var $is_edit           =false;
 
 
   function servnfs ($config, $dn= NULL,$entry = false)
   {
     plugin::plugin ($config, $dn);
-    $this->NFStypes   = array("NFS"=>"NFS","samba"=>"samba","NCP"=>"NCP");
-    $this->NFScharsets = array("UTF-8" => "UTF-8",
+    $this->types   = array("NFS"=>"NFS","samba"=>"samba","NCP"=>"NCP");
+    $this->charsets = array("UTF-8" => "UTF-8",
                         "ISO8859-1"=>"ISO8859-1 (Latin 1)",
                         "ISO8859-2"=>"ISO8859-2 (Latin 2)",
                         "ISO8859-3"=>"ISO8859-3 (Latin 3)",
@@ -37,15 +37,15 @@ class servnfs extends plugin
 
     if($entry){
       $tmp = split("\|",$entry);
-      $this->NFSname          = $tmp[0];  // Name of NFS
-      $this->NFSdescription   = $tmp[1];  // description
-      $this->NFStype          = $tmp[2];  // Type NFS/Samba/NCP
-      $this->NFScharset       = $tmp[3];  // charset
-      $this->NFSpath          = $tmp[4];  // Path
-      $this->NFSoption        = $tmp[5];  // Options
+      $this->name          = $tmp[0];  // Name of NFS
+      $this->description   = $tmp[1];  // description
+      $this->type          = $tmp[2];  // Type NFS/Samba/NCP
+      $this->charset       = $tmp[3];  // charset
+      $this->path          = $tmp[4];  // Path
+      $this->option        = $tmp[5];  // Options
       $this->is_edit          = true;
     }else{
-    $this->attributes[] = "NFSname";
+    $this->attributes[] = "name";
     }
   }
 
@@ -54,19 +54,19 @@ class servnfs extends plugin
     /* Fill templating stuff */
     $smarty= get_smarty();
 
-    $smarty->assign("NFScharsets" ,$this->NFScharsets);
-    $smarty->assign("NFStypes"    ,$this->NFStypes);
+    $smarty->assign("charsets" ,$this->charsets);
+    $smarty->assign("types"    ,$this->types);
 
     /* attrs to smarty*/
     foreach($this->attributes as $attr){
       $smarty->assign($attr,$this->$attr);
     }
     
-    $smarty->assign("NFSnameACL","");    
+    $smarty->assign("nameACL","");    
 
     if($this->is_edit){
-      $smarty->assign("NFSnameACL"," disabled ");
-      $smarty->assign("NFSname","");
+      $smarty->assign("nameACL"," disabled ");
+      $smarty->assign("name","");
     }
 
     $display= $smarty->fetch(get_template_path('servnfs.tpl', TRUE));
@@ -83,7 +83,7 @@ class servnfs extends plugin
   function save_object()
   {
     plugin::save_object(TRUE);
-    if(isset($_POST['NFSpath'])){
+    if(isset($_POST['path'])){
       foreach($this->attributes as $attr){
         $this->$attr = $_POST[$attr];
       }
@@ -97,16 +97,16 @@ class servnfs extends plugin
     $message= array();
 
     // fixme : a check for the path ?  ? 
-    if(empty($this->NFSpath)){
+    if(empty($this->path)){
       $message[]=_("Please specify a valid path for your setup.");
     }
   
     // only 0-9a-z
     if(!$this->is_edit){
-      if(preg_match("/[^a-z0-9]/i",$this->NFSname)){
+      if(preg_match("/[^a-z0-9]/i",$this->name)){
         $message[]=_("Please specify a valid name for your setup.");
       }
-      if(empty($this->NFSname)){
+      if(empty($this->name)){
         $message[]=_("Please specify a name for your setup.");
       }
     }
@@ -119,7 +119,7 @@ class servnfs extends plugin
         continue;
       foreach($test['goExportEntry'] as $entry){
         $tmp = split("\|",$entry);
-        if($tmp[0] == $this->NFSname){
+        if($tmp[0] == $this->name){
           $message[]="Name already in use";
         }
       }
@@ -137,14 +137,14 @@ class servnfs extends plugin
   
     $s_return = "";
     
-    $s_return.= $this->NFSname."|";     
-    $s_return.= $this->NFSdescription."|";     
-    $s_return.= $this->NFStype."|";     
-    $s_return.= $this->NFScharset."|";     
-    $s_return.= $this->NFSpath."|";     
-    $s_return.= $this->NFSoption;     
-
-    return(array($this->NFSname=>$s_return));
+    $s_return.= $this->name."|";     
+    $s_return.= $this->description."|";     
+    $s_return.= $this->type."|";     
+    $s_return.= $this->charset."|";     
+    $s_return.= $this->path."|";     
+    $s_return.= $this->option;     
+
+    return(array($this->name=>$s_return));
   }
 
 }
index 020f6d58d5b26eab772e6dce69362aab2269b948..2024df2847e569bb3b0947b61c9539c3ed8cc2cf 100644 (file)
@@ -268,15 +268,6 @@ class servservice extends plugin
     /* Reassign cleaned value */
     $this->attrs['objectClass']= $tmp;
 
-    /* Remove illegal attributes */
-    foreach ($this->additionaloc as $oc => $attrs){
-      if (!in_array($oc, $this->objectclasses)){
-        foreach ($attrs as $attr){
-          $this->attrs[$attr]= array();
-        }
-      }
-    }
-
     /* Arrays */
     foreach (array("goTimeSource", "goExportEntry") as $name){
       $this->attrs[$name]= array();
@@ -285,6 +276,14 @@ class servservice extends plugin
       }
     }
  
+    /* Remove illegal attributes */
+    foreach ($this->additionaloc as $oc => $attrs){
+      if (!in_array($oc, $this->objectclasses)){
+        foreach ($attrs as $attr){
+          $this->attrs[$attr]= array();
+        }
+      }
+    }
     $oc = array();
     foreach($this->attrs['objectClass'] as $name){
       if($name!="goNfsServer"){
index 687bfb48d0799063fcd4a99b8d10d5b88fad78c2..de2a8d4a019774e79b14c92fbfd9c050f8da7961 100644 (file)
@@ -9,7 +9,7 @@
                                                {t}Name{/t} {$must}
                                        </td>
                                        <td>
-                                               <input type="text" name="NFSname" value="{$NFSname}" {$NFSnameACL}>
+                                               <input type="text" name="name" value="{$name}" {$nameACL}>
                                        </td>
                                </tr>
                                <tr>
@@ -17,7 +17,7 @@
                                                {t}Description{/t}
                                        </td>
                                        <td>
-                                               <input type="text" name="NFSdescription" value="{$NFSdescription}">
+                                               <input type="text" name="description" value="{$description}">
                                        </td>
                                </tr>
                        </table>
@@ -31,8 +31,8 @@
                                                {t}Type{/t}
                                        </td>
                                        <td>
-                                               <select size="1" name="NFStype">
-                                                       {html_options options=$NFStypes selected=$NFStype}
+                                               <select size="1" name="type">
+                                                       {html_options options=$types selected=$type}
                                                </select>       
                                        </td>
                                </tr>
@@ -41,8 +41,8 @@
                                                {t}Charset{/t}
                                        </td>
                                        <td>
-                                               <select size="1" name="NFScharset">
-                                                       {html_options options=$NFScharsets selected=$NFScharset}
+                                               <select size="1" name="charset">
+                                                       {html_options options=$charsets selected=$charset}
                                                </select>       
                                        </td>
                                </tr>
@@ -63,7 +63,7 @@
                                                {t}Path{/t}
                                        </td>
                                        <td>
-                                               <input type="text" name="NFSpath" value="{$NFSpath}">
+                                               <input type="text" name="path" value="{$path}">
                                        </td>
                                </tr>
                        </table>
@@ -75,7 +75,7 @@
                         {t}Option{/t}
                     </td>
                     <td>
-                                               <input type="text" name="NFSoption" value="{$NFSoption}">
+                                               <input type="text" name="option" value="{$option}">
                     </td>
                 </tr>
             </table>
index 8cac0f4873f5bd1666612afd008f8d6b6319eb88..9877289a30779965755ba477a51e05ba95875f5b 100644 (file)
@@ -17,9 +17,9 @@
                        <option disabled>&nbsp;</option>
            </select>
        <br>    
-               <input type="submit"    value="{t}Edit{/t}"     name="NewNfsEdit" {$goShareServer} {$goExportEntryACL}  {$goShareServerState} id="NewNfsEditId"> 
-               <input type="submit"    value="{t}Add{/t}"              name="NewNfsAdd"  {$goShareServer} {$goExportEntryACL}  {$goShareServerState} id="NewNfsAddId"> 
-               <input type="submit"    value="{t}Delete{/t}"   name="DelNfsEnt"  {$goShareServer} {$goExportEntryACL}  {$goShareServerState} id="DelNfsEntId">
+               <input type="submit"    value="{t}Edit{/t}"     name="NewNfsEdit" {$goShareServer} {$goExportEntryACL}  id="NewNfsEditId"> 
+               <input type="submit"    value="{t}Add{/t}"              name="NewNfsAdd"  {$goShareServer} {$goExportEntryACL}  id="NewNfsAddId"> 
+               <input type="submit"    value="{t}Delete{/t}"   name="DelNfsEnt"  {$goShareServer} {$goExportEntryACL}  id="DelNfsEntId">
        </td>
        </tr>
    </table>