Öffentliche Methoden | |
build ($required=null, $optional=null, $policy_url=null, $sreg_ns_uri=Auth_OpenID_SREG_NS_URI, $cls='Auth_OpenID_SRegRequest') | |
fromOpenIDRequest ($request, $cls='Auth_OpenID_SRegRequest') | |
parseExtensionArgs ($args, $strict=false) | |
allRequestedFields () | |
wereFieldsRequested () | |
contains ($field_name) | |
requestField ($field_name, $required=false, $strict=false) | |
requestFields ($field_names, $required=false, $strict=false) | |
getExtensionArgs () | |
Datenfelder | |
$ns_alias = 'sreg' |
Definiert in Zeile 169 der Datei SReg.php.
allRequestedFields | ( | ) |
build | ( | $ | required = null , |
|
$ | optional = null , |
|||
$ | policy_url = null , |
|||
$ | sreg_ns_uri = Auth_OpenID_SREG_NS_URI , |
|||
$ | cls = 'Auth_OpenID_SRegRequest' | |||
) |
Initialize an empty simple registration request.
Definiert in Zeile 176 der Datei SReg.php.
00180 { 00181 $obj = new $cls(); 00182 00183 $obj->required = array(); 00184 $obj->optional = array(); 00185 $obj->policy_url = $policy_url; 00186 $obj->ns_uri = $sreg_ns_uri; 00187 00188 if ($required) { 00189 if (!$obj->requestFields($required, true, true)) { 00190 return null; 00191 } 00192 } 00193 00194 if ($optional) { 00195 if (!$obj->requestFields($optional, false, true)) { 00196 return null; 00197 } 00198 } 00199 00200 return $obj; 00201 }
contains | ( | $ | field_name | ) |
fromOpenIDRequest | ( | $ | request, | |
$ | cls = 'Auth_OpenID_SRegRequest' | |||
) |
Create a simple registration request that contains the fields that were requested in the OpenID request with the given arguments
$request: The OpenID authentication request from which to extract an sreg request.
$cls: name of class to use when creating sreg request object. Used for testing.
Returns the newly created simple registration request
Definiert in Zeile 216 der Datei SReg.php.
00217 { 00218 00219 $obj = call_user_func_array(array($cls, 'build'), 00220 array(null, null, null, Auth_OpenID_SREG_NS_URI, $cls)); 00221 00222 // Since we're going to mess with namespace URI mapping, don't 00223 // mutate the object that was passed in. 00224 $m = $request->message; 00225 00226 $obj->ns_uri = $obj->_getSRegNS($m); 00227 $args = $m->getArgs($obj->ns_uri); 00228 00229 if ($args === null || Auth_OpenID::isFailure($args)) { 00230 return null; 00231 } 00232 00233 $obj->parseExtensionArgs($args); 00234 00235 return $obj; 00236 }
getExtensionArgs | ( | ) |
Get a dictionary of unqualified simple registration arguments representing this request.
This method is essentially the inverse of C{L{parseExtensionArgs}}. This method serializes the simple registration request fields.
Erneute Implementation von Auth_OpenID_Extension.
Definiert in Zeile 389 der Datei SReg.php.
00390 { 00391 $args = array(); 00392 00393 if ($this->required) { 00394 $args['required'] = implode(',', $this->required); 00395 } 00396 00397 if ($this->optional) { 00398 $args['optional'] = implode(',', $this->optional); 00399 } 00400 00401 if ($this->policy_url) { 00402 $args['policy_url'] = $this->policy_url; 00403 } 00404 00405 return $args; 00406 }
parseExtensionArgs | ( | $ | args, | |
$ | strict = false | |||
) |
Parse the unqualified simple registration request parameters and add them to this object.
This method is essentially the inverse of getExtensionArgs. This method restores the serialized simple registration request fields.
If you are extracting arguments from a standard OpenID checkid_* request, you probably want to use fromOpenIDRequest, which will extract the sreg namespace and arguments from the OpenID request. This method is intended for cases where the OpenID server needs more control over how the arguments are parsed than that method provides.
$args == $message->getArgs($ns_uri); $request->parseExtensionArgs($args);
$args: The unqualified simple registration arguments
strict: Whether requests with fields that are not defined in the simple registration specification should be tolerated (and ignored)
Definiert in Zeile 262 der Datei SReg.php.
00263 { 00264 foreach (array('required', 'optional') as $list_name) { 00265 $required = ($list_name == 'required'); 00266 $items = Auth_OpenID::arrayGet($args, $list_name); 00267 if ($items) { 00268 foreach (explode(',', $items) as $field_name) { 00269 if (!$this->requestField($field_name, $required, $strict)) { 00270 if ($strict) { 00271 return false; 00272 } 00273 } 00274 } 00275 } 00276 } 00277 00278 $this->policy_url = Auth_OpenID::arrayGet($args, 'policy_url'); 00279 00280 return true; 00281 }
requestField | ( | $ | field_name, | |
$ | required = false , |
|||
$ | strict = false | |||
) |
Request the specified field from the OpenID user
$field_name: the unqualified simple registration field name
required: whether the given field should be presented to the user as being a required to successfully complete the request
strict: whether to raise an exception when a field is added to a request more than once
Definiert in Zeile 320 der Datei SReg.php.
00322 { 00323 if (!Auth_OpenID_checkFieldName($field_name)) { 00324 return false; 00325 } 00326 00327 if ($strict) { 00328 if ($this->contains($field_name)) { 00329 return false; 00330 } 00331 } else { 00332 if (in_array($field_name, $this->required)) { 00333 return true; 00334 } 00335 00336 if (in_array($field_name, $this->optional)) { 00337 if ($required) { 00338 unset($this->optional[array_search($field_name, 00339 $this->optional)]); 00340 } else { 00341 return true; 00342 } 00343 } 00344 } 00345 00346 if ($required) { 00347 $this->required[] = $field_name; 00348 } else { 00349 $this->optional[] = $field_name; 00350 } 00351 00352 return true; 00353 }
requestFields | ( | $ | field_names, | |
$ | required = false , |
|||
$ | strict = false | |||
) |
Add the given list of fields to the request
field_names: The simple registration data fields to request
required: Whether these values should be presented to the user as required
strict: whether to raise an exception when a field is added to a request more than once
Definiert in Zeile 366 der Datei SReg.php.
00367 { 00368 if (!is_array($field_names)) { 00369 return false; 00370 } 00371 00372 foreach ($field_names as $field_name) { 00373 if (!$this->requestField($field_name, $required, $strict=$strict)) { 00374 return false; 00375 } 00376 } 00377 00378 return true; 00379 }
wereFieldsRequested | ( | ) |
Have any simple registration fields been requested?
Definiert in Zeile 295 der Datei SReg.php.
00296 { 00297 return count($this->allRequestedFields()); 00298 }
$ns_alias = 'sreg' |
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|