| Conditions | 5 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | protected function resolveBindException(): string |
||
| 29 | { |
||
| 30 | ldap_get_option( |
||
| 31 | $this->adapter->getConnection()->getResource(), |
||
|
|
|||
| 32 | LDAP_OPT_DIAGNOSTIC_MESSAGE, |
||
| 33 | $message, |
||
| 34 | ); |
||
| 35 | |||
| 36 | $result = InvalidCredentialResult::fromDiagnosticMessage($message); |
||
| 37 | if ($result->isInvalidCredential()) { |
||
| 38 | return self::ERR_WRONG_PASS; |
||
| 39 | } elseif ($result->isPasswordError()) { |
||
| 40 | return self::ERR_PASSWORD_RESET; |
||
| 41 | } elseif ($result->isAccountError()) { |
||
| 42 | return self::ERR_ACCOUNT_RESET; |
||
| 43 | } elseif ($result->isRestricted()) { |
||
| 44 | return self::ERR_LOGON_RESTRICTION; |
||
| 45 | } |
||
| 46 | |||
| 47 | // default to the wrong user pass |
||
| 48 | return self::ERR_WRONG_PASS; |
||
| 49 | } |
||
| 51 |