Dbut ajout synchro ldap2dolibarr la connexion
This commit is contained in:
parent
223d463cdd
commit
adb3461bc6
@ -426,7 +426,7 @@ class Auth_Container_LDAP extends Auth_Container
|
||||
$attributes['count'] > 0)
|
||||
{
|
||||
$this->_debug('Saving attributes to Auth data', __LINE__);
|
||||
DOLIAUTH::setAuthData('attributes', $attributes);
|
||||
DOLIAuth::setAuthData('attributes', $attributes);
|
||||
}
|
||||
}
|
||||
@ldap_free_result($result_id);
|
||||
|
||||
@ -303,6 +303,17 @@ if (! session_id() || ! isset($_SESSION["dol_login"]))
|
||||
if (! $ldapadminpass) $ldapadminpass=$conf->global->LDAP_ADMIN_PASS;
|
||||
// Fin code pour compatiblité
|
||||
|
||||
// Si synchro ldap2dolibarr on récupère les attributs de l'utilisateur
|
||||
// afin de les synchroniser à sa connexion
|
||||
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr')
|
||||
{
|
||||
$attrArray = array(); // récupération de tous les attributs de l'utilisateur
|
||||
}
|
||||
else
|
||||
{
|
||||
$attrArray = array(''); // aucun attribut récupéré
|
||||
}
|
||||
|
||||
$params = array(
|
||||
'userattr' => $ldapuserattr,
|
||||
'host' => $ldaphost,
|
||||
@ -312,7 +323,7 @@ if (! session_id() || ! isset($_SESSION["dol_login"]))
|
||||
'binddn' => $ldapadminlogin,
|
||||
'bindpw' => $ldapadminpass,
|
||||
'debug' => $ldapdebug,
|
||||
//'attributes' => array('pwdlastset'),
|
||||
'attributes' => $attrArray,
|
||||
'userfilter' => ''
|
||||
);
|
||||
if ($ldapdebug) print "DEBUG: params=".join(',',$params)."<br>\n";
|
||||
@ -326,6 +337,9 @@ if (! session_id() || ! isset($_SESSION["dol_login"]))
|
||||
// Authentification Auth OK, on va chercher le login
|
||||
$login=$aDol->getUsername();
|
||||
dolibarr_syslog ("Authentification ok (en mode Pear Base LDAP)");
|
||||
|
||||
// Récupération des attributs de l'utilisateur
|
||||
$attributs = $aDol->getAuthData("attributes");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user