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