diff --git a/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc b/gosa-plugins/dhcp/admin/systems/services/dhcp/class_servDHCP.inc
index 6fa4628cac0dfd3285a264af0b8367824adb5bf7..efca699cc797d6140cbb1a2b1d7aec2e448e167f 100644 (file)
$this->dialog->save_object();
$messages= $this->dialog->check();
if (count($messages)){
- show_errors($messages);
+ msg_dialog::displayChecks($messages);
} else {
$dn= $this->dialog->dn;
$class= get_class($this->dialog);
}
}
} else {
- msg_dialog::display(_("Permission error"), _("You have no permission to remove DHCP sections!"), ERROR_DIALOG);
+ msg_dialog::display(_("Permission error"), msgPool::permDelete(), ERROR_DIALOG);
}
$this->dialog= FALSE;
}
if (isset($this->dhcpObjectCache[$dn])){
$this->current_object= $dn;
$this->dialog= 1;
- $smarty->assign("warning", sprintf(_("You're about to delete the DHCP section '%s'."), $dn));
+ $smarty->assign("warning", msgPool::deleteInfo(@LDAP::fix($dn),_("DHCP section")));
return($smarty->fetch(get_template_path('remove_dhcp.tpl', TRUE, dirname(__FILE__))));
}
}
/* Show tab dialog headers */
if ($this->is_account){
-# $display= $this->show_header(_("Remove DHCP service"),
-# _("This server has DHCP features enabled. You can disable them by clicking below."));
-
if (!count($this->dhcpObjectCache)){
$attrs= array();
$attrs['dn']= 'cn=dhcp,'.$this->dn;
}
} else {
-# $display= $this->show_header(_("Add DHCP service"),
-
-# _("This server has DHCP features disabled. You can enable them by clicking below."));
return ($display);
}
foreach ($this->dhcpObjectCache as $dn => $content){
if ($this->objectType($dn) == 'dhcpService'){
$ldap->rmdir_recursive($dn);
- show_ldap_error($ldap->get_error(), _("Removing DHCP entries failed"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_DEL, get_class()));
+ }
}
}
$this->cleanup();
$ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error(), _("Removing DHCP entries failed"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events("remove");
/* Check if exists, then remove... */
if($ldap->cat($dn)){
$ldap->rmdir_recursive($dn);
- show_ldap_error($ldap->get_error(), _("Can't remove DHCP object!"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class()));
+ }
}
continue;
}
$ldap->cd($dn);
if ($modify){
$ldap->modify($attrs);
- show_ldap_error($ldap->get_error(), _("Can't save DHCP object!"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_MOD, get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events("modify");
} else {
$ldap->add($attrs);
- show_ldap_error($ldap->get_error(), _("Can't save DHCP object!"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $dn, LDAP_ADD, get_class()));
+ }
/* Optionally execute a command after we're done */
$this->handle_post_events("create");
$this->cleanup();
$ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error(), _("Saving DHCP service failed"));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));
+ }
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){