AuthImapPhp.php (mrbs-1.9.4) | : | AuthImapPhp.php (mrbs-1.10.0) | ||
---|---|---|---|---|
skipping to change at line 41 | skipping to change at line 41 | |||
* $auth["imap_php"]["novalidate-cert"] = TRUE; | * $auth["imap_php"]["novalidate-cert"] = TRUE; | |||
* | * | |||
* Then, you may configure admin users: | * Then, you may configure admin users: | |||
* | * | |||
* $auth["admin"][] = "imapuser1"; | * $auth["admin"][] = "imapuser1"; | |||
* $auth["admin"][] = "imapuser2"; | * $auth["admin"][] = "imapuser2"; | |||
*/ | */ | |||
class AuthImapPhp extends Auth | class AuthImapPhp extends Auth | |||
{ | { | |||
/* authValidateUser($user, $pass) | /* validateUser($user, $pass) | |||
* | * | |||
* Checks if the specified username/password pair are valid | * Checks if the specified username/password pair are valid | |||
* | * | |||
* $user - The user name | * $user - The user name | |||
* $pass - The password | * $pass - The password | |||
* | * | |||
* Returns: | * Returns: | |||
* false - The pair are invalid or do not exist | * false - The pair are invalid or do not exist | |||
* string - The validated username | * string - The validated username | |||
*/ | */ | |||
public function validateUser($user, $pass) | public function validateUser(?string $user, ?string $pass) | |||
{ | { | |||
global $auth; | global $auth; | |||
// If required, check that the username is from the permitted domain | // If required, check that the username is from the permitted domain | |||
if (isset($auth['imap_php']['user_domain'])) | if (isset($auth['imap_php']['user_domain'])) | |||
{ | { | |||
if (!filter_var($user, FILTER_VALIDATE_EMAIL)) | if (!filter_var($user, FILTER_VALIDATE_EMAIL)) | |||
{ | { | |||
return false; | return false; | |||
} | } | |||
skipping to change at line 110 | skipping to change at line 110 | |||
if ($mbox !== false) | if ($mbox !== false) | |||
{ | { | |||
imap_close($mbox); | imap_close($mbox); | |||
return $user; | return $user; | |||
} | } | |||
return false; | return false; | |||
} | } | |||
// Checks whether validation of a user by email address is possible and allowe d. | // Checks whether validation of a user by email address is possible and allowe d. | |||
public function canValidateByEmail() | public function canValidateByEmail() : bool | |||
{ | { | |||
return true; | return true; | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |