Skip to content
Permalink
Browse files Browse the repository at this point in the history
Merge pull request from GHSA-w2gc-v2gm-q7wq
  • Loading branch information
trasher committed Jun 28, 2022
1 parent a723bb1 commit 21ae07d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/Auth.php
Expand Up @@ -736,19 +736,16 @@ public function login($login_name, $login_password, $noauto = false, $remember_m
if ($login_auth == 'local') {
$authtype = self::DB_GLPI;
$this->user->fields["authtype"] = self::DB_GLPI;
} else if (strstr($login_auth, '-')) {
$auths = explode('-', $login_auth);
$this->user->fields["auths_id"] = $auths[1];
if ($auths[0] == 'ldap') {
} else if (preg_match('/^(?<type>ldap|mail|external)-(?<id>\d+)$/', $login_auth, $auth_matches)) {
$this->user->fields["auths_id"] = (int)$auth_matches['id'];
if ($auth_matches['type'] == 'ldap') {
$authtype = self::LDAP;
$this->user->fields["authtype"] = self::LDAP;
} else if ($auths[0] == 'mail') {
} else if ($auth_matches['type'] == 'mail') {
$authtype = self::MAIL;
$this->user->fields["authtype"] = self::MAIL;
} else if ($auths[0] == 'external') {
} else if ($auth_matches['type'] == 'external') {
$authtype = self::EXTERNAL;
$this->user->fields["authtype"] = self::EXTERNAL;
}
$this->user->fields['authtype'] = $authtype;
}
if (!$noauto && ($authtype = self::checkAlternateAuthSystems())) {
if (
Expand Down

0 comments on commit 21ae07d

Please sign in to comment.