debug->ips->toArray())
) {
die('Debug mode is forbidden for your ip ' . $_SERVER['REMOTE_ADDR']);
}
$baseUrl = 'http://' . $_SERVER['HTTP_HOST'] . '' . $_SERVER['SCRIPT_NAME'];
$action = isset($_GET['action']) ? $_GET['action'] : 'view';
switch ($action) {
case 'on':
setcookie($config->debug->cookie, '1');
header('Location: ' . $baseUrl);
break;
case 'off':
setcookie($config->debug->cookie, '0', time() - 3600*24);
header('Location: ' . $baseUrl);
break;
default:
break;
}
if (isset($_COOKIE[$config->debug->cookie]) && $_COOKIE[$config->debug->cookie] == '1') {
echo 'Debug ENABLED';
echo ' - ';
echo 'disable';
} else {
echo 'Debug DISABLED';
echo ' - ';
echo 'enable';
}