public function testOpenidOptionsGetSet() { $options = new ezcAuthenticationOpenidOptions(); $filter = new ezcAuthenticationOpenidFilter(); $filter->setOptions($options); $this->assertEquals($options, $filter->getOptions()); }
if ($url === null) { // URL at the start of authentication $url = isset($_GET['openid_identifier']) ? $_GET['openid_identifier'] : $session->load(); } $action = isset($_GET['action']) ? strtolower($_GET['action']) : null; $credentials = new ezcAuthenticationIdCredentials($url); $authentication = new ezcAuthentication($credentials); $authentication->session = $session; if ($action === 'logout') { $session->destroy(); } else { $options = new ezcAuthenticationOpenidOptions(); $options->mode = ezcAuthenticationOpenidFilter::MODE_SMART; $options->openidVersion = ezcAuthenticationOpenidFilter::VERSION_2_0; $options->store = new ezcAuthenticationOpenidFileStore('/tmp/store'); $filter = new ezcAuthenticationOpenidFilter($options); $filter->registerFetchData(array('fullname', 'gender', 'country', 'language')); $authentication->addFilter($filter); } if (!$authentication->run()) { // authentication did not succeed, so inform the user $status = $authentication->getStatus(); $err = array(); $err["user"] = ""; $err["session"] = ""; for ($i = 0; $i < count($status); $i++) { list($key, $value) = each($status[$i]); switch ($key) { case 'ezcAuthenticationOpenidFilter': if ($value === ezcAuthenticationOpenidFilter::STATUS_SIGNATURE_INCORRECT) { $err["user"] = "******";
/** * Generates a new nonce value with the specified length (default 6). * * @param int $length The length of the generated nonce, default 6 * @return string */ public function generateNonce($length = 6) { return parent::generateNonce($length); }