summaryrefslogtreecommitdiffstats
path: root/ldap_wizard
diff options
context:
space:
mode:
authorVicent Guardiola <vguardiola@mandriva.com>2004-09-01 09:27:46 +0000
committerVicent Guardiola <vguardiola@mandriva.com>2004-09-01 09:27:46 +0000
commit3765443b18e3f63ea599a68618557834b96ed5de (patch)
tree4ba60393e334b16d5710949f16907844dbdec351 /ldap_wizard
parentabc844386d7109ca32cc0d50cb75f642b6003fa4 (diff)
downloaddrakwizard-3765443b18e3f63ea599a68618557834b96ed5de.tar
drakwizard-3765443b18e3f63ea599a68618557834b96ed5de.tar.gz
drakwizard-3765443b18e3f63ea599a68618557834b96ed5de.tar.bz2
drakwizard-3765443b18e3f63ea599a68618557834b96ed5de.tar.xz
drakwizard-3765443b18e3f63ea599a68618557834b96ed5de.zip
Modify step if user already exist
Diffstat (limited to 'ldap_wizard')
-rw-r--r--ldap_wizard/Ldap.pm36
1 files changed, 27 insertions, 9 deletions
diff --git a/ldap_wizard/Ldap.pm b/ldap_wizard/Ldap.pm
index 318ff3f6..32db9dd0 100644
--- a/ldap_wizard/Ldap.pm
+++ b/ldap_wizard/Ldap.pm
@@ -187,7 +187,7 @@ $o->{pages} = {
{ label => N("Create in:"), type => 'field', fixed_val => \$o->{var}{defou} }, #. \$o->{var}{suffix} },
],
post => \&do_it_user_add,
- next => 'endadd'
+ next => $o->{var}{useraddisnogood}
},
summary_set_srv => {
name => N("Confirmation Information for create an LDAP server"),
@@ -207,15 +207,26 @@ $o->{pages} = {
end => 1,
next => 0
},
- endadd => {
+
+ add_user_good => {
name => N("Successfully added User"),
- data => [ { label => N(""),fixed_val => \$o->{var}{error_user_add} }
-
- ],
- no_back => 1,
+ data => [ { label => N("\n"),fixed_val => \$o->{var}{error_user_add} }
+ ],
+ next => 'add_userposix',
end => 1,
- next => 0,
},
+
+ add_user_nogood => {
+ name => N("Error for added User"),
+ data => [ { label => N("\n"),fixed_val => \$o->{var}{error_user_add} }
+ ],
+ next => 'add_userposix',
+ end => 1,
+ },
+
+
+
+
resume => {
name => N("Server already configured"),
post => sub {
@@ -341,9 +352,16 @@ RootLdif
sub do_it_user_add {
return if $::testing;
- $o->{var}{error_user_add}= add_user($o);
-}
+ ($o->{var}{code_return}, $o->{var}{error_user_add}) = add_user($o);
+ if ($o->{var}{code_return} =~ /success/i) {
+ $o->{var}{useraddisnogood} = "add_user_good";
+ } else {
+ $o->{var}{useraddisnogood} = "add_user_nogood";
+ }
+
+}
+
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));