Skip to content

Instantly share code, notes, and snippets.

@aron
Created June 30, 2010 16:06
Show Gist options
  • Save aron/458868 to your computer and use it in GitHub Desktop.
Save aron/458868 to your computer and use it in GitHub Desktop.
Index: classes/model/auth/user/token.php
===================================================================
--- classes/model/auth/user/token.php (revision 41)
+++ classes/model/auth/user/token.php (working copy)
@@ -23,14 +23,17 @@
)),
'expires' => new Field_Timestamp,
));
-
+ }
+
+ public function __construct($values = array())
+ {
+ parent::__construct($values);
if (mt_rand(1, 100) === 1)
{
// Do garbage collection
Jelly::delete('user_token')->where('expires', '<', time())->execute();
}
}
-
+
public function create()
{
// Set hash of the user agent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment