diff options
author | Vicent Guardiola <vguardiola@mandriva.com> | 2004-02-12 14:23:53 +0000 |
---|---|---|
committer | Vicent Guardiola <vguardiola@mandriva.com> | 2004-02-12 14:23:53 +0000 |
commit | 5f114ba3dab220df026d862629ae447ce5024556 (patch) | |
tree | 85e7270372fa7e463df5af1fd9b79a26fb94e55c /ldap_wizard | |
parent | c5ffdbf72df99ef2fe93216a981586fe219b7c2e (diff) | |
download | drakwizard-5f114ba3dab220df026d862629ae447ce5024556.tar drakwizard-5f114ba3dab220df026d862629ae447ce5024556.tar.gz drakwizard-5f114ba3dab220df026d862629ae447ce5024556.tar.bz2 drakwizard-5f114ba3dab220df026d862629ae447ce5024556.tar.xz drakwizard-5f114ba3dab220df026d862629ae447ce5024556.zip |
Add Entry add user posix
Diffstat (limited to 'ldap_wizard')
-rw-r--r-- | ldap_wizard/ldap.pm | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ldap_wizard/ldap.pm b/ldap_wizard/ldap.pm index 6b40d689..0eb9bef8 100644 --- a/ldap_wizard/ldap.pm +++ b/ldap_wizard/ldap.pm @@ -35,13 +35,14 @@ my $o = { rootdn => 'manager', rootpass => 'secret', cn => '', - sn => '', - uid => 'vincent', + sn=> '', + uid => '', uidpass => '', lshell => '/bin/bash', + home => '/home/', uidnb => '', guinb => '', - container => 'ou=users,dc=people.', + container => '', objectclass => 'top,account,posixaccount', shadowmax => '99999', shadowmin => '-1', @@ -86,10 +87,10 @@ $o->{pages} = { { label => N("Last Name:"), val => \$o->{var}{sn} }, { label => N("User Name:"), val => \$o->{var}{uid} }, { label => N("Password:"), val => \$o->{var}{uidpass} }, + { label => N("Home Directory:"), val => \$o->{var}{home} }, { label => N("Login shell:"), val => \$o->{var}{lshell} }, { label => N("uid number:"), val => \$o->{var}{uidnb} }, { label => N("Group ID:"), val => \$o->{var}{guidnb} }, - { label => N("Container:"), val => $o->{var}{container} . $DC }, ], post => \&test_add, next => 'summaryadd', @@ -116,7 +117,7 @@ $o->{pages} = { { label => N("Last Name:"), fixed_val => \$o->{var}{sn2} }, { label => N("User Name:"), fixed_val => \$o->{var}{uid2} }, { label => N("Password:"), fixed_val => \$o->{var}{uidpass} }, - { label => N("Home directory:"), fixed_val => \$o->{var}{uid} }, + { label => N("Home directory:"), fixed_val => \$o->{var}{home} }, { label => N("Login shell:"), fixed_val => \$o->{var}{lshell} }, { label => N("uid number:"), fixed_val => \$o->{var}{uidnb} }, { label => N("Group ID:"), fixed_val => \$o->{var}{guidnb} }, @@ -178,7 +179,7 @@ sub rootdse_to_dc { my ($data) = @_; my @t = split(/\./, $data); $o->{var}{dom} = $t[0]; - my $dcall = join(',dc=', split(/\./, $data)); + my $dcall = join( ',dc=', split(/\./, $data)); return $dcall; } @@ -193,7 +194,7 @@ sub get_dc { } sub do_it_setldap { - if (!-f $LDAPCONF) { die "no $LDAPCONF found" }; + if (!-f $LDAPCONF) { die "no $LDAPCONF found"}; cp_af($LDAPCONF, $LDAPCONF . '.save'); if (!-f "$LDAPCONF.example") { cp_af($LDAPCONF, $LDAPCONF . '.example') }; cp_af($LDAPCONF . '.example', $LDAPCONF); @@ -202,7 +203,7 @@ sub do_it_setldap { # set suffix if (any { /^suffix/ } cat_($LDAPCONF)) { substInFile { - s/suffix.*/suffix\t"dc=$dcall"/; + s/suffix.*/suffix\t\"dc=$dcall\"/; } $LDAPCONF; } else { append_to_file($LDAPCONF, "suffix\t\"dc=$dcall\""); @@ -216,7 +217,7 @@ sub do_it_setldap { # set rootdn if (any { /^rootdn/ } cat_($LDAPCONF)) { substInFile { - s/rootdn.*/rootdn\t"cn=$o->{var}{rootdn},dc=$dcall"/; + s/rootdn.*/rootdn\t\"cn=$o->{var}{rootdn},dc=$dcall\"/; } $LDAPCONF; } else { append_to_file($LDAPCONF, "rootdn\t\"$o->{var}{rootdn},dc=$dcall\""); @@ -225,11 +226,11 @@ sub do_it_setldap { # set rootpass my $cryptpass = crypt($o->{var}{rootpass}, "crypt"); if (any { /^rootpw/ } cat_($LDAPCONF)) { - substInFile { - s/rootpw.*/rootpw $cryptpass/; - } $LDAPCONF; - } else { - append_to_file($LDAPCONF, "rootpw {CRYPT}$cryptpass"); + substInFile { + s/rootpw.*/rootpw $cryptpass/; + } $LDAPCONF; + }else { + append_to_file($LDAPCONF, "rootpw {CRYPT}$cryptpass"); } # reset premisions |