aboutsummaryrefslogtreecommitdiff
path: root/app/Utils
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2020-03-08 00:14:29 +0100
committerGravatar GitHub <noreply@github.com> 2020-03-08 00:14:29 +0100
commit51edbc1578fe49b281b39d91451d2b9df0092028 (patch)
treed82c6181797cbebe38e7a6dc5934237dc6597b15 /app/Utils
parent128b3367880fd18e4179123b4e533d14902b484c (diff)
Improve login and registration pages (#2794)
* Keep the user on login page on failure * Show an error if username already exists * Check the password format in the backend * Return a better message if username is invalid * Add a title to the login page * wip: Improve look of login and register pages * Set a capital M in username help message On the registration page, username tip started with a minuscule, while the password tip started with a capital. * Change message if username is taken
Diffstat (limited to 'app/Utils')
-rw-r--r--app/Utils/passwordUtil.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/Utils/passwordUtil.php b/app/Utils/passwordUtil.php
index fd71d4b72..e382f76f5 100644
--- a/app/Utils/passwordUtil.php
+++ b/app/Utils/passwordUtil.php
@@ -24,4 +24,17 @@ class FreshRSS_password_Util {
return $passwordHash == '' ? '' : $passwordHash;
}
+
+ /**
+ * Verify the given password is valid.
+ *
+ * A valid password is a string of at least 7 characters.
+ *
+ * @param string $password
+ *
+ * @return boolean True if the password is valid, false otherwise
+ */
+ public static function check($password) {
+ return strlen($password) >= 7;
+ }
}