X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fpreferences.php;h=77ad8671d6ff383cc59ff6790ac92ae8efa9128b;hp=03821932f282946f4c6f0aee2c03a4a04a645bc7;hb=2666bb58429c385b716d2ffd5d5fe9a9e7af4f45;hpb=cd4cbd4a1cce2c35a6a78b1b957c17389001b4b1 diff --git a/include/preferences.php b/include/preferences.php index 0382193..77ad867 100644 --- a/include/preferences.php +++ b/include/preferences.php @@ -18,7 +18,7 @@ $changed_cards = 0; $changed_timezone = 0; $changed_autosetup = 0; -display_user_menu(); +display_user_menu($myid); /* get old infos */ $PREF = DB_get_PREF($myid); @@ -103,10 +103,14 @@ if(myisset("password0") && $_REQUEST["password0"]!="" ) 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; + /* 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"]). @@ -182,6 +186,9 @@ echo " Password(old): ", ""; 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;