We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a7a297 commit b0a286fCopy full SHA for b0a286f
classes/BadpwFailedLoginsDAO.php
@@ -58,6 +58,17 @@ public function deleteObject(BadpwFailedLogins $badpwObj) : bool {
58
* @return BadpwFailedLogins object Object matching the username
59
*/
60
public function getByUsername(string $username) : ?BadpwFailedLogins {
61
+ // Verify if the username is an email
62
+ if (filter_var($username, FILTER_VALIDATE_EMAIL)) {
63
+ $user = Repo::user()->getByEmail($username);
64
+ if (!$user) {
65
+ return null;
66
+ }
67
+ $username = $user->getData('userName');
68
+ } elseif (strlen($username) > 32) { // Invalid username length
69
70
71
+
72
$result = $this->retrieve('
73
SELECT *
74
FROM badpw_failedlogins
0 commit comments