diff --git a/includes/config.inc.php-dist b/includes/config.inc.php-dist index dcb5a2b..51f0bdd 100644 --- a/includes/config.inc.php-dist +++ b/includes/config.inc.php-dist @@ -3,10 +3,10 @@ $apipass = ''; # The PowerDNS API-key $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 $apisslverify = FALSE; # Verify SSL Certificate if using https for apiproto $allowzoneadd = FALSE; # Allow normal users to add zones +$logging = TRUE; # If you configure this, nsedit will try to authenticate via WeFact too. @@ -41,8 +41,8 @@ $templates[] = array( $defaults['soa_edit'] = 'INCEPTION-INCREMENT'; $defaults['soa_edit_api'] = 'INCEPTION-INCREMENT'; $defaults['defaulttype'] = 'Master'; # Choose between 'Native' or 'Master' -$defaults['ns'][0] = 'unconfigured.primaryns'; # The value of the first NS-record -$defaults['ns'][1] = 'unconfigured.secondaryns'; # The value of the second NS-record +$defaults['ns'][0] = 'unconfigured.primaryns.'; # The value of the first NS-record +$defaults['ns'][1] = 'unconfigured.secondaryns.'; # The value of the second NS-record $defaults['ttl'] = 3600; # Default TTL for records $defaults['disabled'] = false; # Default disabled state diff --git a/includes/misc.inc.php b/includes/misc.inc.php index e0cfc2e..7041d0f 100644 --- a/includes/misc.inc.php +++ b/includes/misc.inc.php @@ -252,6 +252,10 @@ function user_template_names() { } function getlogs() { + global $logging; + if ($logging !== TRUE) + return; + $db = get_db(); $r = $db->query('SELECT * FROM logs ORDER BY timestamp DESC'); $ret = array(); @@ -263,6 +267,10 @@ function getlogs() { } function clearlogs() { + global $logging; + if ($logging !== TRUE) + return; + $db = get_db(); $q = $db->query('DELETE FROM logs;'); $db->close(); @@ -270,6 +278,10 @@ function clearlogs() { } function writelog($line) { + global $logging; + if ($logging !== TRUE) + return; + try { $db = get_db(); $q = $db->prepare('CREATE TABLE IF NOT EXISTS logs ( diff --git a/logs.php b/logs.php index 653dc80..de379d4 100644 --- a/logs.php +++ b/logs.php @@ -23,6 +23,10 @@ if (!isset($_GET['action'])) { switch ($_GET['action']) { case "list": + global $logging; + if ($logging !== TRUE) + jtable_respond(null, 'error', 'Logging is disabled'); + jtable_respond(getlogs()); break;