summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2013-08-14 21:41:51 +0200
committerMichael Tänzer <neo@nhng.de>2013-08-14 21:41:51 +0200
commitf543973bfaa3ed1c393e4b1df022511b5c11e795 (patch)
tree5fc124a81dda70c710a20496c8fcb7e840a3e512 /includes
parent90a9b6b26dbef01dfc0c16a43cafb3e0636c3e25 (diff)
parentacd4f0f92cc29cd3c622d11fc2f5e61c97401a51 (diff)
downloadcacert-devel-f543973bfaa3ed1c393e4b1df022511b5c11e795.tar.gz
cacert-devel-f543973bfaa3ed1c393e4b1df022511b5c11e795.tar.xz
cacert-devel-f543973bfaa3ed1c393e4b1df022511b5c11e795.zip
Merge branch 'bug-893' into merge-bug-1177-893-1136-1123-1137
Diffstat (limited to 'includes')
-rw-r--r--includes/notary.inc.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/includes/notary.inc.php b/includes/notary.inc.php
index a662a5a..7db597b 100644
--- a/includes/notary.inc.php
+++ b/includes/notary.inc.php
@@ -978,11 +978,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;