Okay so I needed to use this for a setup that we have using Active Directory. Kirk's (KPatten) version was great, but being a hacker at heart I tweaked it. I thought I'd share this with the community as a way to say thanks. All the caveats and instructions that Kirk gave in post
127 still apply.
Differences:
- Option to update the username of existing vbulletin users. I believe this is how it was supposed to work, but it didn't for me
- New database field on user table to store which users are LDAP users, and provides an option to prevent access when those users are removed from AD
- Lots of debug messages (I found this VERY helpful), with an option to disable. (requires includes\devtools.php I got this from here)
- Puts LDAP 'displayname' into user field5 (I've found this to be a pretty common place to put a user's display name, although arguably I should have used the extension points as originally intended)
- Puts LDAP 'title' into user field4 (This is "occupation" in my install)
- I set the minimum version to 4.1.5 - this is because I haven't tested it on anything older, but there's every chance that it will work on whichever system Kirk's works on. Please let me know if this is the case, and I'll update the files here.
- Puts an entry into the user table to indicate if they're an ldap user or not - this requires a new column to be created in the user table: 'ldap'. This is done by the install code for the product. This allows the system to disable users who have since been disabled by ldap, while still allowing external users to use the system.
For this to work you'll need the following files. They go in the following locations:
./includes/xml/hooks_ldap_auth.xml
./includes/devtools.php
A big thanks to everyone who has contributed to this solution: kpatten, haqa, malcolmx and zemic.