mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Password can now contain any characters
Also added limit of 29 characters (client limitation)
This commit is contained in:
parent
ff9e255f1b
commit
40722c8c30
@ -147,18 +147,8 @@ class Validator
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($password) < 8 || strlen($password) > 30) {
|
if (strlen($password) < 8 || strlen($password) > 29) {
|
||||||
self::$lastError = 'The password must have at least 8 and maximum 30 letters!';
|
self::$lastError = 'The password must have at least 8 and maximum 29 letters!';
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(strspn($password, "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890") != strlen($password)) {
|
|
||||||
self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).';
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!ctype_alnum($password)) {
|
|
||||||
self::$lastError = 'Password contains illegal letters (a-z, A-Z and 0-9 only!).';
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +158,7 @@ class Validator
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!preg_match('/[0-9]/', $password)) {
|
if(!preg_match('/[0-9]/', $password)) {
|
||||||
self::$lastError = 'The password must contain at least one letter other than A-Z or a-z!';
|
self::$lastError = 'The password must contain at least one number!';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@
|
|||||||
<span{% if errors.password is defined %} class="red"{% endif %}>Password:</span>
|
<span{% if errors.password is defined %} class="red"{% endif %}>Password:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="password" id="password" value="" size="30" maxlength="50" />
|
<input type="password" name="password" id="password" value="" size="30" maxlength="29" />
|
||||||
<img id="password_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
<img id="password_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
<span{% if errors.password is defined %} class="red"{% endif %}>Repeat password:</span>
|
<span{% if errors.password is defined %} class="red"{% endif %}>Repeat password:</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="password2" id="password2" value="" size="30" maxlength="50" />
|
<input type="password" name="password2" id="password2" value="" size="30" maxlength="29" />
|
||||||
<img id="password2_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
<img id="password2_indicator" src="images/global/general/{% if not save or errors.password is defined %}n{% endif %}ok.gif" style="display: none;" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user