Code

Added base64_en/decode for hotplug ID
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Aug 2005 13:07:58 +0000 (13:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 Aug 2005 13:07:58 +0000 (13:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1272 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_hotplugDialog.inc

index 8dac38155451c77815df349b87826e2395a7863e..7c80034ecd1c0b78a4c4ae93375ef1de3559823c 100644 (file)
@@ -105,7 +105,7 @@ class environment extends plugin
         $tmp = split("\|",$device);
         $tmp2['name']        = $tmp[0]; 
         $tmp2['description'] = $tmp[1]; 
-        $tmp2['id']          = $tmp[2]
+        $tmp2['id']          = base64_decode($tmp[2])
         $this->gotoHotplugDevices[$tmp[0]]=$tmp2;
       }
     }
@@ -805,7 +805,7 @@ class environment extends plugin
     /* Prepare HotPlug devices */
     $this->attrs['gotoHotplugDevice'] = array();
     foreach($this->gotoHotplugDevices as $name => $device){
-      $this->attrs['gotoHotplugDevice'][] = $device['name']."|".$device['description']."|".$device['id'];
+      $this->attrs['gotoHotplugDevice'][] = $device['name']."|".$device['description']."|".base64_encode($device['id']);
     }
 
     /* Prepare LogonScripts */
index bf243fffd9f74cab7fd526c062b6d3ef988292c9..1bc4ed2642935d9cad16d7b1d943bc409c9213d8 100644 (file)
@@ -105,11 +105,11 @@ class hotplugDialog extends plugin
   {
     $message= array();
     if(!$this->use_existing){
-      if((empty($this->HOT_name))||(preg_match("/[^a-z0-9]/i",$this->HOT_name))){
-        $message[]=_("Please specify a valid name.");
+      if((empty($this->HOT_name))||(preg_match("/[^a-z0-9 ]/i",$this->HOT_name))){
+        $message[]=_("Please specify a valid name. Only 0-9 a-Z is allowed.");
       }
       if((empty($this->HOT_description))||(preg_match("/[^a-z0-9!\"?.,;:-_\(\) ]/i",$this->HOT_description))){
-        $message[]=_("Please specify a valid description.");
+        $message[]=_("Invalid character in description. Please specify a valid description.");
       }
       if((empty($this->HOT_id))||(preg_match("/[\|]/i",$this->HOT_id))){
         $message[]=_("Please specify a valid id.");
@@ -157,11 +157,11 @@ class hotplugDialog extends plugin
           $tmp = split("\|",$device);
           
           if(preg_match("/^".str_replace("*","",$this->regex).".*/i",$tmp[0])){
-            $a_return[$tmp[0]]= $tmp[0]." [".$tmp[1]."] ".$tmp[2];
+            $a_return[$tmp[0]]= $tmp[0]." [".$tmp[1]."] ".base64_decode($tmp[2]);
             
             $tmp2['name']         = $tmp[0];
             $tmp2['description'] = $tmp[1];
-            $tmp2['id']           = $tmp[2];
+            $tmp2['id']           = base64_decode($tmp[2]);
 
             $this->hotplugDeviceList[$tmp[0]]=$tmp2;
           }