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 c804ec2bc17a013aa45265ac27f7c736ff4608be..efca699cc797d6140cbb1a2b1d7aec2e448e167f 100644 (file)
$this->dialog = FALSE;
$id = $this->take_over_id;
$smarty->assign("dns_take_over",TRUE);
- $warning = sprintf(_("You are going to migrate the DHCP setup from server '%s'."),
+ $warning = sprintf(_("You have requested a migration of the DHCP setup from server '%s' to the current one."),
$this->dhcp_server_list['ENTRIES'][$id]['cn'][0]);
- $warning.= " "._("The migration will be started when you save this system. To cancel this action, use the cancel button below.");
+ $warning.= " "._("The migration will be started when you save this system.");
if($this->display_warning){
- print_red($warning);
+ msg_dialog::display(_("Warning"), $warning, WARNING_DIALOG);
$this->display_warning = FALSE;
}
- return($smarty->fetch(get_template_path('servdhcp.tpl', TRUE)));
+ return($smarty->fetch(get_template_path('servdhcp.tpl', TRUE, dirname(__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 {
- print_red(_("You're not allowed to remove DHCP sections!"));
+ 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));
- return($smarty->fetch(get_template_path('remove_dhcp.tpl', TRUE)));
+ $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);
}
/* Display tempalte */
$smarty->assign("DhcpList",$DhcpList->DrawList());
- $display.= $smarty->fetch(get_template_path('servdhcp.tpl', TRUE));
+ $display.= $smarty->fetch(get_template_path('servdhcp.tpl', TRUE, dirname(__FILE__)));
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){
/* That should not happen... */
if ($type == ""){
- print_red(_("DHCP configuration set is unknown. Please contact your system administrator."));
+ msg_dialog::display(_("Error"), _("The DHCP configuration set is unkown. Please contact your system administrator."), ERROR_DIALOG);
}
return ($type);