forked from science-ation/science-ation
make sure the password expiry is set on account creation if it needs to be
This commit is contained in:
parent
12c514d8c5
commit
adb2e50578
@ -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;
|
||||
|
||||
|
@ -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'])
|
||||
|
Loading…
Reference in New Issue
Block a user