# HG changeset patch # User rejo # Date 1187042706 0 # Node ID ee5300058c9df8e7d78326f4d0a790a41cd4bd91 # Parent 7c2b82bff121291e8cd5b9e93fa7b5d8e7cff84f [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. diff -r 7c2b82bff121 -r ee5300058c9d 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; }