mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Check if username is userprincipalname
If it is, skip building the UPN for AD
This commit is contained in:
parent
f81b21208b
commit
2c18bc24a7
|
@ -81,11 +81,18 @@ class Ldap extends Model
|
|||
if ($settings->is_ad =='1')
|
||||
{
|
||||
|
||||
// In case they haven't added an AD domain
|
||||
if ($settings->ad_domain == '') {
|
||||
$userDn = $username.'@'.$settings->email_domain;
|
||||
// Check if they are using the userprincipalname for the username field.
|
||||
// If they are, we can skip building the UPN to authenticate against AD
|
||||
if ($ldap_username_field=='userprincipalname')
|
||||
{
|
||||
$userDn = $username;
|
||||
} else {
|
||||
$userDn = $username.'@'.$settings->ad_domain;
|
||||
// In case they haven't added an AD domain
|
||||
if ($settings->ad_domain == '') {
|
||||
$userDn = $username.'@'.$settings->email_domain;
|
||||
} else {
|
||||
$userDn = $username.'@'.$settings->ad_domain;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue