示例#1
0
文件: index.php 项目: Git-Host/proxy
        return;
    }
}
/* Handle bootstrap or proxy result
 */
$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;