mirror of
https://github.com/tuxis-ie/nsedit.git
synced 2025-05-03 22:02:23 +03:00
Do not do any logging if it's disabled
This commit is contained in:
parent
a91d91baa4
commit
3fd525748f
3 changed files with 19 additions and 3 deletions
|
@ -3,10 +3,10 @@
|
||||||
$apipass = ''; # The PowerDNS API-key
|
$apipass = ''; # The PowerDNS API-key
|
||||||
$apiip = ''; # The IP of the PowerDNS API
|
$apiip = ''; # The IP of the PowerDNS API
|
||||||
$apiport = '8081'; # The port of the PowerDNS API
|
$apiport = '8081'; # The port of the PowerDNS API
|
||||||
$apisid = 'localhost'; # PowerDNS's :server_id
|
|
||||||
$apiproto = 'http'; # http | https
|
$apiproto = 'http'; # http | https
|
||||||
$apisslverify = 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
|
$allowzoneadd = FALSE; # Allow normal users to add zones
|
||||||
|
$logging = TRUE;
|
||||||
|
|
||||||
|
|
||||||
# If you configure this, nsedit will try to authenticate via WeFact too.
|
# 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'] = 'INCEPTION-INCREMENT';
|
||||||
$defaults['soa_edit_api'] = 'INCEPTION-INCREMENT';
|
$defaults['soa_edit_api'] = 'INCEPTION-INCREMENT';
|
||||||
$defaults['defaulttype'] = 'Master'; # Choose between 'Native' or 'Master'
|
$defaults['defaulttype'] = 'Master'; # Choose between 'Native' or 'Master'
|
||||||
$defaults['ns'][0] = 'unconfigured.primaryns'; # The value of the first 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['ns'][1] = 'unconfigured.secondaryns.'; # The value of the second NS-record
|
||||||
$defaults['ttl'] = 3600; # Default TTL for records
|
$defaults['ttl'] = 3600; # Default TTL for records
|
||||||
$defaults['disabled'] = false; # Default disabled state
|
$defaults['disabled'] = false; # Default disabled state
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,10 @@ function user_template_names() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getlogs() {
|
function getlogs() {
|
||||||
|
global $logging;
|
||||||
|
if ($logging !== TRUE)
|
||||||
|
return;
|
||||||
|
|
||||||
$db = get_db();
|
$db = get_db();
|
||||||
$r = $db->query('SELECT * FROM logs ORDER BY timestamp DESC');
|
$r = $db->query('SELECT * FROM logs ORDER BY timestamp DESC');
|
||||||
$ret = array();
|
$ret = array();
|
||||||
|
@ -263,6 +267,10 @@ function getlogs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function clearlogs() {
|
function clearlogs() {
|
||||||
|
global $logging;
|
||||||
|
if ($logging !== TRUE)
|
||||||
|
return;
|
||||||
|
|
||||||
$db = get_db();
|
$db = get_db();
|
||||||
$q = $db->query('DELETE FROM logs;');
|
$q = $db->query('DELETE FROM logs;');
|
||||||
$db->close();
|
$db->close();
|
||||||
|
@ -270,6 +278,10 @@ function clearlogs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function writelog($line) {
|
function writelog($line) {
|
||||||
|
global $logging;
|
||||||
|
if ($logging !== TRUE)
|
||||||
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$db = get_db();
|
$db = get_db();
|
||||||
$q = $db->prepare('CREATE TABLE IF NOT EXISTS logs (
|
$q = $db->prepare('CREATE TABLE IF NOT EXISTS logs (
|
||||||
|
|
4
logs.php
4
logs.php
|
@ -23,6 +23,10 @@ if (!isset($_GET['action'])) {
|
||||||
switch ($_GET['action']) {
|
switch ($_GET['action']) {
|
||||||
|
|
||||||
case "list":
|
case "list":
|
||||||
|
global $logging;
|
||||||
|
if ($logging !== TRUE)
|
||||||
|
jtable_respond(null, 'error', 'Logging is disabled');
|
||||||
|
|
||||||
jtable_respond(getlogs());
|
jtable_respond(getlogs());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue