summaryrefslogtreecommitdiffstats
path: root/ldap_wizard
diff options
context:
space:
mode:
Diffstat (limited to 'ldap_wizard')
-rw-r--r--ldap_wizard/Ldap.pm18
1 files changed, 11 insertions, 7 deletions
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm
index 32db9dd0..160fe253 100644
--- a/ldap_wizard/Ldap.pm
+++ b/ldap_wizard/Ldap.pm
@@ -80,6 +80,7 @@ if (-f $conf_file) {
my %level = (
1 => N("Configure OpenLDAP server"),
2 => N("Add user in OpenLDAP server"),
+ 3 => N("Delete OpenLDAP configuration"),
);
$o->{pages} = {
@@ -99,6 +100,9 @@ $o->{pages} = {
if ($o->{var}{wiz_level} == 1) {
-f $conf_file and return 'resume';
}
+ if ($o->{var}{wiz_level} == 3) {
+ return 'del_conf';
+ }
},
data => [
@@ -107,10 +111,10 @@ $o->{pages} = {
next => 'set_srv',
},
- sav_old_conf => {
- name => N("Save an existing configuration"),
- post => \&sav_conf,
- next => 'set_srv'
+ del_conf => {
+ name => N("Delete configuration") . "\n\n" . N("Saving existing base in /root/ldap-sav.ldiff"),
+ post => \&sav_conf,
+ next => 'welcome'
},
add_userposix => {
name => N("LDAP Adding User") . "\n\n" . N("User Created in: ") . $o->{var}{defou} . ", " . $o->{var}{suffix},
@@ -237,8 +241,7 @@ $o->{pages} = {
{ label => N("Administrator LDAP:"), type => 'field', fixed_val => \$o->{var}{rootdn} },
{ label => N("Users Container:"), type => 'field', fixed_val => \$o->{var}{defou} },
],
- end => 1,
- next => 0,
+ next => 'welcome',
},
};
@@ -365,7 +368,8 @@ sub do_it_user_add {
sub sav_conf {
my $cmd = "slapcat -l /root/ldap-sav.ldiff";
system($cmd) == 0 or !$::testing and err_dialog(N("Error!"), N("%s Failed", $cmd));
- system("cp /etc/openldap/slapd.conf /root/");
+ system("cp /etc/openldap/slapd.conf /root/slapd.save");
+ system("rm /etc/sysconfig/ldapwiz");
system("rm -fr /var/lib/ldap/*")
}