Exemplo n.º 1
0
$output = new output($_CONFIG);
$message = null;
$status = null;
$page = ltrim($_SERVER["REQUEST_URI"], "/");
switch ($result) {
    case CONNECTION_ERROR:
        $message = "Connection error.";
        break;
    case NO_USER_INPUT:
        if ($page == "") {
            $output->show_url_form();
        } else {
            if (in_array($page, $proxy_pages)) {
                $output->show_page($page);
            } else {
                $output->http_error(404);
            }
        }
        break;
    case LOGIN_REQUIRED:
        $error = isset($_POST["access_code"]) ? "Invalid login." : null;
        $output->show_login_form($error);
        break;
    case INTERNAL_ERROR:
        $message = "Internal error. Try setting proxy_hostname in config.php manually.";
        $status = 500;
        break;
    case FORBIDDEN_HOSTNAME:
        $message = "Access to that website is not allowed.";
        $status = 403;
        break;