# HG changeset patch # User rejo # Date 1211113696 0 # Node ID 2a10febd6af92fa1ba7ac8e2dcbf279636aeb3fd # Parent 391e744a1def35850dfb8b5a7259ea44cbe87ad4 [feladat @ 278] Added user configurable option to show serial of zone in zone listing. Closes: #53. diff -r 391e744a1def -r 2a10febd6af9 inc/config-me.inc.php --- a/inc/config-me.inc.php Sun May 18 11:51:59 2008 +0000 +++ b/inc/config-me.inc.php Sun May 18 12:28:16 2008 +0000 @@ -12,6 +12,7 @@ $iface_style = "example"; $iface_rowamount = "50"; $iface_expire = "1800"; +$iface_zonelist_serial = "0"; $dns_hostmaster = ""; $dns_ns1 = ""; diff -r 391e744a1def -r 2a10febd6af9 inc/record.inc.php --- a/inc/record.inc.php Sun May 18 11:51:59 2008 +0000 +++ b/inc/record.inc.php Sun May 18 12:28:16 2008 +0000 @@ -1049,6 +1049,19 @@ } } +function get_serial_by_zid($zid) { + global $db; + if (is_numeric($zid)) { + $query = "SELECT content FROM records where TYPE = 'SOA' and domain_id = " . $db->quote($zid); + $rr_soa = $db->queryOne($query); + if (PEAR::isError($rr_soa)) { error($rr_soa->getMessage()); return false; } + $rr_soa_fields = explode(" ", $rr_soa); + } else { + error(sprintf(ERR_INV_ARGC, "get_serial_by_zid", "id must be a number")); + return false; + } + return $rr_soa_fields[2]; +} function validate_account($account) { if(preg_match("/^[A-Z0-9._-]+$/i",$account)) { diff -r 391e744a1def -r 2a10febd6af9 list_zones.php --- a/list_zones.php Sun May 18 11:51:59 2008 +0000 +++ b/list_zones.php Sun May 18 12:28:16 2008 +0000 @@ -58,6 +58,7 @@ echo " " . _('Type') . "\n"; echo " " . _('Records') . "\n"; echo " " . _('Owner') . "\n"; + if ($iface_zonelist_serial == "1") echo " " . _('Serial') . "\n"; echo " \n"; if ($count_zones_view <= $iface_rowamount) { @@ -68,7 +69,8 @@ } foreach ($zones as $zone) { - $zone_owners = get_fullnames_owners_from_domainid($zone["id"]); + $zone_owners = get_fullnames_owners_from_domainid($zone['id']); + if ($iface_zonelist_serial == "1") $serial = get_serial_by_zid($zone['id']); echo " \n"; echo " \n"; @@ -84,6 +86,13 @@ echo " " . strtolower($zone["type"]) . "\n"; echo " " . $zone["count_records"] . "\n"; echo " " . $zone_owners . "\n"; + if ($iface_zonelist_serial == "1") { + if ($serial != "") { + echo " " . $serial . "\n"; + } else { + echo "  \n"; + } + } echo " \n"; } echo " \n";