Revert "Getting started on LDAP/Active Directory integration"
This reverts commit 98a7633cb64d778310702344d75bbf41213bbf24.
This commit is contained in:
parent
30b4c2a908
commit
84f6e91c0b
@ -37,7 +37,6 @@ define('HESK_PATH','../');
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'nuMods_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
@ -71,7 +70,7 @@ exit();
|
||||
/*** START FUNCTIONS ***/
|
||||
function do_login()
|
||||
{
|
||||
global $hesk_settings, $hesklang, $nuMods_settings;
|
||||
global $hesk_settings, $hesklang;
|
||||
|
||||
$hesk_error_buffer = array();
|
||||
|
||||
@ -177,37 +176,6 @@ function do_login()
|
||||
$_SESSION[$k]=$v;
|
||||
}
|
||||
|
||||
// Check if the user should be authenticated via Active Directory / LDAP
|
||||
$usesLdap = $res['UsesLDAP'];
|
||||
if ($usesLdap) {
|
||||
//-- do AD-specific logic here.
|
||||
$application_user = $nuMods_settings['ldap_application_user'];
|
||||
$password = $nuMods_settings['ldap_application_password'];
|
||||
|
||||
//-- Connect to LDAP server
|
||||
$connectionIp = $nuMods_settings['ldap_server_ip'];
|
||||
$port = $nuMods_settings['ldap_server_port'];
|
||||
$connection = ldap_connect($connectionIp, $port);
|
||||
if ($connection == false) {
|
||||
die("Couldn't connect to LDAP server.");
|
||||
}
|
||||
|
||||
//-- Bind the application user to the connection
|
||||
$bind = ldap_bind($connection, $application_user, $password);
|
||||
if ($bind == false) {
|
||||
die("Couldn't authenticate as the application user.");
|
||||
}
|
||||
|
||||
//-- Find the user's DN
|
||||
//TODO LDAP escape the $user string!
|
||||
$dnQuery = "(&(uid=" . $user . ")(objectClass=person))";
|
||||
$search_base = $nuMods_settings['ldap_search_base'];
|
||||
$search_status = ldap_search(
|
||||
$connection, $search_base, $dnQuery, array('dn')
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/* Check password */
|
||||
if (hesk_Pass2Hash($pass) != $_SESSION['pass'])
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user