summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a2a7f9e)
raw | patch | inline | side by side (parent: a2a7f9e)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 9 Jan 2008 17:29:08 +0000 (17:29 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 9 Jan 2008 17:29:08 +0000 (17:29 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8276 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/sieve/class_My_Tree.inc | patch | blob | history | |
gosa-core/include/sieve/class_sieveManagement.inc | patch | blob | history |
index 0011d581fce4f33b659f84f3d992441b1f010849..b1b061e39a95a707d5c508b9a39f55e2fa9bb9e5 100644 (file)
function remove_object($key_id)
{
if(count($this->pap) == 1){
- print_red(_("Can't remove last element."));
+ msg_dialog::display(_("Warning"), _("Cannot remove last element!"), ERROR_DIALOG);
return;
}
if(count($objs) && $last_found_at != -1){
$str = _("Require must be the first command in the script.");
$msgs[] = $str;
- print_red($str);;
+ msg_dialog::display(_("Error"), $str, ERROR_DIALOG);
}
foreach($this->pap as $obj){
diff --git a/gosa-core/include/sieve/class_sieveManagement.inc b/gosa-core/include/sieve/class_sieveManagement.inc
index f7eb611f3bef46d556d8354a14a45d86f3c0fcf2..417853e4b60345408c01270f19c458672b46d1af 100644 (file)
if(isset($_POST['create_script_save'])){
if(!strlen($name)){
$err =true;
- print_red(_("You should specify a name for your new script."));
+ msg_dialog::display(_("Error"), _("No script name specified!"), ERROR_DIALOG);
}
/* Is given name in lower case characters ? */
if($name != strtolower($name)){
$err =true;
- print_red(_("Only lower case names are allowed."));
+ msg_dialog::display(_("Error"), _("Please use only lowercase script names!"), ERROR_DIALOG);
}
/* Only chars are allowed here */
if(preg_match("/[^a-z]/i",$name)){
$err =true;
- print_red(_("Only alphabetical characters are allowed in script names."));
+ msg_dialog::display(_("Error"), _("Please use only alphabetical characters in script names!"), ERROR_DIALOG);
}
$tmp = $this->get_used_script_names();
if(in_array_ics($name,$tmp)){
$err =true;
- print_red(_("The specified name is already in use."));
+ msg_dialog::display(_("Error"), _("Script name already in use!"), ERROR_DIALOG);
}
}
/* Get sieve */
if(!$this->sieve_handle = $this->get_sieve()){
- print_red(
- sprintf(
- _("Can't log into SIEVE server. Server says '%s'."),
- to_string($this->Sieve_Error)));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot log into SIEVE server: %s"), '<br><br><i>'.to_string($this->Sieve_Error).'</i>'), ERROR_DIALOG);
}
/* Try to activate the given script and update
* class script array.
*/
if(!$this->sieve_handle->sieve_setactivescript($this->scripts[$script]['NAME'])){
- print_red(sprintf(_("Can't activate sieve script on server. Server says '%s'."),to_string($this->sieve_handle->error_raw)));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot retrieve SIEVE script: %s"), '<br><br><i>'.to_string($this->sieve_handler->error_raw).'</i>'), ERROR_DIALOG);
}else{
foreach($this->scripts as $key => $data){
if($key == $script){
/* Get sieve */
if(!$this->sieve_handle = $this->get_sieve()){
- print_red(
- sprintf(
- _("Can't log into SIEVE server. Server says '%s'."),
- to_string($this->Sieve_Error)));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot log into SIEVE server: %s"), '<br><br><i>'.to_string($this->Sieve_Error).'</i>'), ERROR_DIALOG);
}
if(!$this->sieve_handle->sieve_deletescript($this->scripts[$this->script_to_delete]['NAME'])){
- print_red(sprintf(_("Can't remove sieve script from server. Server says '%s'."),to_string($this->sieve_handle->error_raw)));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot remove SIEVE script: %s"), '<br><br><i>'.to_string($this->sieve_handler->error_raw).'</i>'), ERROR_DIALOG);
}else{
unset($this->scripts[$this->script_to_delete]);
}
$this->scripts[$this->current_script]['MSG'] = _("Edited");
$this->current_handler = NULL;
}else{
- print_red($p->status_text);;
+ msg_dialog::display(_("SIEVE error"), $p->status_text, ERROR_DIALOG);
}
}else{
foreach($chk as $msgs){
- print_red(sprintf(_("Please fix all errors before saving. Last error was: %s"),$msgs));
+ msg_dialog::display(_("SIEVE error"), $msgs, ERROR_DIALOG);
}
}
}
$file = $_FILES['Script_To_Import'];
if($file['size'] == 0){
- print_red(_("Specified file seems to be empty."));
+ msg_dialog::display(_("Error"), _("Uploaded script is empty!"), ERROR_DIALOG);
}elseif(!file_exists($file['tmp_name'])){
- print_red(_("Upload failed. The temporary file can't be accessed."));
+ msg_dialog::display(_("Internal error"), sprintf(_("Cannot access temporary file '%s'!"), $file['tmp_name']), ERROR_DIALOG);
}elseif(!is_readable ($file['tmp_name'])){
- print_red(sprintf(_("Can't open file '%s'."),$file['tmp_name']));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot open temporary file '%s'!"), $file['tmp_name']), ERROR_DIALOG);
}else{
if($this->add_new_element_to_current_script($this->add_element_type,$this->add_new_id,$this->add_above_below)){
$this->add_new_element = FALSE;
}else{
- print_red(_("Failed to add new element."));
+ msg_dialog::display(_("SIEVE error"), _("Cannot add new element!") , ERROR_DIALOG);
}
}
}
}
if(!isset($element_types[$type])){
- print_red(sprintf(_("Can't add the specified element at the given position.")));
+ msg_dialog::display(_("SIEVE error"), _("Cannot insert element at the requested position!") , ERROR_DIALOG);
return;
}
{
/* Get sieve */
if(!$this->sieve_handle = $this->get_sieve()){
- print_red(
- sprintf(
- _("Can't log into SIEVE server. Server says '%s'."),
- to_string($this->Sieve_Error)));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot log into SIEVE server: %s"), '<br><br><i>'.to_string($this->Sieve_Error).'</i>'), ERROR_DIALOG);
return;
}
new log("modify","users/mailAccount".get_class($this),$script['NAME'],"Failed to save sieve script named '".$script['NAME']."': ".to_string($this->sieve_handle->error_raw));
$everything_went_fine = FALSE;
- print_red(to_string($this->sieve_handle->error_raw));
+ msg_dialog::display(_("SIEVE error"), sprintf(_("Cannot store SIEVE script: %s"), '<br><br><i>'.to_string($this->sieve_handle->error_raw).'</i>'), ERROR_DIALOG);
$this->scripts[$key]['MSG'] = "<font color='red'>".
_("Failed to save sieve script").": ".
to_string($this->sieve_handle->error_raw).