diff options
author | Luke Bratch <luke@bratch.co.uk> | 2017-04-12 21:58:51 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2017-04-12 21:58:51 +0100 |
commit | 837cfa1cc437dd7a618237426f198c635f500b01 (patch) | |
tree | cc3d628486aec8e5321692a08a3b2e3c21b41e67 | |
parent | 03229527e1cd42fa2dc2dce39660b481041a7903 (diff) |
Move some duplicated configuration variables to outside individual functions
-rw-r--r-- | dns.php | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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"); } |