Code

Added base64 encoding decoding
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 04:49:58 +0000 (04:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 04:49:58 +0000 (04:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1334 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/FAI/askClassName.tpl
plugins/admin/FAI/class_faiHook.inc
plugins/admin/FAI/class_faiHookEntry.inc
plugins/admin/FAI/class_faiScript.inc
plugins/admin/FAI/class_faiScriptEntry.inc
plugins/admin/FAI/class_faiTemplate.inc
plugins/admin/FAI/class_faiTemplateEntry.inc
plugins/admin/FAI/class_faiVariable.inc
plugins/admin/FAI/class_faiVariableEntry.inc
plugins/admin/FAI/faiTemplateEntry.tpl
plugins/admin/FAI/headpage.tpl

index 38317185b2fb4154d53ce8889b0abbf6f5997e8d..db55ed11e599fda7af349d072918323d9a624ebb 100644 (file)
@@ -8,7 +8,7 @@
           If you use this class name in a profile, all object with this class name will be included to this profile.{/t}
        <br>
        <br>
-       {t}The list box below shows all available class names you can use, for this object, to avoid duplicates.{/t}
+       {t}The list box below shows all available class names you may use, for this object, to avoid duplicates.{/t}
 <br>
 <br>
 <table >
index e3355cda0152ad249e691252a860e571aad08d13..662f837e13979399a396bf403aff1d6d8eea1f52 100644 (file)
@@ -25,6 +25,7 @@ class faiHook extends plugin
 
   /* Attributes to initialise for each subObject */
   var $subAttributes    = array("cn","description","FAItask","FAIscript"); 
+  var $sub64coded       = array("FAItask","FAIscript");
 
   /* Specific attributes */
   var $cn               = "";       // The class name for this object
@@ -64,6 +65,11 @@ class faiHook extends plugin
       
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
+
+        foreach($this->sub64coded as $codeIt){
+          $this->SubObjects[$object['cn'][0]][$codeIt]=base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
+        }
+
       }
     }
   }
@@ -235,6 +241,11 @@ class faiHook extends plugin
     }
 
     foreach($Objects as $name => $obj){
+
+      foreach($this->sub64coded as $codeIt){
+        $obj[$codeIt]=base64_encode($obj[$codeIt]);
+      }
+
       $tmp = array();
       foreach($this->subAttributes as $attrs){
         if(empty($obj[$attrs])){
@@ -242,7 +253,7 @@ class faiHook extends plugin
         }
         $tmp[$attrs] = $obj[$attrs];
       }    
-        
+
       $tmp['objectClass'] = $this->subClasses;
       
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
index 06fe4024e857f5fc4b15c8baf3ad447695a82c7b..56da7fa9d5b707a54a7a2a8c8a907f6863e34ed5 100644 (file)
@@ -94,7 +94,7 @@ class faiHookEntry extends plugin
       $message[] = _("Please enter a name.");
     }
 
-    if(preg_match("/[^0-9a-z]/",$this->Object_cn)){
+    if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
       $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
     }
   
index f0e0ac5b048db9327fad69347c542068abbd9660..f81b0d4c378b748ea45fcdc32b8cc16208c3b008 100644 (file)
@@ -25,6 +25,7 @@ class faiScript extends plugin
 
   /* Attributes to initialise for each subObject */
   var $subAttributes    = array("cn","description","FAIpriority","FAIscript"); 
+  var $sub64coded       = array("FAIscript");
 
   /* Specific attributes */
   var $cn               = "";       // The class name for this object
@@ -61,7 +62,11 @@ class faiScript extends plugin
             $this->SubObjects[$object['cn'][0]][$attrs]=$object[$attrs][0];
           }
         }
