<?php

$accessControl = array(
    "Admin" => true
);
require_once "../../AccessControl.php";


$tracking = getGlobalSetting("UsageTracking", 1);

if (isset($_REQUEST["toggle"]) == 1) {

	if ($tracking === 1) {
		setGlobalSetting("UsageTracking", 0);
		$msg = _USAGE_TRACKING_DISABLED;
	} else {
		setGlobalSetting("UsageTracking", 1);
		$msg = _USAGE_TRACKING_ENABLED;
	}

	die('{ "Status": "Success", "Message": "'.$msg.'" }');


} else{
	# we are not setting the value, just requesting it
	if ($tracking === 1) {
    	die('{ "Status": "'. _ENABLED .'" }');
    } else {
		die('{ "Status": "'. _DISABLED .'" }');
    }
}
?>