MyBB Community Forums

Full Version: LDAP - Finally
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A few of you have asked for an LDAP plugin for MyBB. I have a very preliminary version available for testing. ALL it does at the moment is, if the login to MyBB fails, it checks the login against an LDAP server. If there's an account on MyBB with that login name, but the password is wrong in MyBB (but correct in the LDAP server), the plugin verifies the login and updates the password in the MyBB database.

If this works for everyone, I promise I'll add code to allow it to add a MyBB account automatically (which is what you really want, right?) when a new user - who can authenticate via LDAP - tries to log in. (If I can find the core code for "create a new account".)

It's only been tested on Windows Server 2003 (I know - but that's the environment I work in), so I have no idea whether it will work on OpenLDAP, or any other LDAP server you may be running. It's trivial code, actually, so it should work on any server that follows the rules. It will do protocol version 2 or 3.

So - if you want to try it out, you can download it from the mod site or my server. It's simple - one plugin file at the moment. (You must know your LDAP server name, basedn and domain to set this up. Please don't ask me how your network is set up - I have no idea.)

BTW, MyBB development team - if you want to add this to the core of 2.x, feel free. I wouldn't mind the tighter integration putting it in the core would give, and it would probably eliminate about 3/4 of the code.

Download on MyBB Mod Site: http://mods.mybb.com/view/mybbldap
(2011-10-13, 10:34 PM)Rukbat Wrote: [ -> ]A few of you have asked for an LDAP plugin for MyBB. I have a very preliminary version available for testing. ALL it does at the moment is, if the login to MyBB fails, it checks the login against an LDAP server. If there's an account on MyBB with that login name, but the password is wrong in MyBB (but correct in the LDAP server), the plugin verifies the login and updates the password in the MyBB database.

If this works for everyone, I promise I'll add code to allow it to add a MyBB account automatically (which is what you really want, right?) when a new user - who can authenticate via LDAP - tries to log in. (If I can find the core code for "create a new account".)

It's only been tested on Windows Server 2003 (I know - but that's the environment I work in), so I have no idea whether it will work on OpenLDAP, or any other LDAP server you may be running. It's trivial code, actually, so it should work on any server that follows the rules. It will do protocol version 2 or 3.

So - if you want to try it out, you can download it from the mod site or my server. It's simple - one plugin file at the moment. (You must know your LDAP server name, basedn and domain to set this up. Please don't ask me how your network is set up - I have no idea.)

BTW, MyBB development team - if you want to add this to the core of 2.x, feel free. I wouldn't mind the tighter integration putting it in the core would give, and it would probably eliminate about 3/4 of the code.

Download on MyBB Mod Site: http://mods.mybb.com/view/mybbldap

Hi,

Did you write a new plugin? Is it available for download?

Hi,

did you write a new plugin? is it available?
(2012-07-10, 08:27 PM)berg1987 Wrote: [ -> ]did you write a new plugin? is it available?

What's this;
(2011-10-13, 10:34 PM)Rukbat Wrote: [ -> ]Download on MyBB Mod Site: http://mods.mybb.com/view/mybbldap
Rukbat, the code you use to build bind RDN in your code won't work with openLDAP:
ldap_bind(): Unable to bind to server: Invalid DN syntax - Line: 357 - File: inc/plugins/mybbldap.php
The proper format for openLDAP is
uid={$username},ou=users,{$basedn}
(ou=users depends on the way LDAP server was setup, so it should probably be included into $domain). So, I propose to add a field to configuration that contains a template for RDN.
I updated the mod extensively, and the updated code is at http://community.mybb.com/thread-145357.html. For those that are interested, give it a try.