diff --git a/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc b/gosa-plugins/gofax/gofax/blocklists/class_blocklistGeneric.inc
index a6dab5936b691482150028ed75936fceb4c387e9..cb54b7b233945b07caea5a097b12212c08fca4a7 100644 (file)
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);
}
}
$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");
}
/* 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"));
}
}
}
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()));
+ }
}