diff options
author | Evan Prodromou <evan@status.net> | 2010-02-03 12:32:48 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-03 12:32:48 -0500 |
commit | 900cb8dd91b954d4e720b0c8afb2884419f43cd7 (patch) | |
tree | c2308c56f097d735273e965374240dfc20ded284 /classes/Consumer.php | |
parent | aa4848d62d9bcc8166f18f4a18e5a3d2a6a51537 (diff) | |
parent | efa930ab000e1e022f0754d9f421e8859024142c (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'classes/Consumer.php')
-rw-r--r-- | classes/Consumer.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/classes/Consumer.php b/classes/Consumer.php index ad64a8491..ce399f278 100644 --- a/classes/Consumer.php +++ b/classes/Consumer.php @@ -36,4 +36,34 @@ class Consumer extends Memcached_DataObject return $cons; } + /** + * Delete a Consumer and related tokens and nonces + * + * XXX: Should this happen in an OAuthDataStore instead? + * + */ + function delete() + { + // XXX: Is there any reason NOT to do this kind of cleanup? + + $this->_deleteTokens(); + $this->_deleteNonces(); + + parent::delete(); + } + + function _deleteTokens() + { + $token = new Token(); + $token->consumer_key = $this->consumer_key; + $token->delete(); + } + + function _deleteNonces() + { + $nonce = new Nonce(); + $nonce->consumer_key = $this->consumer_key; + $nonce->delete(); + } + } |