summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
272e8bf)
added a check for the length of the new password, so that empty passwords are not allowed.
Signed-off-by: Arun Persaud <arun@nubati.net>
if(!( ($password == $oldpasswd) || DB_check_recovery_passwords($oldpasswd,$email) ))
$changed_password = -1;
if(!( ($password == $oldpasswd) || DB_check_recovery_passwords($oldpasswd,$email) ))
$changed_password = -1;
- /* check if new passwords are types the same twice */
+ /* check if new password has been typed in correctly */
if($_REQUEST["password1"] != $_REQUEST["password2"] )
$changed_password = -2;
if($_REQUEST["password1"] != $_REQUEST["password2"] )
$changed_password = -2;
+ /* check if new password is long enough */
+ if(strlen($_REQUEST["password1"])<4)
+ $changed_password = -3;
+
if($changed_password==1)
{
DB_query("UPDATE User SET password='".md5($_REQUEST["password1"]).
if($changed_password==1)
{
DB_query("UPDATE User SET password='".md5($_REQUEST["password1"]).
"<input type=\"password\" id=\"password0\" name=\"password0\" size=\"20\" maxlength=\"30\" />";
switch($changed_password)
{
"<input type=\"password\" id=\"password0\" name=\"password0\" size=\"20\" maxlength=\"30\" />";
switch($changed_password)
{
+ case '-3':
+ echo "The new passwords is not long enough (you need at least 4 characters).";
+ break;
case '-2':
echo "The new passwords don't match.";
break;
case '-2':
echo "The new passwords don't match.";
break;