-      
+     
+        foreach($this->sub64coded as $codeIt){
+          $this->SubObjects[$object['cn'][0]][$codeIt]=base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
+        }
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
@@ -235,6 +240,11 @@ class faiScript extends plugin
     }
 
     foreach($Objects as $name => $obj){
+
+      foreach($this->sub64coded as $codeIt){
+        $obj[$codeIt]=base64_encode($obj[$codeIt]);
+      }
+
       $tmp = array();
       foreach($this->subAttributes as $attrs){
         if(empty($obj[$attrs])){
@@ -244,7 +254,7 @@ class faiScript extends plugin
       }    
         
       $tmp['objectClass'] = $this->subClasses;
-      
+
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
  
       if($obj['status'] == "delete"){
index 308b8c5c389071232d6446aeda694e9522f2237a..3ffc67a7d1c0b727d71d26efa046fdc77b4b07b1 100644 (file)
@@ -92,7 +92,7 @@ class faiScriptEntry extends plugin
       $message[] = _("Please enter a name.");
     }
 
-    if(preg_match("/[^0-9a-z]/",$this->Object_cn)){
+    if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
       $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
     }
  
@@ -113,7 +113,7 @@ class faiScriptEntry extends plugin
     }
   
     $tmp['dn']      = $this->dn;  
-    $tmp['status']  = $this->Object_status;  
+    $tmp['status']  = $this->Object_status; 
     return($tmp);
   }
 }
index 1ddd0120acc93ef25394f7874b251b8e57dddc90..d2fbbeebd19fe0abeba66b76a9b1b12b3e2734a6 100644 (file)
@@ -24,7 +24,8 @@ class faiTemplate extends plugin
   var $subClassName     = "faiTemplateEntry";      
 
   /* Attributes to initialise for each subObject */
-  var $subAttributes    = array("cn","description","FAItemplateFile","FAItemplatePath","FAIowner"); 
+  var $subAttributes    = array("cn","description","FAItemplateFile","FAItemplatePath"); 
+  var $sub64coded       = array("FAItemplateFile","FAItemplatePath");
 
   /* Specific attributes */
   var $cn               = "";       // The class name for this object
@@ -61,7 +62,11 @@ class faiTemplate extends plugin
             $this->SubObjects[$object['cn'][0]][$attrs]=$object[$attrs][0];
           }
         }
-      
+
+        foreach($this->sub64coded as $codeIt){
+          $this->SubObjects[$object['cn'][0]][$codeIt]=base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
+        }       
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
@@ -235,6 +240,9 @@ class faiTemplate extends plugin
     }
 
     foreach($Objects as $name => $obj){
+      foreach($this->sub64coded as $codeIt){
+        $obj[$codeIt]=base64_encode($obj[$codeIt]);
+      }
       $tmp = array();
       foreach($this->subAttributes as $attrs){
         if(empty($obj[$attrs])){
@@ -244,7 +252,7 @@ class faiTemplate extends plugin
       }    
         
       $tmp['objectClass'] = $this->subClasses;
-      
+
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
 
       if($obj['status'] == "delete"){
index 0aa30733568ed813cdb15a8638f76b74224306c8..2ba9a9bc4a1a71c28f3d305ee9b38079c0d6edb5 100644 (file)
@@ -9,7 +9,7 @@ class faiTemplateEntry extends plugin
 
   /* attribute list for save action */
   var $ignore_account= TRUE;
-  var $attributes   = array("Object_cn","Object_description","Object_FAItemplateFile","Object_FAItemplatePath","Object_FAIowner","Object_FAImode");
+  var $attributes   = array("Object_cn","Object_description","Object_FAItemplateFile","Object_FAItemplatePath");
   var $objectclasses= array();
 
   var $orig_cn              = "";
@@ -18,8 +18,6 @@ class faiTemplateEntry extends plugin
   var $Object_cn            = "";
   var $Object_FAItemplateFile   = "";
   var $Object_FAItemplatePath   = "";
-  var $Object_FAIowner     = "";
-  var $Object_FAImode    = "";
   var $Object_description   = "";
   var $Object_status        = "new";
   
@@ -97,7 +95,7 @@ class faiTemplateEntry extends plugin
       $message[] = _("Please enter a name.");
     }
 
-    if(preg_match("/[^0-9a-z]/",$this->Object_cn)){
+    if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
       $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
     }
     return ($message);
@@ -118,6 +116,7 @@ class faiTemplateEntry extends plugin
   
     $tmp['dn']      = $this->dn;  
     $tmp['status']  = $this->Object_status;  
+
     return($tmp);
   }
 }
