From 5c15e4ec959c1367f030d90104fe330bfb508882 Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Mon, 1 Mar 2010 01:23:37 +0000 Subject: [PATCH] allow specifying LDAP version 2 or 3 in the config git-svn-id: http://www.observium.org/svn/observer/trunk@978 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/ldap.inc.php | 4 ++++ includes/defaults.inc.php | 3 +++ 2 files changed, 7 insertions(+) diff --git a/html/includes/authentication/ldap.inc.php b/html/includes/authentication/ldap.inc.php index daf7941d0..11e3a20b5 100644 --- a/html/includes/authentication/ldap.inc.php +++ b/html/includes/authentication/ldap.inc.php @@ -7,6 +7,10 @@ function authenticate($username,$password) $ds=@ldap_connect($config['auth_ldap_server'],$config['auth_ldap_port']); if ($ds) { + if ($config['auth_ldap_version']) + { + ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, $config['auth_ldap_version']); + } if (ldap_bind($ds, $config['auth_ldap_prefix'] . $username . $config['auth_ldap_suffix'], $password)) { if (!$config['auth_ldap_group']) diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 55a669439..96e96f709 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -106,5 +106,8 @@ $config['ignore_bsd_os_drives'] = array("/^\/dev,/", "/^\/var\/dhcpd\/dev,/", $config['enable_ports_etherlike'] = 0; # Enable EtherLike-MIB $config['enable_ports_junoseatmvc'] = 0; # Enable JunOSe ATM VC Discovery/Poller +# LDAP Authentication + +$config['auth_ldap_version'] = 3; # v2 or v3 ?>