function complete($current_url, $query=null)
    {
        if ($current_url && !is_string($current_url)) {
            // This is ugly, but we need to complain loudly when
            // someone uses the API incorrectly.
            trigger_error("current_url must be a string; see NEWS file " .
                          "for upgrading notes.",
                          E_USER_ERROR);
        }

        if ($query === null) {
            $query = Auth_OpenID::getQuery();
        }

        $loader = new Auth_OpenID_ServiceEndpointLoader();
        $endpoint_data = $this->session->get($this->_token_key);
        $endpoint =
            $loader->fromSession($endpoint_data);

        $message = Auth_OpenID_Message::fromPostArgs($query);
        $response = $this->consumer->complete($message, $endpoint,
                                              $current_url);
        $this->session->del($this->_token_key);

        if (in_array($response->status, array(Auth_OpenID_SUCCESS,
                                              Auth_OpenID_CANCEL))) {
            if ($response->identity_url !== null) {
                $disco = $this->getDiscoveryObject($this->session,
                                                   $response->identity_url,
                                                   $this->session_key_prefix);
                $disco->cleanup(true);
            }
        }

        return $response;
    }
function complete($current_url, $query=null)
    {
        if ($current_url && !is_string($current_url)) {
            // This is ugly, but we need to complain loudly when
            // someone uses the API incorrectly.
            trigger_error("current_url must be a string; see NEWS file " .
                          "for upgrading notes.",
                          E_USER_ERROR);
        }

        if ($query === null) {
            $query = Auth_OpenID::getQuery();
        }

        $loader = new Auth_OpenID_ServiceEndpointLoader();
        $endpoint_data = $this->session->get($this->_token_key);
        $endpoint =
            $loader->fromSession($endpoint_data);

        $message = Auth_OpenID_Message::fromPostArgs($query);
        $response = $this->consumer->complete($message, $endpoint,
                                              $current_url);
        $this->session->del($this->_token_key);

        if (in_array($response->status, array(Auth_OpenID_SUCCESS,
                                              Auth_OpenID_CANCEL))) {
            if ($response->identity_url !== null) {
                $disco = $this->getDiscoveryObject($this->session,
                                                   $response->identity_url,
                                                   $this->session_key_prefix);
                $disco->cleanup(true);
            }
        }

        return $response;
    }
function complete ( $ current_url , $ query = null ) { if ( $ current_url && ! is_string ( $ current_url ) ) { // This is ugly, but we need to complain loudly when // someone uses the API incorrectly. trigger_error ( "current_url must be a string; see NEWS file " . "for upgrading notes." , E_USER_ERROR ) ; } if ( $ query === null ) { $ query = Auth_OpenID :: getQuery ( ) ; } $ loader = new Auth_OpenID_ServiceEndpointLoader ( ) ; $ endpoint_data = $ this -> session -> get ( $ this -> _token_key ) ; $ endpoint = $ loader -> fromSession ( $ endpoint_data ) ; $ message = Auth_OpenID_Message :: fromPostArgs ( $ query ) ; $ response = $ this -> consumer -> complete ( $ message , $ endpoint , $ current_url ) ; $ this -> session -> del ( $ this -> _token_key ) ; if ( in_array ( $ response -> status , array ( Auth_OpenID_SUCCESS , Auth_OpenID_CANCEL ) ) ) { if ( $ response -> identity_url !== null ) { $ disco = $ this -> getDiscoveryObject ( $ this -> session , $ response -> identity_url , $ this -> session_key_prefix ) ; $ disco -> cleanup ( true ) ; } } return $ response ; }
Called to interpret the server's response to an OpenID
request. It is called in step 4 of the flow described in the
consumer overview.

@param string $current_url The URL used to invoke the application.
Extract the URL from your application's web
request framework and specify it here to have it checked
against the openid.current_url value in the response.  If
the current_url URL check fails, the status of the
completion will be FAILURE.

@param array $query An array of the query parameters (key =>
value pairs) for this HTTP request.  Defaults to null.  If
null, the GET or POST data are automatically gotten from the
PHP environment.  It is only useful to override $query for
testing.

@return Auth_OpenID_ConsumerResponse $response A instance of an
Auth_OpenID_ConsumerResponse subclass. The type of response is
indicated by the status attribute, which will be one of
SUCCESS, CANCEL, FAILURE, or SETUP_NEEDED.
Called to interpret the server s response to an OpenID request . It is called in step 4 of the flow described in the consumer overview .