Skip to content
Snippets Groups Projects
Verified Commit 847d7e2e authored by Cyaniventer's avatar Cyaniventer
Browse files

Let users choose anything as their password

Forcing users to use at least one letter and number is bad practice and
you should let users choose anything as their password as long as it is
greater than 7 characters.

Current Password Policy

- should be greater than 7 characters
parent fe14e9ad
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<h3>password</h3> <h3>password</h3>
<input type='password' name='password' required><br> <input type='password' name='password' required><br>
<code>must be longer than 7 characters, should include at least letter & number.</code> <code>must be longer than 7 characters.</code>
<h3>email</h3> <h3>email</h3>
<input type='email' name='email' maxlength='256'><br> <input type='email' name='email' maxlength='256'><br>
......
...@@ -96,12 +96,14 @@ ...@@ -96,12 +96,14 @@
if (strlen($_POST['password']) < 7) { if (strlen($_POST['password']) < 7) {
echo "<p class='reply'>your password must be longer than 7 characters. $errorMsg"; echo "<p class='reply'>your password must be longer than 7 characters. $errorMsg";
exit; } exit; }
/**
if (!preg_match("#[0-9]+#", $_POST['password'])) { if (!preg_match("#[0-9]+#", $_POST['password'])) {
echo "<p class='reply'>your password must include at least one number. $errorMsg"; echo "<p class='reply'>your password must include at least one number. $errorMsg";
exit; } exit; }
if (!preg_match("#[a-zA-Z]+#", $_POST['password'])) { if (!preg_match("#[a-zA-Z]+#", $_POST['password'])) {
echo "<p class='reply'>your password must include at least one letter. $errorMsg"; echo "<p class='reply'>your password must include at least one letter. $errorMsg";
exit; } exit; }
*/
//password, username checks are complete //password, username checks are complete
$options = [ $options = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment