X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fpersonal%2Fenvironment%2Fclass_hotplugDialog.inc;h=22b11d98880c027770dc000a601b56d29f5678bf;hb=c4383d9f715594937f4cb58254d9844b78241c2b;hp=bf243fffd9f74cab7fd526c062b6d3ef988292c9;hpb=82ae8444cb5caff6a988f64d8c4ba09fc7c2c53e;p=gosa.git diff --git a/plugins/personal/environment/class_hotplugDialog.inc b/plugins/personal/environment/class_hotplugDialog.inc index bf243fffd..22b11d988 100644 --- a/plugins/personal/environment/class_hotplugDialog.inc +++ b/plugins/personal/environment/class_hotplugDialog.inc @@ -34,6 +34,9 @@ class hotplugDialog extends plugin function execute() { + /* Call parent execute */ + plugin::execute(); + /* Fill templating stuff */ $smarty= get_smarty(); $display= ""; @@ -64,8 +67,7 @@ class hotplugDialog extends plugin $smarty->assign("alphabet", generate_alphabet()); $smarty->assign("search_image", get_template_path('images/search.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); - $smarty->assign("infoimage", get_template_path('images/info.png')); - $smarty->assign("launchimage", get_template_path('images/launch.png')); + $smarty->assign("launchimage", get_template_path('images/small_filter.png')); $smarty->assign("deplist", $this->config->idepartments); @@ -105,15 +107,22 @@ 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."); } + + $ldap = $this->config->get_ldap_link(); + $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDevice=".$this->HOT_name."*))"); + if($ldap->count()){ + $message[]=_("An Entry with this name already exists."); + } + }else{ if((!isset($_POST['hotplugName']))||(empty($_POST['hotplugName']))){ $message[] = _("Please select an entry or press cancel.");