From d251e624a9885fdd5ca9a3de446071606c1ac54d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 4 Jun 2008 14:51:31 -0400 Subject: full interface for userauthorization darcs-hash:20080604185131-84dde-2ff45e07ebba18c97803ed4a99121a6244ef1158.gz --- lib/oauthstore.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/oauthstore.php') diff --git a/lib/oauthstore.php b/lib/oauthstore.php index 4ad123455..688c7477a 100644 --- a/lib/oauthstore.php +++ b/lib/oauthstore.php @@ -106,9 +106,21 @@ class LaconicaOAuthDataStore extends OAuthDataStore { $rt->state = 2; # used if (!$rt->update($orig_rt)) { return NULL; + } + # Update subscription + # XXX: mixing levels here + $sub = Subscription::staticGet('token', $rt->tok); + if (!$sub) { + return NULL; + } + $orig_sub = clone($sub); + $sub->token = $at->tok; + $sub->secret = $at->secret; + if (!$sub->update($orig_sub)) { + return NULL; } else { return new OAuthToken($at->tok, $at->secret); - } + } } } else { return NULL; -- cgit v1.2.3-54-g00ecf