Beispiel #1
0
    // quick (and dirty) hack to ensure that there is always a '?' in the URL
    // we add it to ensure that a user is always logged in at chris/? or chris/experimental/?
    // if not, in collaboration mode it can happend that
    // user 1 is at: chris/
    // user 2 is at: chris/?
    // then the collaboration is buggy
    if ($_SERVER["REQUEST_URI"][strlen($_SERVER["REQUEST_URI"]) - 1] !== '?') {
        header("Location: ?");
        exit;
    }
    // update user-specific configuration
    // BACKGROUND
    if (isset($_SESSION['userconf']['general']) && isset($_SESSION['userconf']['general']['background'])) {
        $prefix = '';
        if (dirname($_SESSION['userconf']['general']['background']) == '.') {
            $prefix .= 'users/' . $_SESSION['username'] . '/' . CHRIS_USERS_CONFIG_DIR . '/';
        }
        $_SESSION['userconf']['general']['background'] = $prefix . $_SESSION['userconf']['general']['background'];
    } else {
        $_SESSION['userconf']['general']['background'] = "view/gfx/fnndsc_1920x1200.jpg";
    }
    // EMAIL ADDRESS
    if (isset($_SESSION['userconf']['general']) && isset($_SESSION['userconf']['general']['email'])) {
        UserC::setEmail($_SESSION['userid'], $_SESSION['userconf']['general']['email']);
    }
    // show the homepage
    echo homePage();
    exit;
}
// otherwise show the login screen
echo loginPage();