summaryrefslogtreecommitdiff
path: root/dns.php
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2017-04-12 21:58:51 +0100
committerLuke Bratch <luke@bratch.co.uk>2017-04-12 21:58:51 +0100
commit837cfa1cc437dd7a618237426f198c635f500b01 (patch)
treecc3d628486aec8e5321692a08a3b2e3c21b41e67 /dns.php
parent03229527e1cd42fa2dc2dce39660b481041a7903 (diff)
Move some duplicated configuration variables to outside individual functions
Diffstat (limited to 'dns.php')
-rw-r--r--dns.php9
1 files changed, 3 insertions, 6 deletions
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");
}