set('Zend_Locale', 'en_US'); if (!in_array($_SERVER['REMOTE_ADDR'], $registry->config->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($registry->config->debug->cookie, '1'); header('Location: ' . $baseUrl); break; case 'off': setcookie($registry->config->debug->cookie, '0', time() - 3600*24); header('Location: ' . $baseUrl); break; default: break; } if (isset($_COOKIE[$registry->config->debug->cookie]) && $_COOKIE[$registry->config->debug->cookie] == '1') { echo 'Debug ENABLED'; echo ' - '; echo 'disable'; } else { echo 'Debug DISABLED'; echo ' - '; echo 'enable'; }