From 837cfa1cc437dd7a618237426f198c635f500b01 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Wed, 12 Apr 2017 21:58:51 +0100 Subject: Move some duplicated configuration variables to outside individual functions --- dns.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'dns.php') diff --git a/dns.php b/dns.php index fa4a1fc..71ad361 100644 --- a/dns.php +++ b/dns.php @@ -3,6 +3,9 @@ ini_set("display_errors", 1); ini_set("display_startup_errors", 1); error_reporting(E_ALL); +$zoneroot = "/var/bind/pri/"; +$zonesuffix = ".zone"; + function sshrun($command) { $host = "misc.tghost.co.uk"; $user = "bladns.net"; @@ -20,9 +23,6 @@ function sshrun($command) { } function getzone($domain, $password) { - $zoneroot = "/var/bind/pri/"; - $zonesuffix = ".zone"; - if (!preg_match('/^[0-9A-Za-z\.\-]*$/', $_POST['domain'])) { die("invalid domain"); } @@ -40,9 +40,6 @@ function getzone($domain, $password) { } function writezone($domain, $password, $zonetext) { - $zoneroot = "/var/bind/pri/"; - $zonesuffix = ".zone"; - if (!preg_match('/^[0-9A-Za-z\.\-]*$/', $_POST['domain'])) { die("invalid domain"); } -- cgit v1.2.3