From: hickert Date: Wed, 31 Aug 2005 13:07:58 +0000 (+0000) Subject: Added base64_en/decode for hotplug ID X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e5ea3dd763dccf6e27304fcae9145f88fb666c1f;p=gosa.git Added base64_en/decode for hotplug ID git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1272 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 8dac38155..7c80034ec 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -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 */ diff --git a/plugins/personal/environment/class_hotplugDialog.inc b/plugins/personal/environment/class_hotplugDialog.inc index bf243fffd..1bc4ed264 100644 --- a/plugins/personal/environment/class_hotplugDialog.inc +++ b/plugins/personal/environment/class_hotplugDialog.inc @@ -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; }