src/tools/web/OpenID.php
function auth($proxy=NULL,$attr=array(),array $reqd=NULL) {
		$fw=Base::instance();
		$root=$fw->get('SCHEME').'://'.$fw->get('HOST');
		if (empty($this->args['trust_root']))
			$this->args['trust_root']=$root.$fw->get('BASE').'/';
		if (empty($this->args['return_to']))
			$this->args['return_to']=$root.$_SERVER['REQUEST_URI'];
		$this->args['mode']='checkid_setup';
		if ($this->url=$this->discover($proxy)) {
			if ($attr) {
				$this->args['ns.ax']='http://openid.net/srv/ax/1.0';
				$this->args['ax.mode']='fetch_request';
				foreach ($attr as $key=>$val)
					$this->args['ax.type.'.$key]=$val;
				$this->args['ax.required']=is_string($reqd)?
					$reqd:implode(',',$reqd);
			}
			$var=array();
			foreach ($this->args as $key=>$val)
				$var['openid.'.$key]=$val;
			$fw->reroute($this->url.'?'.http_build_query($var));
		}
		return FALSE;
	}
function auth($proxy=NULL,$attr=array(),array $reqd=NULL) {
		$fw=Base::instance();
		$root=$fw->get('SCHEME').'://'.$fw->get('HOST');
		if (empty($this->args['trust_root']))
			$this->args['trust_root']=$root.$fw->get('BASE').'/';
		if (empty($this->args['return_to']))
			$this->args['return_to']=$root.$_SERVER['REQUEST_URI'];
		$this->args['mode']='checkid_setup';
		if ($this->url=$this->discover($proxy)) {
			if ($attr) {
				$this->args['ns.ax']='http://openid.net/srv/ax/1.0';
				$this->args['ax.mode']='fetch_request';
				foreach ($attr as $key=>$val)
					$this->args['ax.type.'.$key]=$val;
				$this->args['ax.required']=is_string($reqd)?
					$reqd:implode(',',$reqd);
			}
			$var=array();
			foreach ($this->args as $key=>$val)
				$var['openid.'.$key]=$val;
			$fw->reroute($this->url.'?'.http_build_query($var));
		}
		return FALSE;
	}
function auth ( $ proxy = NULL , $ attr = array ( ) , array $ reqd = NULL ) { $ fw = Base :: instance ( ) ; $ root = $ fw -> get ( 'SCHEME' ) . '://' . $ fw -> get ( 'HOST' ) ; if ( empty ( $ this -> args [ 'trust_root' ] ) ) $ this -> args [ 'trust_root' ] = $ root . $ fw -> get ( 'BASE' ) . '/' ; if ( empty ( $ this -> args [ 'return_to' ] ) ) $ this -> args [ 'return_to' ] = $ root . $ _SERVER [ 'REQUEST_URI' ] ; $ this -> args [ 'mode' ] = 'checkid_setup' ; if ( $ this -> url = $ this -> discover ( $ proxy ) ) { if ( $ attr ) { $ this -> args [ 'ns.ax' ] = 'http://openid.net/srv/ax/1.0' ; $ this -> args [ 'ax.mode' ] = 'fetch_request' ; foreach ( $ attr as $ key => $ val ) $ this -> args [ 'ax.type.' . $ key ] = $ val ; $ this -> args [ 'ax.required' ] = is_string ( $ reqd ) ? $ reqd : implode ( ',' , $ reqd ) ; } $ var = array ( ) ; foreach ( $ this -> args as $ key => $ val ) $ var [ 'openid.' . $ key ] = $ val ; $ fw -> reroute ( $ this -> url . '?' . http_build_query ( $ var ) ) ; } return FALSE ; }
Initiate OpenID authentication sequence; Return FALSE on failure
or redirect to OpenID provider URL
@return bool
@param $proxy string
@param $attr array
@param $reqd string|array
Initiate OpenID authentication sequence ; Return FALSE on failure or redirect to OpenID provider URL