| @@ 109-120 (lines=12) @@ | ||
| 106 | $username = $service->getUsernameByEmail($login); |
|
| 107 | ||
| 108 | // No user found with this email. |
|
| 109 | if (!$username) { |
|
| 110 | if (Config::inst()->get(self::class, 'fallback_authenticator') === 'yes') { |
|
| 111 | if ($fallbackMember = $this->fallbackAuthenticate($data, $request)) { |
|
| 112 | { |
|
| 113 | return $fallbackMember; |
|
| 114 | } |
|
| 115 | } |
|
| 116 | } |
|
| 117 | ||
| 118 | $result->addError(_t('LDAPAuthenticator.INVALIDCREDENTIALS', 'Invalid credentials')); |
|
| 119 | return null; |
|
| 120 | } |
|
| 121 | } else { |
|
| 122 | $username = $login; |
|
| 123 | } |
|
| @@ 126-137 (lines=12) @@ | ||
| 123 | } |
|
| 124 | $serviceAuthenticationResult = $service->authenticate($username, $data['Password']); |
|
| 125 | $success = $serviceAuthenticationResult['success'] === true; |
|
| 126 | if (!$success) { |
|
| 127 | if (Config::inst()->get(self::class, 'fallback_authenticator') === 'yes') { |
|
| 128 | $fallbackMember = $this->fallbackAuthenticate($data, $request); |
|
| 129 | if ($fallbackMember) { |
|
| 130 | return $fallbackMember; |
|
| 131 | } |
|
| 132 | } |
|
| 133 | ||
| 134 | $result->addError($serviceAuthenticationResult['message']); |
|
| 135 | ||
| 136 | return null; |
|
| 137 | } |
|
| 138 | ||
| 139 | $data = $service->getUserByUsername($serviceAuthenticationResult['identity']); |
|
| 140 | if (!$data) { |
|