user uid instead of cn in distinguished name to auth. user

This commit is contained in:
Uwe Steinmann 2022-08-30 18:11:00 +02:00
parent 3fd63b98d9
commit 8f4c2f454b

View File

@ -55,7 +55,7 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
/* Check if ldap base dn is set, and use ldap server if it is */
if (isset($settings->_ldapBaseDN)) {
$ldapSearchAttribut = "uid=";
$tmpDN = "cn=".$username.",".$settings->_ldapBaseDN;
$tmpDN = "uid=".$username.",".$settings->_ldapBaseDN;
}
/* Active directory has a different base dn */
@ -127,6 +127,7 @@ class SeedDMS_LdapAuthentication extends SeedDMS_Authentication {
if (!is_bool($search)) {
$info = ldap_get_entries($ds, $search);
if (!is_bool($info) && $info["count"]==1 && $info[0]["count"]>0) {
$user = $dms->addUser($username, null, $info[0]['cn'][0], $info[0]['mail'][0], $settings->_language, $settings->_theme, "", 0);
}