From 56c3a8a391ed5d874b8dbae43bacf3bf66e329eb Mon Sep 17 00:00:00 2001 From: Brian Mc Cullough Date: Mon, 30 Sep 2024 08:32:38 +0200 Subject: [PATCH] Fix user deletion Fixes #1544 --- includes/notary.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 3b8e736..a47da52 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -1234,7 +1234,7 @@ function get_user_agreements($memid, $type=null, $active=null){ if (0==$cca) { $query = "select 1 from `gpg` where `memid`='$uid' and `expire`>NOW()"; }else{ - $query = "select 1 from `gpg` where `memid`='$uid' and `expire`>(NOW()-90*86400)"; + $query = "select 1 from `gpg` where `memid`='$uid' and `expire`>( SUBDATE( NOW(), 90 ))"; } $res = mysql_query($query); return mysql_num_rows($res) > 0; @@ -1248,8 +1248,8 @@ function get_user_agreements($memid, $type=null, $active=null){ $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>NOW() and `revoked`<`created`"; $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>NOW()"; }else{ - $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>(NOW()-90*86400) and `revoked`<`created`"; - $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>(NOW()-90*86400)"; + $query1 = "select 1 from `emailcerts` where `memid`='$uid' and `expire`>( SUBDATE( NOW(), 90 )) and `revoked`<`created`"; + $query2 = "select 1 from `emailcerts` where `memid`='$uid' and `revoked`>( SUBDATE( NOW(), 90 ))"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0; @@ -1279,13 +1279,13 @@ function get_user_agreements($memid, $type=null, $active=null){ select 1 from `domaincerts` join `domains` on `domaincerts`.`domid` = `domains`.`id` where `domains`.`memid` = '$uid' - and `expire`>(NOW()-90*86400) + and `expire`>( SUBDATE( NOW(), 90 )) and `revoked`<`created`"; $query2 = " select 1 from `domaincerts` join `domains` on `domaincerts`.`domid` = `domains`.`id` where `domains`.`memid` = '$uid' - and `revoked`>(NOW()-90*86400)"; + and `revoked`>( SUBDATE( NOW(), 90 ))"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0;