index 08b839c01fe4c2e7ddf481f477d0edf5566360a1..59edea52dac50199aa81e37492eb577a06c092aa 100644 (file)
@@ -25,6 +25,7 @@ class faiVariable extends plugin
 
   /* Attributes to initialise for each subObject */
   var $subAttributes    = array("cn","description","FAIvariableContent"); 
+  var $sub64coded       = array("FAIvariableContent");  
 
   /* Specific attributes */
   var $cn               = "";       // The class name for this object
@@ -61,7 +62,11 @@ class faiVariable extends plugin
             $this->SubObjects[$object['cn'][0]][$attrs]=$object[$attrs][0];
           }
         }
-      
+     
+        foreach($this->sub64coded as $codeIt){
+          $this->SubObjects[$object['cn'][0]][$codeIt]=base64_decode($this->SubObjects[$object['cn'][0]][$codeIt]);
+        }
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
@@ -235,6 +240,11 @@ class faiVariable extends plugin
     }
 
     foreach($Objects as $name => $obj){
+
+      foreach($this->sub64coded as $codeIt){
+        $obj[$codeIt]=base64_encode($obj[$codeIt]);
+      }
+
       $tmp = array();
       foreach($this->subAttributes as $attrs){
         if(empty($obj[$attrs])){
@@ -244,7 +254,7 @@ class faiVariable extends plugin
       }    
         
       $tmp['objectClass'] = $this->subClasses;
-      
+
       $sub_dn = "cn=".$obj['cn'].",".$this->dn;
  
       if($obj['status'] == "delete"){
index 6277645f52f844e4ad06ef178b148161893bd453..3db0d40c766667ec28baf9805e990c2245918625 100644 (file)
@@ -89,7 +89,7 @@ class faiVariableEntry extends plugin
       $message[] = _("Please enter a name.");
     }
 
-    if(preg_match("/[^0-9a-z]/",$this->Object_cn)){
+    if(preg_match("/[^0-9a-z]/i",$this->Object_cn)){
       $message[] = _("Please enter a valid name. Only a-Z 0-9 are allowed.");
     }
  
index fdf0b8219dba936d0c48ff57d801263c49104c60..44c3bf8cdec23d8f9dd4628aae78152fe6e6b3f7 100644 (file)
                                                        <input type="text" name="Object_FAItemplateFile" value="{$Object_FAItemplateFile}" id="Object_FAItemplateFile">
                                                </td>
                                        </tr>
-                                       <tr>
-                                               <td>
-                                                       <LABEL for="Object_FAItemplateEntry">
-                                                       {t}Owner{/t}
-                                                       </LABEL>
-                                               </td>
-                                               <td>
-                                                       <input type="text" name="Object_FAItemplateEntry" value="{$Object_FAIowner}" id="Object_FAIowner">
-                                               </td>
-                                       </tr>
-                                       <tr>
-                                               <td>
-                                                       <LABEL for="Object_FAImode">
-                                                       {t}Mode{/t}
-                                                       </LABEL>
-                                               </td>
-                                               <td>
-                                                       <input type="text" name="Object_FAItemplateEntry" value="{$Object_FAImode}" id="Object_FAImode">
-                                               </td>
-                                       </tr>
                                </table>
                </td>
        </tr>
index c0c60cf21343606bd44bf3214711ffdc2d8aa758..50129802428456592c11d920392c6378a321a67b 100644 (file)
@@ -21,7 +21,7 @@
    </div>
    <div class="contentboxb">
    <p class="contentboxb">
-     {t}This menu allows you to create, delete and edit selected FAI obejcts. Having a large size of objects, you might prefer the range selectors on top of this list.{/t}
+     {t}This menu allows you to create, delete and edit selected FAI objects.{/t}
    </p>
    </div>
    <br>