bug 893: domaincerts has no column memid, it has to be referenced via domains bug-893
authorMichael Tänzer <neo@nhng.de>
Wed, 14 Aug 2013 19:37:38 +0000 (21:37 +0200)
committerMichael Tänzer <neo@nhng.de>
Wed, 14 Aug 2013 19:37:38 +0000 (21:37 +0200)
Signed-off-by: Michael Tänzer <neo@nhng.de>
includes/notary.inc.php

index 819fb0b..2dda1c1 100644 (file)
                // 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;