Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBulletin Ldap Authentication Plugin 1.0.1 Details »»
vBulletin Ldap Authentication Plugin 1.0.1
Version: 1.01, by malcolmx malcolmx is offline
Developer Last Online: Mar 2020 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.0.0 Rating:
Released: 01-01-2010 Last Update: Never Installs: 27
Uses Plugins
Re-useable Code Code Changes Additional Files  
No support by the author.

This is a very small plugin for enabling ldap authentication for vBulletin Suite 4. The original version is from www.sartori.at.

if you need any help installing the plugin, please post into this thread here.

if you need any extra changes i will modify the plugin for extra charge.

In contrast to the ldap authentication from zemic my board can authenticate against every - already deployed - ldap directory without changeing the encryption type.

If the ldap user is not added in the VBulletin database, the user is automatically added the first time he authenticates against the ldap. if the user already exists then nothing is changed, except the authentication against the directory.

in the admin or moderator panel no user is authenticated against the directory.

Requirements
  • php with ldap support

Installation Notes:
  1. copy ldapAuth directory to your vb forum installation directory
  2. change the path to controller.php directory in ldap-plugin.xml
  3. copy the hooks_ldap.xml to FORUM_ROOT/includes/xml directory
  4. in login.php search for:
    PHP Code:
    if ($vbulletin->GPC['vb_login_username'] == '')
             {
              eval(
    standard_error(fetch_error('badlogin'$vbulletin->options['bburl'], ....
             } 
    add hook after if statement, becomes:
    PHP Code:
    (if ($vbulletin->GPC['vb_login_username'] == ''

      eval(
    standard_error(fetch_error('badlogin'$vbulletin->options['bburl'], .... 

    (
    $hook vBulletinHook::fetch_hook('ldap_login_hook')) ? eval($hook) : false
  5. activate plugin system (if not done already) in admincp
  6. in admin cp import the product at "Plugins & Products -> Download / Upload Plugins", use "Import Plugin Definitions XML File" at the bottom of the page, example import input './ldapAuth/ldap-plugin.xml'
  7. recheck if the include for controller.php is right
  8. in includes/class_bootstrap.php search for:
    PHP Code:
    $show['nopasswordempty'
    and change:
    PHP Code:
    defined('DISABLE_PASSWORD_CLEARING') ? 0
    to:
    PHP Code:
    defined('DISABLE_PASSWORD_CLEARING') ? 1
  9. configure the ldap settings in: ldapconfig.inc.php
  10. test the product


Additional Notes:
If you are running a Microsoft Active Directory as Ldap server you have to change some settings to allow anonymous queries. This is described at
Novell and Microsoft


I would be happy if you support my modification in any way. Install or nominate it or donate some cents at paypal.

vBulletin 3.6 version

Download Now

File Type: zip ldapAuth_1.0.1.zip (6.4 KB, 406 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 07-02-2010, 05:49 PM
jeffsawyer jeffsawyer is offline
 
Join Date: May 2010
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm sure this has been asked (and hopefully solved) somewhere, but I'm not having luck with my searches here or on Google. What I'd really like is a full complete LDAP solution for vBulletin. This LDAP mod is great, but only integrates the login and nothing else. Is there a full integration hack somewhere or do I need to hack it up myself? Or do most people use some sort of central account management hub on their sites and disable the broken pieces? i.e. multiple subdomains for each piece: account.mycoolsite.com, forum.mycoolsite.com, www.mycoolsite.com

Thanks! Looking forward to feedback.

Jeff
Reply With Quote
  #33  
Old 08-13-2010, 08:16 PM
lluu lluu is offline
 
Join Date: Aug 2010
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this mod allow for LDAPS (secure LDAP)? I am trying with OpenLDAP and have no idea how I would set encryption types, certs, etc.
Any help would be much appreciated, thanks.
Reply With Quote
  #34  
Old 08-24-2010, 01:53 PM
northerndoctors northerndoctors is offline
 
Join Date: Sep 2007
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
I've been through the steps and added the code and put the files in the places told. When i try log in i get the error shown below right at the top of the window. Could you give me some suggestions to try?

Cheers Ben

"Warning: include(/Forums/ldapAuth/controller.php) [function.include]: failed to open stream: No such file or directory in [path]\login.php(109) : eval()'d code on line 1

Warning: include() [function.include]: Failed opening '/Forums/ldapAuth/controller.php' for inclusion (include_path='.;C:\xampp\php\pear\') in [path]\login.php(109) : eval()'d code on line 1"
Reply With Quote
  #35  
Old 10-11-2010, 09:13 PM
jjuarez jjuarez is offline
 
Join Date: Sep 2010
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please help me, I install this mod and work perfect, but I need give administrator privileges to an Active Directory User, and when I try to enter with this user to Admin Panel, dispay the error on user or password.

I Think this is because in controller.php are this condition:

// if login form is admin or moderator login, dont use ldap authentication
if(($vbulletin->GPC['logintype'] == "cplogin") || ($vbulletin->GPC['logintype'] == "modcplogin"))
{
return;
}

How fix this that when this user try to access to admin panel, work.

Tanks a lot.
Reply With Quote
  #36  
Old 10-12-2010, 02:30 AM
VirginBlue VirginBlue is offline
 
Join Date: Sep 2010
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FFSBC View Post
Tried this with vbulletin 4-0-2 Patch Level 1 and Server 2003 AD with no luck. Installed Haqa's LDAP mod version 1.5 (which I had previously used with version 3.8.2 without issues) and it worked on the first try without any other tweaking:

https://vborg.vbsupport.ru/showthread.php?t=196596
Same
Reply With Quote
  #37  
Old 03-26-2011, 08:06 PM
ecrist ecrist is offline
 
Join Date: Nov 2010
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've updated the code from this add-on to include the code for authenticated (non-anonymous) binds, and well as having added the ability to keep the in-database password in-sync with the password stored in LDAP. The allows the user to use the same password for the admin/mod control panels as they do for the forum main pages.

There are a few things I'd like to do in the near future:
  1. Update LDAP password from vB profile update page.
  2. Update email from vB profile update page
  3. Update email from LDAP front-end.

Please take these code changes and let me know what you think.
Attached Files
File Type: zip ldapAuth_1.0.2.zip (8.2 KB, 64 views)
Reply With Quote
  #38  
Old 05-31-2011, 04:24 PM
Swarm Swarm is offline
 
Join Date: Oct 2008
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,
Does anyone know if this plugin has been worked on recently? I've followed the directions and notes from this thread fairly extensively but still cannot get it to work entirely.

Using: AD, ldapAuth_1.0.2 (non-anonymous)

I can verify that my credential is binding correctly. However when I try to log in, i see the following errors:

Code:
Warning: ldap_search() [function.ldap-search]: Search: Bad search filter in [path]\ldapAuth\controller.php on line 38

Warning: ldap_get_entries() expects parameter 2 to be resource, boolean given in [path]\ldapAuth\controller.php on line 39
controller.php
Code:
<?php

error_reporting(E_ALL & ~E_NOTICE);
define('THIS_SCRIPT', 'controller.php');

// some basic requirements
require_once('./global.php');
require_once(DIR . '/includes/functions_login.php');
require_once(DIR . '/ldapAuth/ldapfunctions.inc.php');
require_once(DIR . '/ldapAuth/ldapconfig.inc.php');

// if login form is admin or moderator login, dont use ldap authentication
if(($vbulletin->GPC['logintype'] == "cplogin") || ($vbulletin->GPC['logintype'] == "modcplogin"))
{
	return;
}

// if there is no password submitted, redirect to standard error
if ($vbulletin->GPC['vb_login_password'] == '')
{
	eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes)));
}

// create the ldap search filter
$ldapFilter = "($samaccountname=" . $vbulletin->GPC['vb_login_username'] .")";

// connect to the LDAP Server
$ldapConnection = ldap_connect($ldapServer, $ldapPort);
//ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);

if($ldapConnection){
	$ldapBind = ldap_bind($ldapConnection, $ldapBindUser, $ldapBindPassword);
	// search for the username and get the DN
	$searchDn = ldap_search($ldapConnection,$ldapBase,$ldapFilter);
	$searchResult = ldap_get_entries($ldapConnection,$searchDn);
	
	// if no user is found in ldap, redirect to standard error
	if(sizeof($searchResult) < 2)
	{
		eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'],$strikes)));
	}

	// write the FIRST found DN to $bindDn;
	$bindDn=$searchResult[0]['dn'];

	// bind to the ldap server with specified credentials (dn, password)
	$ldap_bind = ldap_bind($ldapConnection, $bindDn, $vbulletin->GPC['vb_login_password']);

	// close the server connection
	ldap_close($ldapConnection);

	if ($ldap_bind != 1){
		// ldap bind did not succeed, wrong username/password combination
		eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl'], $strikes)));
	} else {
		// generate a template for vBulletin user database
		[...]
ldapconfig
Code:
<?php

error_reporting(E_ALL & ~E_NOTICE); 
define('THIS_SCRIPT', 'ldapconfig.php');  

// Server Settings
$ldapBindUser = "mydomainadminusername";
$ldapBindPassword = "mypass";
$ldapServer = "x.x.x.x";
$ldapPort = 389;
$ldapBase = "ou=users,dc=domain,dc=local";

// Search Settings
//$samaccountname = "cn";
$ldapEmailAttr = array( "mail" );
$noEmailExists = ""

?>
Any Ideas?
Reply With Quote
  #39  
Old 01-29-2012, 10:23 AM
Eslob Eslob is offline
 
Join Date: May 2010
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you for this mod, its little complicated but i'm trying to learn more about it.

as i know ldap mostly used for emails (microsoft outlook)
Reply With Quote
  #40  
Old 12-27-2012, 03:37 AM
J29953E37A78 J29953E37A78 is offline
 
Join Date: Dec 2012
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there,
I have downloaded the plugin and done up to point 5 but I don't understand point 6 (in admin cp import the product at "Plugins & Products -> Download / Upload Plugins", use "Import Plugin Definitions XML File" at the bottom of the page, example import input './ldapAuth/ldap-plugin.xml'

Where do I find this?

Frustrated
thanks
Reply With Quote
  #41  
Old 01-30-2013, 08:30 PM
miklr miklr is offline
 
Join Date: Jan 2013
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by J29953E37A78 View Post
Hi there,
I have downloaded the plugin and done up to point 5 but I don't understand point 6 (in admin cp import the product at "Plugins & Products -> Download / Upload Plugins", use "Import Plugin Definitions XML File" at the bottom of the page, example import input './ldapAuth/ldap-plugin.xml'


Where do I find this?

Frustrated
thanks
I noticed that malcolmx has a supported tag on this. Has anyone had success installing it on 4.2?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:35 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04868 seconds
  • Memory Usage 2,356KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete