Ejemplo n.º 1
0
    } else {
        $openid_url = null;
    }
}
$realm = Tools::fullUrl();
$returnTo = Tools::fullUrl('login');
if ($bAutologin) {
    $returnTo = Tools::fullUrl('login?autologin=2');
}
try {
    $o = new \OpenID_RelyingParty($returnTo, $realm, $openid_url);
} catch (\OpenID_Exception $e) {
    throw new Exception($e->getMessage());
}
if (!empty($_POST['disable_associations']) || !empty($_SESSION['disable_associations'])) {
    $o->disableAssociations();
    $_SESSION['disable_associations'] = true;
}
if (isset($_POST['openid_url'])) {
    $_SESSION['openid_url'] = $openid_url;
    try {
        $authRequest = $o->prepare();
        if ($bAutologin) {
            $authRequest->setMode(\OpenID::MODE_CHECKID_IMMEDIATE);
        }
    } catch (\OpenID_Exception $e) {
        if ($bAutologin) {
            $alres = new Login_AutologinResponse('error', $e->getMessage());
            $alres->send();
            exit(0);
        }