L
lancerset
Hello All,
I am having a problem with getting this to work. In this code section
I'm fetching data from mysql and assigning it to the array @Users
array. $Users[0] contains username and $Users[1] contains the password.
So i'm trying to add this info to my ldap server. The script runs, but
ldap does not contain the new entry. I'm not sure if this is a good way
to go about this. Any suggestions ??? Thanks,
use Net::LDAP::Entry;
while ( @Users = $sth->fetchrow_array( ) ) {
$entry = Net::LDAP::Entry->new;
$entry->dn($host);
$entry->add('uid' => '$Users[0]' );
$entry->add('userPassword' => '$Users[1]' );
$entry->add('givenName' => '$Users[0]' );
$entry->add('loginShell' => '/bin/bash' );
$entry->add('gidNumber' => '2222' );
$entry->add('homeDirectory' => '/home/ftpusers/$Users[0]' );
$entry->add('objectClass' => 'top');
$entry->add('objectClass' => 'person');
$entry->add('objectClass' => 'posixAccount');
}
I am having a problem with getting this to work. In this code section
I'm fetching data from mysql and assigning it to the array @Users
array. $Users[0] contains username and $Users[1] contains the password.
So i'm trying to add this info to my ldap server. The script runs, but
ldap does not contain the new entry. I'm not sure if this is a good way
to go about this. Any suggestions ??? Thanks,
use Net::LDAP::Entry;
while ( @Users = $sth->fetchrow_array( ) ) {
$entry = Net::LDAP::Entry->new;
$entry->dn($host);
$entry->add('uid' => '$Users[0]' );
$entry->add('userPassword' => '$Users[1]' );
$entry->add('givenName' => '$Users[0]' );
$entry->add('loginShell' => '/bin/bash' );
$entry->add('gidNumber' => '2222' );
$entry->add('homeDirectory' => '/home/ftpusers/$Users[0]' );
$entry->add('objectClass' => 'top');
$entry->add('objectClass' => 'person');
$entry->add('objectClass' => 'posixAccount');
}