X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-plugins%2Fgofax%2Fgofax%2Fblocklists%2Fclass_blocklistGeneric.inc;h=cb54b7b233945b07caea5a097b12212c08fca4a7;hb=7ca02f50d0259e15d6b66e600c2fc1b2f7622c8a;hp=a6dab5936b691482150028ed75936fceb4c387e9;hpb=6eea4c9b2887f641ec7591f17d3396876fb227d3;p=gosa.git diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc index a6dab5936..cb54b7b23 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc @@ -119,7 +119,7 @@ class blocklistGeneric extends plugin if (tests::is_phone_nr($_POST['number']) || preg_match ("/^[\/0-9 ()\^\.\$+*-]+$/",$_POST['number'])){ $this->addNumber ($_POST['number']); } else { - print_red (_("Please specify a valid phone number.")); + msg_dialog::display(_("Error"), msgPool::invalid(_("Phone number")), ERROR_DIALOG); } } @@ -189,7 +189,9 @@ class blocklistGeneric extends plugin $ldap= $this->config->get_ldap_link(); $ldap->rmDir($this->dn); new log("remove","gofaxlist/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); - show_ldap_error($ldap->get_error(), sprintf(_("Removing of blocklist with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } $this->handle_post_events("remove"); } @@ -202,17 +204,17 @@ class blocklistGeneric extends plugin /* check syntax: must cn */ if ($this->cn == ""){ - $message[]= _("Required field 'Name' is not set."); + $message[]= msgPool::required(_("Name")); } else { if (!tests::is_uid($this->cn)){ - $message[]= _("Required field 'Name' contains invalid characters"); + $message[]= msgPool::invalid(_("Name")); } if ($this->dn == 'new'){ $ldap= $this->config->get_ldap_link(); $ldap->cd (get_ou('blocklistou').$this->config->current["BASE"]); $ldap->search ("(&(|(objectClass=goFaxSBlock)(objectClass=goFaxRBlock))(cn=".$this->cn."))", array("cn")); if ($ldap->count() != 0){ - $message[]= _("Specified name is already used."); + $message[]= msgPool::duplicated(_("Name")); } } } @@ -260,7 +262,9 @@ class blocklistGeneric extends plugin new log("create","gofaxlist/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error()); $this->handle_post_events("add"); } - show_ldap_error($ldap->get_error(), sprintf(_("Saving of blocklist with dn '%s' failed."),$this->dn)); + if (!$ldap->success()){ + msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class())); + } }