From 18ffb1b78102adfed91ca249ba2e7427c7c61197 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 5 Oct 2024 09:55:10 +0200 Subject: [PATCH] Fix server cert expiry queries Addresses #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 a47da52..fa8580f 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -1273,19 +1273,19 @@ 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 `revoked`>NOW()"; - }else{ + and `domaincerts`.`revoked` > NOW()"; + } else { $query1 = " select 1 from `domaincerts` join `domains` on `domaincerts`.`domid` = `domains`.`id` where `domains`.`memid` = '$uid' - and `expire`>( SUBDATE( NOW(), 90 )) - and `revoked`<`created`"; + and `domaincerts`.`expire` > ( SUBDATE( NOW(), 90 )) + and `domaincerts`.`revoked` < `domaincerts`.`created`"; $query2 = " select 1 from `domaincerts` join `domains` on `domaincerts`.`domid` = `domains`.`id` where `domains`.`memid` = '$uid' - and `revoked`>( SUBDATE( NOW(), 90 ))"; + and `domaincerts`.`revoked` > ( SUBDATE( NOW(), 90 ))"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0;