From 4fa1f57669fba229f872ea1eb76b266b31952f27 Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 10 Jan 2008 16:40:15 +0000 Subject: [PATCH] Removed print_red git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8301 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/mail/class_mailAccount.inc | 24 +++++++++---------- .../personal/posix/class_posixAccount.inc | 4 ++-- .../personal/samba/class_sambaAccount.inc | 4 ++-- .../personal/scalix/class_scalixAccount.inc | 6 ++--- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/gosa-core/plugins/personal/mail/class_mailAccount.inc b/gosa-core/plugins/personal/mail/class_mailAccount.inc index 1bdd4cefb..5a0356566 100644 --- a/gosa-core/plugins/personal/mail/class_mailAccount.inc +++ b/gosa-core/plugins/personal/mail/class_mailAccount.inc @@ -16,7 +16,6 @@ class mailAccount extends plugin var $plDescription = "This does something"; var $method = "mailMethod"; - /* CLI vars */ var $gosaVacationStart = 0; var $gosaVacationStop = 0; var $view_logged = FALSE; @@ -90,7 +89,7 @@ class mailAccount extends plugin if ($cls && class_exists($cls)){ $this->method= $cls; } else { - print_red(sprintf(_("There is no mail method '%s' specified in your gosa.conf available."), $method)); + msg_dialog::display(_("Configuration error"), sprintf(_("Unkown mail method '%s' specified!"), $method), ERROR_DIALOG); } } @@ -151,7 +150,6 @@ class mailAccount extends plugin }else{ $this->quotaUsage = ""; $this->gosaMailQuota = ""; -// print_red(sprintf(_("Can't get quota information for '%s'."),$this->folder_prefix.$this->$id)); } /* Get mailboxes / folder like INBOX ..*/ @@ -212,7 +210,7 @@ class mailAccount extends plugin $line= fgets($fh, 256); if (!preg_match('/^DESC:/', $line)){ - print_red (_("No DESC tag in vacation file:")." $file"); + msg_dialog::display(_("Configuration error"), sprintf(_("No DESC tag in vacation template '%s'!"), $file), ERROR_DIALOG); return $desc; } fclose ($fh); @@ -357,13 +355,13 @@ class mailAccount extends plugin if ($this->is_template){ $valid= TRUE; } else { - print_red (_("You're trying to add an invalid email address to the list of forwarders.")); + msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG); } } } elseif ($address == $this->mail || in_array($address, $this->gosaMailAlternateAddress)) { - print_red (_("Adding your one of your own addresses to the forwarders makes no sense.")); + msg_dialog::display(_("Error"),_("Cannot add your primary address to the list of forwarders.") , ERROR_DIALOG); } else { $valid= TRUE; @@ -393,12 +391,12 @@ class mailAccount extends plugin if (!tests::is_email($_POST['alternate_address'])){ if ($this->is_template){ if (!(tests::is_email($_POST['alternate_address'], TRUE))){ - print_red (_("You're trying to add an invalid email address to the list of alternate addresses.")); + msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG); } else { $valid= TRUE; } } else { - print_red (_("You're trying to add an invalid email address to the list of alternate addresses.")); + msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG); } } else { @@ -408,7 +406,7 @@ class mailAccount extends plugin if ($valid && ($user= $this->addAlternate ($_POST['alternate_address'])) != ""){ $ui= get_userinfo(); if ($user != $ui->username){ - print_red (_("The address you're trying to add is already used by user")." '$user'."); + msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user), ERROR_DIALOG); } } } @@ -1004,7 +1002,7 @@ class mailAccount extends plugin reset ($this->gosaMailForwardingAddress); $this->is_modified= TRUE; }else{ - print_red(_("You are not allowed to write mail forwarding.")); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); } } @@ -1016,7 +1014,7 @@ class mailAccount extends plugin $this->gosaMailForwardingAddress= array_remove_entries ($addresses, $this->gosaMailForwardingAddress); $this->is_modified= TRUE; }else{ - print_red(_("You are not allowed to write mail forwarding.")); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); } } @@ -1049,7 +1047,7 @@ class mailAccount extends plugin reset ($this->gosaMailAlternateAddress); return (""); }else{ - print_red(_("You are not allowed to write mail alternate address.")); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); } } @@ -1060,7 +1058,7 @@ class mailAccount extends plugin $this->gosaMailAlternateAddress= array_remove_entries ($addresses,$this->gosaMailAlternateAddress); $this->is_modified= TRUE; }else{ - print_red(_("You are not allowed to write mail alternate address.")); + msg_dialog::display(_("Permission error"), _("You have no permission to modify these addresses."), ERROR_DIALOG); } } diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 9b0aeccc6..b7593981f 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -800,7 +800,7 @@ class posixAccount extends plugin /* Oups - timed out */ if ($wait-- == 0){ - print_red (_("Failed: overriding lock")); + msg_dialog::display(_("Warning"), _("Timeout while waiting for lock! Ignoring lock."), WARNING_DIALOG); break; } } @@ -1275,7 +1275,7 @@ class posixAccount extends plugin /* Should not happen */ if ($id == $hwm){ - print_red(_("Too many users, can't allocate a free ID!")); + msg_dialog::display(_("Error"), _("Cannot allocate a free ID: too many users!"), ERROR_DIALOG); exit; } diff --git a/gosa-core/plugins/personal/samba/class_sambaAccount.inc b/gosa-core/plugins/personal/samba/class_sambaAccount.inc index fc93c9c76..598cf9a10 100644 --- a/gosa-core/plugins/personal/samba/class_sambaAccount.inc +++ b/gosa-core/plugins/personal/samba/class_sambaAccount.inc @@ -955,7 +955,7 @@ class sambaAccount extends plugin /* Generate rid / primaryGroupId */ if ($this->samba3){ if (!isset($this->config->data['SERVERS']['SAMBA'][$this->sambaDomainName]['SID'])){ - print_red (_("Warning: This account has an undefined samba SID assigned. The problem can not be fixed by GOsa!")); + msg_dialog::display(_("Warning"), _("Undefined Samba SID detected. Please fix this problem manually!"), WARNING_DIALOG); } else { $this->SID= $this->config->data['SERVERS']['SAMBA'][$this->sambaDomainName]['SID']; $this->ridBase= $this->config->data['SERVERS']['SAMBA'][$this->sambaDomainName]['RIDBASE']; @@ -979,7 +979,7 @@ class sambaAccount extends plugin $ldap->cd($this->config->current['BASE']); $ldap->search("(&(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))", array("cn")); if ($ldap->count() != 1){ - print_red(_("Warning: Can't identify users primary group - no conversion to a samba group possible!")); + msg_dialog::display(_("Warning"), _("Cannot convert primary group to samba group: group cannot be identified!"), WARNING_DIALOG); } else { $attrs= $ldap->fetch(); $g= new group($this->config, $ldap->getDN()); diff --git a/gosa-core/plugins/personal/scalix/class_scalixAccount.inc b/gosa-core/plugins/personal/scalix/class_scalixAccount.inc index 39b99f59a..96365949e 100644 --- a/gosa-core/plugins/personal/scalix/class_scalixAccount.inc +++ b/gosa-core/plugins/personal/scalix/class_scalixAccount.inc @@ -439,7 +439,7 @@ class scalixAccount extends plugin /* Valid mail address */ if( ($this->is_template && !tests::is_email($_POST['email_address'], TRUE)) || (!$this->is_template && !tests::is_email($_POST['email_address'])) ){ - print_red (_("You're trying to add an invalid email address to the list of alternate addresses.")); + msg_dialog::display(_("Error"), _("Cannot add invalid mail address!"), ERROR_DIALOG); }else{ $valid = TRUE; } @@ -448,7 +448,7 @@ class scalixAccount extends plugin if ($valid && ($user= $this->addEmail ($_POST['email_address'])) != ""){ $ui= get_userinfo(); if ($user != $ui->username){ - print_red (_("The address you're trying to add is already used by user")." '$user'."); + msg_dialog::display(_("Error"), sprintf(_("Cannot add mail address: it is already used by user '%s'."), $user), ERROR_DIALOG); } } # } @@ -505,5 +505,5 @@ class scalixAccount extends plugin } } -// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:rulere +// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler ?> -- 2.30.2