diff --git a/plugins/personal/environment/class_hotplugDialog.inc b/plugins/personal/environment/class_hotplugDialog.inc
index fee4b846ec1583d512819c29d662e62c141492fe..22b11d98880c027770dc000a601b56d29f5678bf 100644 (file)
{
$this->use_existing = $use_existing;
plugin::plugin ($config, $dn);
+ $this->depselect = $this->config->current['BASE'];
}
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Fill templating stuff */
$smarty= get_smarty();
$display= "";
$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);
{
$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))){
+ 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.");