From ae43e39074d2ca932f9c446b1037dd1e396c2221 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 17 Feb 2015 00:10:36 +0000 Subject: [PATCH] Added support for api demo account --- html/includes/api_functions.inc.php | 5 ++++- includes/defaults.inc.php | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/html/includes/api_functions.inc.php b/html/includes/api_functions.inc.php index f60990b08d..fb25c96cce 100644 --- a/html/includes/api_functions.inc.php +++ b/html/includes/api_functions.inc.php @@ -265,9 +265,12 @@ function del_device() // Default status to error and change it if we need to. $status = "error"; $code = 500; - if(empty($hostname)) + if(empty($hostname) || $config['api_demo'] == 1) { $message = "No hostname has been provided to delete"; + if ($config['api_demo'] == 1) { + $message = "This feature isn\'t available in the demo"; + } $output = array("status" => $status, "message" => $message); } else diff --git a/includes/defaults.inc.php b/includes/defaults.inc.php index 5fbc91e394..b2b3867883 100644 --- a/includes/defaults.inc.php +++ b/includes/defaults.inc.php @@ -586,5 +586,6 @@ $config['dateformat']['time'] = "H:i:s"; $config['enable_clear_discovery'] = 1;// Set this to 0 if you want to disable the web option to rediscover devices $config['enable_footer'] = 1;// Set this to 0 if you want to disable the footer copyright in the web interface +$config['api_demo'] = 0;// Set this to 1 if you want to disable some untrusting features for the API ?>