Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ldap PHP userPassword

Status
Not open for further replies.

windminstreel

Programmer
Oct 12, 2004
3
0
0
Hello Everyone

I'm writing a php script to add a user to the ldap server on a linux system.
Now i'm having a problem adding a password in the userPassword attribute. when i add the user, the userPassword Atribute is still blank and i know i'm putting something into the array. can someone help?

Thanks in advance,

Chris


sample of my script:

$new_ldap_user = array();
$new_ldap_user['cn'] = $naam;
$new_ldap_user['uid'] = $naam;
$new_ldap_user['objectclass'][0] = "posixaccount";
$new_ldap_user['objectclass'][1] = "account";
$new_ldap_user['objectclass'][2] = "top";
$new_ldap_user['objectclass'][3] = "shadowaccount";
$new_ldap_user['userpassword'] = $wachwoord;
$new_ldap_user['gidnumber'] = 100;
$new_ldap_user['uidnumber'] = (int) $uidnumber;
$new_ldap_user['homedirectory'] = $homedir;
$new_ldap_user['loginshell'] = $loginshell;
if ($admin != 'on') {
$add_user = ldap_add($ds, "uid=$naam,ou=clients,dc=cdls,dc=intra", $new_ldap_user);
}else{
$add_user = ldap_add($ds, "uid=$naam,ou=admins,dc=cdls,dc=intra", $new_ldap_user);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top