From 574db00d94adc38c1c2ba5a0de36a5ed3dc7f255 Mon Sep 17 00:00:00 2001
From: Mark Schouten <mark@tuxis.nl>
Date: Tue, 2 Aug 2016 14:15:57 +0200
Subject: [PATCH] Cleanup. We don't need this stuff for v4 anymore

---
 includes/config.inc.php-dist | 12 +-----------
 includes/misc.inc.php        | 18 +-----------------
 2 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/includes/config.inc.php-dist b/includes/config.inc.php-dist
index 093d9b0..dcb5a2b 100644
--- a/includes/config.inc.php-dist
+++ b/includes/config.inc.php-dist
@@ -1,24 +1,14 @@
 <?php
 
-$apiuser = '';           # The PowerDNS API username. Leave empty for authmethod='xapikey' (see AUTHENTICATION)
-$apipass = '';           # The PowerDNS API-user password or the PowerDNS-API key (see AUTHENTICATION)
+$apipass = '';           # The PowerDNS API-key
 $apiip   = '';           # The IP of the PowerDNS API
 $apiport = '8081';       # The port of the PowerDNS API
-$apivers = 0;            # The version of the PowerDNS API. 0 == experimental, 1 = v1 (pdns 4.0)
 $apisid  = 'localhost';  # PowerDNS's :server_id
 $apiproto      = 'http'; # http | https
 $apisslverify  = FALSE;  # Verify SSL Certificate if using https for apiproto
 $allowzoneadd  = FALSE;  # Allow normal users to add zones
 
 
-### AUTHENTICATION ###
-# The first versions of the PowerDNS API used the standard webserver password
-# for authentication, newer versions use an X-API-Key mechanism. NSEdit tries
-# to autodetect the method you should use, but that does affect performance.
-# For optimal performance, configure the right method.
-# (Should be 'auto', 'xapikey' or 'userpass')
-$authmethod = 'auto';
-
 # If you configure this, nsedit will try to authenticate via WeFact too.
 # Debtors will be added to the sqlitedatabase with their crypted password.
 #$wefactapiurl = 'https://yourdomain/Pro/apiv2/api.php';
diff --git a/includes/misc.inc.php b/includes/misc.inc.php
index 41e407c..d626789 100644
--- a/includes/misc.inc.php
+++ b/includes/misc.inc.php
@@ -4,21 +4,11 @@ include('config.inc.php');
 
 $blocklogin = FALSE;
 
-if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport)) or (!isset($apivers) or is_null($apivers))) {
+if ((!isset($apipass) or empty($apipass)) or (!isset($apiip) or empty($apiip)) or (!isset($apiport) or empty($apiport))) {
     $errormsg = 'You need to configure your settings for the PowerDNS API. See <a href="doc/apiconf.txt">doc/apiconf.txt</a>';
     $blocklogin = TRUE;
 }
 
-if (!preg_match('/^[01]$/', $apivers)) {
-    $errormsg = "The value for \$apivers is incorrect your config";
-    $blocklogin = TRUE;
-}
-
-if (!isset($authmethod) or !preg_match('/^(xapikey|userpass|auto)$/', $authmethod)) {
-    $errormsg = "The value for \$authmethod is incorrect in your config";
-    $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;
@@ -51,12 +41,6 @@ if (!isset($logo) or empty($logo)) {
 
 /* No need to change stuf below */
 
-if ($apivers == 0) {
-    $apipath = "";
-} elseif ($apivers == 1) {
-    $apipath = "/api/v1";
-}
-
 if (function_exists('curl_init') === FALSE) {
     $errormsg = "You need PHP Curl to run nsedit";
     $blocklogin = TRUE;