I hope this is the right list to post to, php-db seems to be more SQL oriented and less LDAP inclined. If I am in the wrong spot please let me know.
My problem is: I have written a function to authenticate users who enter their credentials in a web form against an LDAP directory. The function works in so much as I can send it valid and invalid data and it can return a true or a false with no problem.
Now for the real problem; I am making my connection to the LDAP server inside my ldap_auth_function but I would like to reuse that connection and those permissions again outside of the function. I have tried registering the connection variable as a global and I have also tried passing the value by reference instead of by value. However the net result is essentially the same.
By value I get:
"ldap_search(): supplied argument is not a valid ldap link resource"
By reference I get
"ldap_search(): 1 is not a valid ldap link resource"
I expect the behaviour I get from by val just not by ref. What am I doing wrong?