/** * Processes the current request. */ function openid_process() { if (defined('OPENID_URL')) { // Initial authentication attempt (they just entered their identifier) $reqs = checkRequests(); $disc = tryDiscovery(OPENID_URL); $_SESSION['openid'] = array('identity' => $disc->getIdentity(), 'delegate' => $disc->getDelegate(), 'validated' => false, 'server' => $disc->getServer(), 'nonce' => uniqid(microtime(true), true), 'requests' => $reqs); $handle = getHandle($disc->getServer()); $url = URLBuilder::buildRequest(defined('OPENID_IMMEDIATE') ? 'immediate' : 'setup', $disc->getServer(), $disc->getDelegate(), $disc->getIdentity(), URLBuilder::getCurrentURL(), $handle); URLBuilder::doRedirect($url); } else { if (isset($_REQUEST['openid_mode'])) { checkNonce(); $func = 'process' . str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($_REQUEST['openid_mode'])))); if (function_exists($func)) { call_user_func($func, checkHandleRevocation()); } } } }
/** * Processes the current request. */ function process() { if (defined('OPENID_URL')) { // Initial authentication attempt (they just entered their identifier) Logger::log('Processing authentication attempt for %s', OPENID_URL); $reqs = checkRequests(); $disc = tryDiscovery(OPENID_URL); $_SESSION['openid'] = array('identity' => $disc->getClaimedId(), 'claimedId' => $disc->getClaimedId(), 'endpointUrl' => $disc->getEndpointUrl(), 'opLocalId' => $disc->getOpLocalId(), 'userSuppliedId' => $disc->getUserSuppliedId(), 'version' => $disc->getVersion(), 'validated' => false, 'nonce' => uniqid(microtime(true), true), 'requests' => $reqs); $handle = getHandle($disc->getEndpointUrl()); if (!defined('OPENID_RETURN_URL')) { define('OPENID_RETURN_URL', URLBuilder::getCurrentURL()); } $url = URLBuilder::buildRequest(defined('OPENID_IMMEDIATE') ? 'immediate' : 'setup', $disc->getEndpointUrl(), $disc->getOpLocalId(), $disc->getClaimedId(), OPENID_RETURN_URL, $handle, $disc->getVersion()); URLBuilder::doRedirect($url); } else { if (isset($_REQUEST['openid_mode'])) { checkNonce(); $func = 'process' . str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($_REQUEST['openid_mode'])))); if (function_exists($func)) { call_user_func($func, checkHandleRevocation()); } } } }