summaryrefslogtreecommitdiffstats
path: root/Tests/Auth/OpenID/MemStore.php
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Auth/OpenID/MemStore.php')
-rw-r--r--Tests/Auth/OpenID/MemStore.php18
1 files changed, 6 insertions, 12 deletions
diff --git a/Tests/Auth/OpenID/MemStore.php b/Tests/Auth/OpenID/MemStore.php
index 660c268..f6c3593 100644
--- a/Tests/Auth/OpenID/MemStore.php
+++ b/Tests/Auth/OpenID/MemStore.php
@@ -80,23 +80,17 @@ class Tests_Auth_OpenID_MemStore extends Auth_OpenID_OpenIDStore {
return $present;
}
- function storeNonce($nonce)
+ function useNonce($server_url, $timestamp, $salt)
{
- if (!in_array($nonce, $this->nonces)) {
+ $nonce = sprintf("%s%s%s", $server_url, $timestamp, $salt);
+ if (in_array($nonce, $this->nonces)) {
+ return false;
+ } else {
$this->nonces[] = $nonce;
+ return true;
}
}
- function useNonce($nonce)
- {
- $index = array_search($nonce, $this->nonces);
- $present = $index !== false;
- if ($present) {
- unset($this->nonces[$index]);
- }
- return $present;
- }
-
function reset()
{
$this->assocs = array();