From: hickert Date: Fri, 9 Sep 2005 04:49:58 +0000 (+0000) Subject: Added base64 encoding decoding X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d4e72b16d3bf1ca72e5ac9526fd61aa1311b2989;p=gosa.git Added base64 encoding decoding git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1334 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/FAI/askClassName.tpl b/plugins/admin/FAI/askClassName.tpl index 38317185b..db55ed11e 100644 --- a/plugins/admin/FAI/askClassName.tpl +++ b/plugins/admin/FAI/askClassName.tpl @@ -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}

- {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}

diff --git a/plugins/admin/FAI/class_faiHook.inc b/plugins/admin/FAI/class_faiHook.inc index e3355cda0..662f837e1 100644 --- a/plugins/admin/FAI/class_faiHook.inc +++ b/plugins/admin/FAI/class_faiHook.inc @@ -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; diff --git a/plugins/admin/FAI/class_faiHookEntry.inc b/plugins/admin/FAI/class_faiHookEntry.inc index 06fe4024e..56da7fa9d 100644 --- a/plugins/admin/FAI/class_faiHookEntry.inc +++ b/plugins/admin/FAI/class_faiHookEntry.inc @@ -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."); } diff --git a/plugins/admin/FAI/class_faiScript.inc b/plugins/admin/FAI/class_faiScript.inc index f0e0ac5b0..f81b0d4c3 100644 --- a/plugins/admin/FAI/class_faiScript.inc +++ b/plugins/admin/FAI/class_faiScript.inc @@ -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"){ diff --git a/plugins/admin/FAI/class_faiScriptEntry.inc b/plugins/admin/FAI/class_faiScriptEntry.inc index 308b8c5c3..3ffc67a7d 100644 --- a/plugins/admin/FAI/class_faiScriptEntry.inc +++ b/plugins/admin/FAI/class_faiScriptEntry.inc @@ -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); } } diff --git a/plugins/admin/FAI/class_faiTemplate.inc b/plugins/admin/FAI/class_faiTemplate.inc index 1ddd0120a..d2fbbeebd 100644 --- a/plugins/admin/FAI/class_faiTemplate.inc +++ b/plugins/admin/FAI/class_faiTemplate.inc @@ -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"){ diff --git a/plugins/admin/FAI/class_faiTemplateEntry.inc b/plugins/admin/FAI/class_faiTemplateEntry.inc index 0aa307335..2ba9a9bc4 100644 --- a/plugins/admin/FAI/class_faiTemplateEntry.inc +++ b/plugins/admin/FAI/class_faiTemplateEntry.inc @@ -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); } } diff --git a/plugins/admin/FAI/class_faiVariable.inc b/plugins/admin/FAI/class_faiVariable.inc index 08b839c01..59edea52d 100644 --- a/plugins/admin/FAI/class_faiVariable.inc +++ b/plugins/admin/FAI/class_faiVariable.inc @@ -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"){ diff --git a/plugins/admin/FAI/class_faiVariableEntry.inc b/plugins/admin/FAI/class_faiVariableEntry.inc index 6277645f5..3db0d40c7 100644 --- a/plugins/admin/FAI/class_faiVariableEntry.inc +++ b/plugins/admin/FAI/class_faiVariableEntry.inc @@ -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."); } diff --git a/plugins/admin/FAI/faiTemplateEntry.tpl b/plugins/admin/FAI/faiTemplateEntry.tpl index fdf0b8219..44c3bf8cd 100644 --- a/plugins/admin/FAI/faiTemplateEntry.tpl +++ b/plugins/admin/FAI/faiTemplateEntry.tpl @@ -48,26 +48,6 @@ - - - - - - - -
- - - -
- - - -
diff --git a/plugins/admin/FAI/headpage.tpl b/plugins/admin/FAI/headpage.tpl index c0c60cf21..501298024 100644 --- a/plugins/admin/FAI/headpage.tpl +++ b/plugins/admin/FAI/headpage.tpl @@ -21,7 +21,7 @@

- {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}