Link to home
Create AccountLog in
Avatar of alumwell
alumwell

asked on

LDAP/PHP Password Reset (force change at next login)

I am trying to create a script where the user will type in the username and then the password will be reset to a default password eg "changeme" which when the user logs in will be asked to change that password.

I want it saved as a function and will pass the username and directory in which the user is stored in Active directory  eg

changepassword($username,$dir){
   //etc etc
}

Any thoughts?
ASKER CERTIFIED SOLUTION
Avatar of arober11
arober11
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of alumwell
alumwell

ASKER

Thank you for the suggestions, However I cannot get them to work as I would like, A couple of those examples required the old password to function. I want to be able to type in a username (which is in the active directory) and then it will just reset the password to 'password' and would require the user to change their password upon logging in.

So any ideas on how to do this?
I have already done a search on this site for  passwords and LDAP and have not found what I am looking for.
Yes, per my last post, the accepted solution, in POST https://www.experts-exchange.com/questions/23512181/Php-based-ldap-password-reset-will-not-expire-passwords.html#21878543,  takes the user-id from a Text box, named: user_to_reset, log's into the Directory, then changes the Password to the contencts of variable: $userpassword and marks the password as expired.