make sure the password expiry is set on account creation if it needs to be

This commit is contained in:
james 2005-02-16 20:12:59 +00:00
parent 12c514d8c5
commit adb2e50578
2 changed files with 7 additions and 6 deletions

View File

@ -41,7 +41,12 @@
}
else
{
mysql_query("INSERT INTO judges (email,password,created) VALUES ('".$_SESSION['email']."','".$_POST['pass1']."',NOW())");
if($config['judges_password_expiry_days']>0)
$ex="DATE_ADD(CURDATE(),INTERVAL ".$config['judges_password_expiry_days']." DAY)";
else
$ex="NULL";
mysql_query("INSERT INTO judges (email,password,created,lastlogin,passwordexpiry) VALUES ('".$_SESSION['email']."','".$_POST['pass1']."',NOW(),NOW(),$ex)");
$id=mysql_insert_id();
$_SESSION['judges_id']=$id;

View File

@ -58,14 +58,10 @@
else
{
if($config['judges_password_expiry_days']>0)
{
$ex="passwordexpiry=DATE_ADD(CURDATE(),INTERVAL ".$config['judges_password_expiry_days']." DAY)";
}
else
{
$ex="passwordexpiry=NULL";
}
mysql_query("UPDATE judges SET password='".$_POST['pass1']."', $ex WHERE id='".$_SESSION['judges_id']."' AND email='".$_SESSION['email']."'");
echo happy(i18n("Password successfully changed"));
if($_SESSION['judges_password_expired'])