$ds is a global variable, there are many name collisions in the code. Rename it to avoid the collisions.
May fix issues users have seen with getting logged out...
Rename $ds to $ldap_connection
Think we have $ds in the last three changed files, change start from around line 100 when the connection is done at the top.
Change the rest of the $ds variables to $ldap_connection
@laf Oh my, silly me to miss that. And I only tested active_directory because that is what I have.
Double checked this time ;) Thanks.