Kyle Waters wrote:
I'm using the built in ldap stuff for a web app to help manage our ldap interface(I know about phpldapadmin, I need some custom stuff). I want to find the lowest availiable uidnumber and gidnumber with in the 500-600 range. I'm having trouble figuring out the most efficient way of doing this. Any suggestions?

You'll have to search for all uidnumbers in your with ldapsearch() using this search filter:

(uidnumber=*)

And then get the next available one from the list.


Bare in mind that this could lead to a race condition wherein two users get the same number. It's best to have a separate application somewhere that is uniquely responsible for handing out uid numbers.

--Dave

_______________________________________________

UPHPU mailing list
UPHPU@uphpu.org
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to