summaryrefslogtreecommitdiffstats
path: root/ldap_wizard/Ldap.pm
diff options
context:
space:
mode:
authorVicent Guardiola <vguardiola@mandriva.com>2004-09-01 17:36:43 +0000
committerVicent Guardiola <vguardiola@mandriva.com>2004-09-01 17:36:43 +0000
commitc6f8cca5a3ea379561ba94f3e414bb21313af130 (patch)
tree1cca5b96b4b21a7a03de77754624a0108fdfcf46 /ldap_wizard/Ldap.pm
parent3765443b18e3f63ea599a68618557834b96ed5de (diff)
downloaddrakwizard-c6f8cca5a3ea379561ba94f3e414bb21313af130.tar
drakwizard-c6f8cca5a3ea379561ba94f3e414bb21313af130.tar.gz
drakwizard-c6f8cca5a3ea379561ba94f3e414bb21313af130.tar.bz2
drakwizard-c6f8cca5a3ea379561ba94f3e414bb21313af130.tar.xz
drakwizard-c6f8cca5a3ea379561ba94f3e414bb21313af130.zip
Add new step for delete curent configuration
Diffstat (limited to 'ldap_wizard/Ldap.pm')
-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/*")
}