Auth_OpenID_SessionNegotiator::addAllowedType PHP Method

addAllowedType() public method

Add an association type and session type to the allowed types list. The assocation/session pairs are tried in the order that they are added.
public addAllowedType ( $assoc_type, $session_type = null )
    function addAllowedType($assoc_type, $session_type = null)
    {
        if ($this->allowed_types === null) {
            $this->allowed_types = array();
        }
        if ($session_type === null) {
            $available = Auth_OpenID_getSessionTypes($assoc_type);
            if (!$available) {
                return false;
            }
            foreach ($available as $session_type) {
                $this->addAllowedType($assoc_type, $session_type);
            }
        } else {
            if (Auth_OpenID_checkSessionType($assoc_type, $session_type)) {
                $this->allowed_types[] = array($assoc_type, $session_type);
            } else {
                return false;
            }
        }
        return true;
    }