-
-
- // *** TODO ***
-
- // Create attribute request object
- // See http://code.google.com/apis/accounts/docs/OpenID.html#Parameters for parameters
- // Usage: make($type_uri, $count=1, $required=false, $alias=null)
- $attribute[] = Auth_OpenID_AX_AttrInfo::make(
- 'http://axschema.org/contact/email', 1, TRUE);
- $attribute[] = Auth_OpenID_AX_AttrInfo::make(
- 'http://axschema.org/namePerson/first', 1, TRUE);
- $attribute[] = Auth_OpenID_AX_AttrInfo::make(
- 'http://axschema.org/namePerson/last', 1, TRUE);
-
- // Create AX fetch request
- $ax = new Auth_OpenID_AX_FetchRequest;
-
- // Add attributes to AX fetch request
- foreach($attribute as $attr){
- $ax->add($attr);
+ if ($this->ax_enable)
+ {
+ $ax_request = new Auth_OpenID_AX_FetchRequest();
+
+ if ($ax_request)
+ {
+ foreach ($this->ax_attributes as $attr)
+ $ax_request->add($attr);
+ $authRequest->addExtension($ax_request);
+ }
+ else
+ {
+ $this->_set_message(TRUE, 'openid_ax_failed');
+ }