Example #1
0
function init()
{
    set_error_handler("hhb_exception_error_handler");
    echo '<!DOCTYPE HTML><html><head><title>x11vnc.php</title></head><body>';
    echo '<div id="TheStatusDiv">Look here for status! currently: <span id="status">loading the page</span></div>';
    register_shutdown_function(function () {
        echo '</body></html>';
    });
    if (!array_key_exists('submit', $_POST)) {
        AskForPasswordHTML();
        die;
    }
    global $password_to_use_script;
    if (is_string($password_to_use_script)) {
        if (!array_key_exists('password_to_use_script', $_POST)) {
            echo 'password to use this scirpt is not supplied!';
            AskForPasswordHTML();
            die;
        }
        if ($_POST['password_to_use_script'] !== $password_to_use_script) {
            echo "wrong password supplied to use this script!";
            AskForPasswordHTML();
            die;
        }
    }
    global $force_unix_username, $unix_username;
    if (is_string($force_unix_username)) {
        $unix_username = $force_unix_username;
    } else {
        if (!array_key_exists('unix_username', $_POST)) {
            echo "unix username not supplied!";
            AskForPasswordHTML();
            die;
        }
        $unix_username = (string) $_POST['unix_username'];
    }
    global $force_unix_password, $unix_password;
    if (is_string($force_unix_password)) {
        $unix_password = $force_unix_password;
    } else {
        if (!array_key_exists('unix_password', $_POST)) {
            echo "unix password not supplied!";
            AskForPasswordHTML();
            die;
        }
        $unix_password = (string) $_POST['unix_password'];
    }
}
function init()
{
    echo '<!DOCTYPE HTML><html><head><title>x11vnc.php</title></head><body>';
    register_shutdown_function(function () {
        echo '</body></html>';
    });
    if (!array_key_exists('submit', $_POST)) {
        AskForPasswordHTML();
        die;
    }
    global $password_to_use_script;
    if (is_string($password_to_use_script)) {
        if (!array_key_exists('password_to_use_script', $_POST)) {
            echo 'password to use this scirpt is not supplied!';
            AskForPasswordHTML();
            die;
        }
        if ($_POST['password_to_use_script'] !== $password_to_use_script) {
            echo "wrong password supplied to use this script!";
            AskForPasswordHTML();
            die;
        }
    }
    global $force_unix_username, $unix_username;
    if (is_string($force_unix_username)) {
        $unix_username = $force_unix_username;
    } else {
        if (!array_key_exists('unix_username', $_POST)) {
            echo "unix username not supplied!";
            AskForPasswordHTML();
            die;
        }
        $unix_username = (string) $_POST['unix_username'];
    }
    global $force_unix_password, $unix_password;
    if (is_string($force_unix_password)) {
        $unix_password = $force_unix_password;
    } else {
        if (!array_key_exists('unix_password', $_POST)) {
            echo "unix password not supplied!";
            AskForPasswordHTML();
            die;
        }
        $unix_password = (string) $_POST['unix_password'];
    }
}