| @@ 88-98 (lines=11) @@ | ||
| 85 | $username = $service->getUsernameByEmail($login); |
|
| 86 | ||
| 87 | // No user found with this email. |
|
| 88 | if (!$username) { |
|
| 89 | if (Config::inst()->get('LDAPAuthenticator', 'fallback_authenticator') === 'yes') { |
|
| 90 | $fallbackMember = self::fallback_authenticate($data, $form); |
|
| 91 | if ($fallbackMember) { |
|
| 92 | return $fallbackMember; |
|
| 93 | } |
|
| 94 | } |
|
| 95 | ||
| 96 | $form->sessionMessage(_t('LDAPAuthenticator.INVALIDCREDENTIALS', 'Invalid credentials'), 'bad'); |
|
| 97 | return; |
|
| 98 | } |
|
| 99 | } else { |
|
| 100 | $username = $login; |
|
| 101 | } |
|
| @@ 105-117 (lines=13) @@ | ||
| 102 | ||
| 103 | $result = $service->authenticate($username, $data['Password']); |
|
| 104 | $success = $result['success'] === true; |
|
| 105 | if (!$success) { |
|
| 106 | if (Config::inst()->get('LDAPAuthenticator', 'fallback_authenticator') === 'yes') { |
|
| 107 | $fallbackMember = self::fallback_authenticate($data, $form); |
|
| 108 | if ($fallbackMember) { |
|
| 109 | return $fallbackMember; |
|
| 110 | } |
|
| 111 | } |
|
| 112 | ||
| 113 | if ($form) { |
|
| 114 | $form->sessionMessage($result['message'], 'bad'); |
|
| 115 | } |
|
| 116 | return; |
|
| 117 | } |
|
| 118 | ||
| 119 | $data = $service->getUserByUsername($result['identity']); |
|
| 120 | if (!$data) { |
|