From a8fadba0e0c05e659b9155adcb6aecaff5595423 Mon Sep 17 00:00:00 2001 From: Mark Schouten Date: Fri, 17 Apr 2015 15:17:25 +0200 Subject: [PATCH] Check for newly added configuration options Fix typo in default config file Closes #40 --- includes/config.inc.php-dist | 2 +- includes/misc.inc.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/includes/config.inc.php-dist b/includes/config.inc.php-dist index 96e0ce8..c155a6e 100644 --- a/includes/config.inc.php-dist +++ b/includes/config.inc.php-dist @@ -6,7 +6,7 @@ $apiip = ''; # The IP of the PowerDNS API $apiport = '8081'; # The port of the PowerDNS API $apisid = 'localhost'; # PowerDNS's :server_id $apiproto = 'http'; # http | https -$apisslsverify = FALSE; # Verify SSL Certificate if using https for apiproto +$apisslverify = FALSE; # Verify SSL Certificate if using https for apiproto $allowzoneadd = FALSE; # Allow normal users to add zones diff --git a/includes/misc.inc.php b/includes/misc.inc.php index ca8fd0f..e810d28 100644 --- a/includes/misc.inc.php +++ b/includes/misc.inc.php @@ -14,6 +14,16 @@ if (!isset($authmethod) or !preg_match('/^(xapikey|userpass|auto)$/', $authmetho $blocklogin = TRUE; } +if (!isset($apiproto) or !preg_match('/^http(s)?$/', $apiproto)) { + $errormsg = "The value for \$apiproto is incorrect in your config. Did you configure it?"; + $blocklogin = TRUE; +} + +if (!isset($apisslverify) or !preg_match('/^[01]$/', $apisslverify)) { + $errormsg = "The value for \$apisslverify is incorrect in your config. Did you configure it?"; + $blocklogin = TRUE; +} + if (!isset($authdb)) { $errormsg = "You did not configure a value for the setting \$authdb in your config"; $blocklogin = TRUE;