Beispiel #1
0
/**
 * Process an OpenID Server request.
 *
 * @uses apply_filters() Calls 'openid_server_auth_response' before sending the authentication response.
 */
function openid_server_request()
{
    $server = openid_server();
    // get OpenID request, either from session or HTTP request
    $request = $server->decodeRequest();
    if (Auth_OpenID_isError($request)) {
        @session_start();
        if ($_SESSION['openid_server_request']) {
            $request = $_SESSION['openid_server_request'];
            unset($_SESSION['openid_server_request']);
        }
    }
    // process request
    if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
        $response = openid_server_auth_request($request);
        $response = apply_filters('openid_server_auth_response', $response);
    } else {
        $response = $server->handleRequest($request);
    }
    openid_server_process_response($response);
}
Beispiel #2
0
/**
 * Process an OpenID Server request.
 *
 * @uses apply_filters() Calls 'openid_server_auth_response' before sending the authentication response.
 */
function openid_server_request() {
	$server = openid_server();

	// get OpenID request, either from session or HTTP request
	$request = $server->decodeRequest();
	if (!$request || Auth_OpenID_isError($request)) {
		@session_start();
		if ($_SESSION['openid_server_request']) {
			$request = $_SESSION['openid_server_request'];
			unset($_SESSION['openid_server_request']);
		}
	}

	if (!$request || Auth_OpenID_isError($request)) {
		$html = '<h1>This is an OpenID Server.</h1>';

		if (Auth_OpenID_isError($request)) {
			$html .= '<p><strong>Request Error:</strong> ' . $request->toString() . '</p>';
		} else {
			$html .= '<p>Nothing to see here&#8230; move along.</p>';
		}

		wp_die($html);
	}

	// process request
	if (in_array($request->mode, array('checkid_immediate', 'checkid_setup'))) {
		$response = openid_server_auth_request($request);
		$response = apply_filters('openid_server_auth_response', $response);
	} else {
		$response = $server->handleRequest($request);
	}

	openid_server_process_response($response);
}