[feladat @ 87]
authorrejo
Mon, 13 Aug 2007 22:05:06 +0000
changeset 40 ee5300058c9d
parent 39 7c2b82bff121
child 41 48f2ac49ec24
[feladat @ 87] Bugfix. With user level 5 or 10 and lots of zones without an owner, like slave zones that are inserted by a supermaster, the "list all zones" view was broken (not all zones shown, but "show page" and "show letters" were missing as well). Function zone_count matches zones and domains table, but users with level 5 or 10 are allowed to see zones without an entry in the zones table as well.
inc/record.inc.php
--- a/inc/record.inc.php	Thu Jul 26 14:31:38 2007 +0000
+++ b/inc/record.inc.php	Mon Aug 13 22:05:06 2007 +0000
@@ -1032,7 +1032,14 @@
            $add .=" AND substring(domains.name,1,1) REGEXP '^[[:digit:]]'";
         }
 
-        $query = 'SELECT count(distinct zones.domain_id) as zone_count FROM zones, domains WHERE zones.domain_id = domains.id '.$add;
+        if (level(5))
+        {
+                $query = 'SELECT count(distinct domains.id) as zone_count FROM domains WHERE 1 '.$add;
+        }
+        else
+        {
+                $query = 'SELECT count(distinct zones.domain_id) as zone_count FROM zones, domains WHERE zones.domain_id = domains.id '.$add;
+        }
         $numRows = $db->queryOne($query);
         return $numRows;
 }