Beispiel #1
0
/**
 * Called when the page requires a log in
 */
function loginHandler()
{
    $cb_url = '';
    header('Cache-Control: no-cache, must-revalidate');
    global $auth, $url, $db;
    if (!preg_match('/login.php/', $url)) {
        $cb_url = $url;
    }
    if (!$auth) {
        $auth = new AuthManager();
    }
    if (array_key_exists('provider', $_GET)) {
        $_SESSION['provider'] = $_GET['provider'];
        $frm = $auth->requestlogin($cb_url, $_SESSION['provider']);
    } elseif (array_key_exists('provider', $_SESSION)) {
        $frm = $auth->requestlogin($cb_url, $_SESSION['provider']);
    } else {
        $frm = $auth->requestlogin($cb_url);
    }
    echo applyTemplate('./base.html', './loginbase.html', array('form' => $frm));
}