Auth_OpenID_CheckIDRequest::trustRootValid PHP Method

trustRootValid() public method

public trustRootValid ( )
    function trustRootValid()
    {
        if (!$this->trust_root) {
            return true;
        }
        $tr = Auth_OpenID_TrustRoot::_parse($this->trust_root);
        if ($tr === false) {
            return new Auth_OpenID_MalformedTrustRoot($this->message, $this->trust_root);
        }
        if ($this->return_to !== null) {
            return Auth_OpenID_TrustRoot::match($this->trust_root, $this->return_to);
        } else {
            return true;
        }
    }

Usage Example

Example #1
0
	function make(&$message, $identity, $return_to, $trust_root = null,
	$immediate = false, $assoc_handle = null, $server = null)
	{
		if ($server === null) {
			return new Auth_OpenID_ServerError($message,
                                               "server must not be null");
		}

		if ($return_to &&
		!Auth_OpenID_TrustRoot::_parse($return_to)) {
			return new Auth_OpenID_MalformedReturnURL($message, $return_to);
		}

		$r = new Auth_OpenID_CheckIDRequest($identity, $return_to,
		$trust_root, $immediate,
		$assoc_handle, $server);

		$r->namespace = $message->getOpenIDNamespace();
		$r->message =& $message;

		if (!$r->trustRootValid()) {
			return new Auth_OpenID_UntrustedReturnURL($message,
			$return_to,
			$trust_root);
		} else {
			return $r;
		}
	}
All Usage Examples Of Auth_OpenID_CheckIDRequest::trustRootValid