From adb2e5057814e5f91f1532895a3736e3dd25dc21 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 16 Feb 2005 20:12:59 +0000 Subject: [PATCH] make sure the password expiry is set on account creation if it needs to be --- register_judges.php | 7 ++++++- register_judges_password.php | 6 +----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/register_judges.php b/register_judges.php index 46235cd..314f58d 100644 --- a/register_judges.php +++ b/register_judges.php @@ -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; diff --git a/register_judges_password.php b/register_judges_password.php index 16093ac..5ab8a5b 100644 --- a/register_judges_password.php +++ b/register_judges_password.php @@ -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'])