Auth_OpenID_ServiceEndpoint::copy PHP Method

copy() public method

public copy ( )
    function copy()
    {
        $x = new Auth_OpenID_ServiceEndpoint();
        $x->claimed_id = $this->claimed_id;
        $x->server_url = $this->server_url;
        $x->type_uris = $this->type_uris;
        $x->local_id = $this->local_id;
        $x->canonicalID = $this->canonicalID;
        $x->used_yadis = $this->used_yadis;
        return $x;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @access private
  */
 function _verifyDiscoveryResultsOpenID1($message, $endpoint)
 {
     $claimed_id = $message->getArg(Auth_OpenID_BARE_NS, $this->openid1_return_to_identifier_name);
     if ($endpoint === null && $claimed_id === null) {
         return new Auth_OpenID_FailureResponse($endpoint, 'When using OpenID 1, the claimed ID must be supplied, ' . 'either by passing it through as a return_to parameter ' . 'or by using a session, and supplied to the GenericConsumer ' . 'as the argument to complete()');
     } else {
         if ($endpoint !== null && $claimed_id === null) {
             $claimed_id = $endpoint->claimed_id;
         }
     }
     $to_match = new Auth_OpenID_ServiceEndpoint();
     $to_match->type_uris = array(Auth_OpenID_TYPE_1_1);
     $to_match->local_id = $message->getArg(Auth_OpenID_OPENID1_NS, 'identity');
     // Restore delegate information from the initiation phase
     $to_match->claimed_id = $claimed_id;
     if ($to_match->local_id === null) {
         return new Auth_OpenID_FailureResponse($endpoint, "Missing required field openid.identity");
     }
     $to_match_1_0 = $to_match->copy();
     $to_match_1_0->type_uris = array(Auth_OpenID_TYPE_1_0);
     if ($endpoint !== null) {
         $result = $this->_verifyDiscoverySingle($endpoint, $to_match);
         if (is_a($result, 'Auth_OpenID_TypeURIMismatch')) {
             $result = $this->_verifyDiscoverySingle($endpoint, $to_match_1_0);
         }
         if (Auth_OpenID::isFailure($result)) {
             // oidutil.log("Error attempting to use stored
             //             discovery information: " + str(e))
             //             oidutil.log("Attempting discovery to
             //             verify endpoint")
         } else {
             return $endpoint;
         }
     }
     // Endpoint is either bad (failed verification) or None
     return $this->_discoverAndVerify($to_match->claimed_id, array($to_match, $to_match_1_0));
 }
All Usage Examples Of Auth_OpenID_ServiceEndpoint::copy