diff options
Diffstat (limited to 'Auth/OpenID/SQLStore.php')
-rw-r--r-- | Auth/OpenID/SQLStore.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Auth/OpenID/SQLStore.php b/Auth/OpenID/SQLStore.php index 0f58203..4192022 100644 --- a/Auth/OpenID/SQLStore.php +++ b/Auth/OpenID/SQLStore.php @@ -35,6 +35,11 @@ require_once 'Auth/OpenID/Nonce.php'; require_once 'Auth/OpenID.php'; /** + * @access private + */ +require_once 'Auth/OpenID/Nonce.php'; + +/** * This is the parent class for the SQL stores, which contains the * logic common to all of the SQL stores. * @@ -250,7 +255,8 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore { array( 'value' => $this->nonces_table_name, 'keys' => array('nonce_table', - 'add_nonce') + 'add_nonce', + 'clean_nonce') ), array( 'value' => $this->associations_table_name, @@ -553,6 +559,17 @@ class Auth_OpenID_SQLStore extends Auth_OpenID_OpenIDStore { return $result; } + + function cleanupNonces() + { + global $Auth_OpenID_SKEW; + $v = time() - $Auth_OpenID_SKEW; + + $this->connection->query($this->sql['clean_nonce'], array($v)); + $num = $this->connection->affectedRows(); + $this->connection->commit(); + return $num; + } } ?> |