index 90e87bf23b22bff02d4ee041dd397d54e346464c..bc8936b37e213b6fcf39e5f22e767be0ec88f527 100644 (file)
}
/* Check given name */
- $err = "";
+ $err = false;
/* Is given name in lower case characters ? */
if(isset($_POST['create_script_save'])){
if(!strlen($name)){
- $err = _("You should specify a name for your new script.");
+ $err =true;
+ print_red(_("You should specify a name for your new script."));
}
/* Is given name in lower case characters ? */
if($name != strtolower($name)){
- $err = _("Only lower case names are allowed here.");
+ $err =true;
+ print_red(_("Only lower case names are allowed here."));
}
/* Only chars are allowed here */
if(preg_match("/[^a-z]/i",$name)){
- $err = _("Only a-z are allowed in script names.");
+ $err =true;
+ print_red(_("Only a-z are allowed in script names."));
}
$tmp = $this->get_used_script_names();
if(in_array_ics($name,$tmp)){
- $err =_("The specified name is already in use.");
+ $err =true;
+ print_red(_("The specified name is already in use."));
}
}
/* Create script if everything is ok */
- if($this->create_script && isset($_POST['create_script_save']) && $err == "" ){
+ if($this->create_script && isset($_POST['create_script_save']) && !$err){
/* Close dialog */
$this->create_script = FALSE;
/* Display dialog to enter new script name */
$smarty = get_smarty();
$smarty->assign("NewScriptName",$name);
- $smarty->assign("Error",$err);
return($smarty->fetch(get_template_path("templates/create_script.tpl",TRUE,dirname(__FILE__))));
}
}
}
$field2 = array("string" => $script['NAME']);
$field3 = array("string" => $script['MSG']);
- $field4 = array("string" => _("Script length")." : ".strlen($script['SCRIPT']));
+ $field4 = array("string" => _("Script length").": ".strlen($script['SCRIPT']));
if($this->parent->acl_is_writeable("sieveManagement")){
$del = "<input type='image' name='delscript_".$key."' src='images/edittrash.png'
$field6 = array("string" => $activate."<input type='image' name='editscript_".$key."' src='images/edit.png'
title='"._("Edit script")."'>".$del,
"attach" => "style='border-right:0px; width:70px;'");
- $List ->AddEntry(array($field1,$field2,$field3,$field4,$field6));
+ $List->AddEntry(array($field1,$field2,$field3,$field4,$field6));
}
/* If the uattrib is empty (Attribute to use for authentification with sieve)