Modification pour connexion ldap avec active directory
This commit is contained in:
parent
396a0c9cf5
commit
9a50191d6c
@ -155,8 +155,18 @@ if (! session_id() || ! isset($_SESSION["dol_login"]))
|
|||||||
// Authentification Apache KO ou non active, pas de mode force on demande le login
|
// Authentification Apache KO ou non active, pas de mode force on demande le login
|
||||||
require_once(DOL_DOCUMENT_ROOT."/includes/pear/Auth/Auth.php");
|
require_once(DOL_DOCUMENT_ROOT."/includes/pear/Auth/Auth.php");
|
||||||
|
|
||||||
$ldapdebug=true;
|
$ldapdebug=false;
|
||||||
if ($ldapdebug) print "DEBUG: Traces connexions LDAP<br>\n";
|
if ($ldapdebug) print "DEBUG: Traces connexions LDAP<br>\n";
|
||||||
|
|
||||||
|
if ($conf->global->LDAP_SERVER_TYPE == "activedirectory")
|
||||||
|
{
|
||||||
|
$userattr = $conf->global->LDAP_FIELD_LOGIN_SAMBA;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$userattr = $conf->global->LDAP_FIELD_LOGIN;
|
||||||
|
}
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
'host' => $conf->global->LDAP_SERVER_HOST,
|
'host' => $conf->global->LDAP_SERVER_HOST,
|
||||||
'port' => $conf->global->LDAP_SERVER_PORT,
|
'port' => $conf->global->LDAP_SERVER_PORT,
|
||||||
@ -165,10 +175,10 @@ if (! session_id() || ! isset($_SESSION["dol_login"]))
|
|||||||
'binddn' => $conf->global->LDAP_ADMIN_DN,
|
'binddn' => $conf->global->LDAP_ADMIN_DN,
|
||||||
'bindpw' => $conf->global->LDAP_ADMIN_PASS,
|
'bindpw' => $conf->global->LDAP_ADMIN_PASS,
|
||||||
|
|
||||||
'debug' => $ldapdebug,
|
'debug' => $ldapdebug,
|
||||||
|
|
||||||
|
'userattr' => $userattr,
|
||||||
|
|
||||||
// 'userattr' => $conf->global->LDAP_FIELD_LOGIN_SAMBA
|
|
||||||
'userattr' => $conf->global->LDAP_FIELD_LOGIN,
|
|
||||||
// 'userfilter' => $conf->global->LDAP_FILTER_CONNECTION
|
// 'userfilter' => $conf->global->LDAP_FILTER_CONNECTION
|
||||||
'userfilter' => ''
|
'userfilter' => ''
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user