diff options
author | Michael Tänzer <neo@nhng.de> | 2013-08-14 21:37:38 +0200 |
---|---|---|
committer | Michael Tänzer <neo@nhng.de> | 2013-08-14 21:37:38 +0200 |
commit | acd4f0f92cc29cd3c622d11fc2f5e61c97401a51 (patch) | |
tree | f230024f3ae066ec544b7dd98fc93ca14ce57fad | |
parent | 945f334cc612b6f853d926163815f71242ea342a (diff) | |
download | cacert-devel-bug-893.tar.gz cacert-devel-bug-893.tar.xz cacert-devel-bug-893.zip |
bug 893: domaincerts has no column memid, it has to be referenced via domainsbug-893
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r-- | includes/notary.inc.php | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php index 819fb0b..2dda1c1 100644 --- a/includes/notary.inc.php +++ b/includes/notary.inc.php @@ -993,11 +993,29 @@ // called from includes/account.php if($oldid == 50 && $process != "") $uid = intval($uid); if (0==$cca) { - $query1 = "select 1 from `domaincerts` where `memid`='$uid' and `expire`>NOW() and `revoked`<`created`"; - $query2 = "select 1 from `domaincerts` where `memid`='$uid' and `revoked`>NOW()"; + $query1 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `domaincerts`.`expire` > NOW() + and `domaincerts`.`revoked` < `domaincerts`.`created`"; + $query2 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `revoked`>NOW()"; }else{ - $query1 = "select 1 from `domaincerts` where `memid`='$uid' and `expire`>(NOW()-90*86400) and `revoked`<`created`"; - $query2 = "select 1 from `domaincerts` where `memid`='$uid' and `revoked`>(NOW()-90*86400)"; + $query1 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `expire`>(NOW()-90*86400) + and `revoked`<`created`"; + $query2 = " + select 1 from `domaincerts` join `domains` + on `domaincerts`.`domid` = `domains`.`id` + where `domains`.`memid` = '$uid' + and `revoked`>(NOW()-90*86400)"; } $res = mysql_query($query1); $r1 = mysql_num_rows($res)>0; |