diff options
Diffstat (limited to 'ldap_wizard')
-rw-r--r-- | ldap_wizard/ldap.pm | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/ldap_wizard/ldap.pm b/ldap_wizard/ldap.pm index 57d5b052..9821b69f 100644 --- a/ldap_wizard/ldap.pm +++ b/ldap_wizard/ldap.pm @@ -14,6 +14,7 @@ use MDK::Wizard::Varspaceval; use MDK::Wizard::Wizcommon; use Expect; require Net::LDAP; +use Net::LDAP::Util qw(ldap_error_text); #unless ($> == 0) { # die "You are not root Exiting\n"; @@ -96,7 +97,7 @@ $o->{pages} = { }, post => sub { if ($o->{var}{wiz_level} == 2) { - return 'add_userposix'; + return 'check_conffile'; } }, data => [ @@ -105,6 +106,16 @@ $o->{pages} = { ], next => 'set_srv', }, + check_conffile => { name => N("Config Server "), + data => [ + { label => N("Server Name: "), val => \$o->{var}{srv} }, + { label => N("Server RootDN: "), val => \$o->{var}{rootdn} }, + { label => N("RootDN Password : "), val => \$o->{var}{rootpass}, hidden => 1 }, + { label => N("Server Suffix: "), val => \$o->{var}{suffix} }, + { label => N("Server Default Users OU : "), val => \$o->{var}{defou} }, + ], + next => 'add_userposix' + }, add_userposix => { name => N("LDAP User Add") . "\n\n" . N("User Create in : ") . $o->{var}{defou} . "," . $o->{var}{suffix}, data => [ @@ -118,7 +129,7 @@ $o->{pages} = { next => 'password' }, password => { - name => N("LDAP User Password") . "\n\n" . N("Password for Users : ") . $o->{var}{cn} . $o->{var}{defou} . "," . $o->{var}{suffix}, + name => N("LDAP User Password") . "\n\n" . N("Password for Users : ").$o->{var}{sn}.",".$o->{var}{sn}.",". $o->{var}{cn} . $o->{var}{defou} . "," . $o->{var}{suffix}, data => [ { label => N("Password:):"), val => \$o->{var}{uidpass}, hidden => 1 }, @@ -178,7 +189,7 @@ $o->{pages} = { { label => N("User Name:"), type => 'field', fixed_val => \$o->{var}{uid} }, { - label => N("User:"), type => 'field', fixed_val => $o->{var}{cn} }, + label => N("Create in :"), type => 'field', val => $o->{var}{defou}.$o->{var}{suffix} }, ], post => \&do_it_user_add, next => 'endadd' @@ -257,11 +268,10 @@ sub do_it_setldap { # create config file in /etc/sysconfig/ldapconf output($conf_file, <<EOF); -server=$o->{var}{srv} +srv=$o->{var}{srv} suffix=$o->{var}{suffix} rootdn=$o->{var}{rootdn} rootpass=$o->{var}{rootpass} -rootpass=$o->{var}{rootpass} users=$o->{var}{defou} EOF @@ -296,9 +306,9 @@ description: OU Hosts objectClass: top objectClass: organizationalUnit -dn: ou=People,$o->{var}{suffix} -ou: People -description: OU People +dn: ou=Users,$o->{var}{suffix} +ou: Users +description: OU Users objectClass: top objectClass: organizationalUnit @@ -320,7 +330,7 @@ RootLdif sub do_it_user_add { return if $::testing; my $ldap = ldap_connect($o); - add_user($o); + my $mesg = add_user($o); } sub new { |