Started integrating external systems
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/*****************************************************************************
|
||||
IP Reg, a PHP/MySQL IPAM tool
|
||||
Copyright (C) 2007-2009 Wietse Warendorff (up to v0.5)
|
||||
Copyright (C) 2011-2023 Thomas Hooge
|
||||
Copyright (C) 2011-2026 Thomas Hooge
|
||||
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*****************************************************************************/
|
||||
@@ -25,11 +25,11 @@ $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$dbh->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
|
||||
include("lib.php"); // for smarty e.g.
|
||||
|
||||
// ========== LOGIN FUNCTIONS =================================================
|
||||
|
||||
function check_ldap_bind($user_name, $user_pass) {
|
||||
global $config_ldap_host;
|
||||
global $config_ldap_scheme;
|
||||
global $config_ldap_port;
|
||||
global $config_ldap_base_dn;
|
||||
global $config_ldap_bind_dn;
|
||||
@@ -37,7 +37,8 @@ function check_ldap_bind($user_name, $user_pass) {
|
||||
global $config_ldap_login_attr;
|
||||
$ldap_conn = NULL;
|
||||
foreach ($config_ldap_host as $server) {
|
||||
if ($ldap_conn = ldap_connect($server, $config_ldap_port)) {
|
||||
$ldap_uri = $config_ldap_scheme . $server . ':' . $config_ldap_port;
|
||||
if ($ldap_conn = ldap_connect($ldap_uri)) {
|
||||
if ($res = ldap_bind($ldap_conn, $config_ldap_bind_dn, $config_ldap_bind_pass)) {
|
||||
ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0);
|
||||
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
|
||||
|
||||
Reference in New Issue
Block a user