From 1bbde37c3767eeb0fefa4bde49df975759089509 Mon Sep 17 00:00:00 2001 From: Stricted Date: Fri, 20 Feb 2015 07:57:34 +0100 Subject: [PATCH] change icon positions and add possibility to disable dnssec globally --- database.sql | 2 +- lib/page/SecListPage.class.php | 2 +- .../cache/builder/DNSApiCacheBuilder.class.php | 12 +++++++----- templates/default/index.tpl | 10 ++++------ templates/default/recordList.tpl | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/database.sql b/database.sql index 422514a..fb01195 100644 --- a/database.sql +++ b/database.sql @@ -90,7 +90,7 @@ INSERT INTO dns_options VALUES (8, 'dns_soa_refresh', '28800'); INSERT INTO dns_options VALUES (9, 'dns_soa_retry', '7200'); INSERT INTO dns_options VALUES (10, 'dns_soa_expire', '604800'); INSERT INTO dns_options VALUES (11, 'dns_soa_minimum_ttl', '60'); - +INSERT INTO dns_options VALUES (12, 'enable_dnssec', '1'); INSERT INTO `dns_user` VALUES (1, 'admin', 'example@example.net', '$2a$08$XfcfTGc1LlmOHWUt/2sfNeFLEwqESy6wmrIIJMyQS1j5pwembqiae', '0', '2'); diff --git a/lib/page/SecListPage.class.php b/lib/page/SecListPage.class.php index 4363eab..62b7189 100644 --- a/lib/page/SecListPage.class.php +++ b/lib/page/SecListPage.class.php @@ -12,7 +12,7 @@ class SecListPage extends AbstractPage { public $activeMenuItem = 'index'; public function prepare() { - if (!isset($_GET['id']) || empty($_GET['id'])) { + if (!isset($_GET['id']) || empty($_GET['id']) || !ENABLE_DNSSEC) { throw new \Exception('The link you are trying to reach is no longer available or invalid.', 404); } diff --git a/lib/system/cache/builder/DNSApiCacheBuilder.class.php b/lib/system/cache/builder/DNSApiCacheBuilder.class.php index c4cdfff..97d7346 100644 --- a/lib/system/cache/builder/DNSApiCacheBuilder.class.php +++ b/lib/system/cache/builder/DNSApiCacheBuilder.class.php @@ -34,11 +34,13 @@ class DNSApiCacheBuilder extends AbstractCacheBuilder { $data[$zone['origin']]['rr'][] = $rr; } - /* dnssec keys */ - $sql3 = "SELECT * FROM dns_sec where zone = ? and active = ?"; - $statement3 = DNS::getDB()->query($sql3, array($zone['id'], 1)); - while ($sec = DNS::getDB()->fetch_array($statement3)) { - $data[$zone['origin']]['sec'][] = $sec; + if (ENABLE_DNSSEC) { + /* dnssec keys */ + $sql3 = "SELECT * FROM dns_sec where zone = ? and active = ?"; + $statement3 = DNS::getDB()->query($sql3, array($zone['id'], 1)); + while ($sec = DNS::getDB()->fetch_array($statement3)) { + $data[$zone['origin']]['sec'][] = $sec; + } } } diff --git a/templates/default/index.tpl b/templates/default/index.tpl index 3426b6e..77f407d 100644 --- a/templates/default/index.tpl +++ b/templates/default/index.tpl @@ -30,7 +30,7 @@ Name Serial Records - Manage + {if $isReseller === true || $smarty.const.ENABLE_DNSSEC}Manage{/if} @@ -43,11 +43,9 @@ {$domain['serial']} {$domain['rrc']} - {if $isReseller === true} - - - {/if} - + {if $isReseller === true} {/if} + {if $smarty.const.ENABLE_DNSSEC} {/if} + {if $isReseller === true}{/if} {/foreach} diff --git a/templates/default/recordList.tpl b/templates/default/recordList.tpl index 9b7b157..c5c0e8e 100644 --- a/templates/default/recordList.tpl +++ b/templates/default/recordList.tpl @@ -47,9 +47,9 @@ {$record['aux']} {if $record['data']|strlen > 40}{$record['data']|substr:0:40}…{else}{$record['data']}{/if} - - + + {/foreach} -- 2.20.1