From 14e6f444952d937aa58da499085ded6d3b76b681 Mon Sep 17 00:00:00 2001 From: Henk Kraal Date: Fri, 6 Mar 2015 15:25:20 +0100 Subject: [PATCH] Detect lack of SQLite3 support in PHP + minor spelling fixes. --- includes/misc.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/includes/misc.inc.php b/includes/misc.inc.php index 0266fff..ca8fd0f 100644 --- a/includes/misc.inc.php +++ b/includes/misc.inc.php @@ -5,7 +5,7 @@ include('config.inc.php'); $blocklogin = FALSE; if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport))) { - $errormsg = "You need to configure your the setting for using the PowerDNS API"; + $errormsg = "You need to configure your settings for the PowerDNS API"; $blocklogin = TRUE; } @@ -15,7 +15,7 @@ if (!isset($authmethod) or !preg_match('/^(xapikey|userpass|auto)$/', $authmetho } if (!isset($authdb)) { - $errormsg = "You did not configure a value for the setting \$authdb in yor config"; + $errormsg = "You did not configure a value for the setting \$authdb in your config"; $blocklogin = TRUE; } @@ -26,9 +26,14 @@ if (function_exists('curl_init') === FALSE) { $blocklogin = TRUE; } +if (class_exists('SQLite3') === FALSE) { + $errormsg = "You need PHP SQLite3 to run nsedit"; + $blocklogin = TRUE; +} + $defaults['defaulttype'] = ucfirst(strtolower($defaults['defaulttype'])); -if (isset($authdb) && !file_exists($authdb)) { +if (isset($authdb) && !file_exists($authdb) && class_exists('SQLite3')) { is_dir(dirname($authdb)) || mkdir(dirname($authdb)); $db = new SQLite3($authdb, SQLITE3_OPEN_CREATE|SQLITE3_OPEN_READWRITE); $createsql = file_get_contents('includes/scheme.sql');