Skip to content
Advertisement

How to check if a user account is locked via PHP/LDAP?

We’ve created an intranet site that requires the same password as the user’s network login, so we use LDAP to check the username/password.

That’s fine, but if they enter it incorrectly three times it locks their account out, and one or two users have found this confusing.

Is there anyway at all I could check, using LDAP/PHP whether or not their account is locked, so I can display a little message prompting them to contact IT?

Advertisement

Answer

You need to connect to the LDAP using the LDAP functions in PHP and perform search/read to locate and get the information. You can read about it here: http://us3.php.net/manual/en/book.ldap.php

Find a sample code for reading entries:

JavaScript

You might want to check for the fields lockoutTime in AD, nsaccountlock in LDAP and read them

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement