|
@@ 146-152 (lines=7) @@
|
| 143 |
|
$message = $messages[0]; // first message is user readable, suitable for showing on login form |
| 144 |
|
|
| 145 |
|
// show better errors than the defaults for various status codes returned by LDAP |
| 146 |
|
if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_ACCOUNT_LOCKED_OUT') !== false) { |
| 147 |
|
$message = _t( |
| 148 |
|
'LDAPService.ACCOUNTLOCKEDOUT', |
| 149 |
|
'Your account has been temporarily locked because of too many failed login attempts. ' . |
| 150 |
|
'Please try again later.' |
| 151 |
|
); |
| 152 |
|
} |
| 153 |
|
if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_LOGON_FAILURE') !== false) { |
| 154 |
|
$message = _t( |
| 155 |
|
'LDAPService.INVALIDCREDENTIALS', |
|
@@ 153-158 (lines=6) @@
|
| 150 |
|
'Please try again later.' |
| 151 |
|
); |
| 152 |
|
} |
| 153 |
|
if (!empty($messages[1]) && strpos($messages[1], 'NT_STATUS_LOGON_FAILURE') !== false) { |
| 154 |
|
$message = _t( |
| 155 |
|
'LDAPService.INVALIDCREDENTIALS', |
| 156 |
|
'The provided details don\'t seem to be correct. Please try again.' |
| 157 |
|
); |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
return [ |
| 161 |
|
'success' => $result->getCode() === 1, |