class LaconicaOAuthDataStore extends OAuthDataStore {
# We keep a record of who's contacted us
-
+
function lookup_consumer($consumer_key) {
$con = Consumer::staticGet('consumer_key', $consumer_key);
if (!$con) {
}
return new OAuthConsumer($con->consumer_key, '');
}
-
+
function lookup_token($consumer, $token_type, $token_key) {
$t = new Token();
$t->consumer_key = $consumer->key;
return NULL;
}
}
-
+
function lookup_nonce($consumer, $token, $nonce, $timestamp) {
$n = new Nonce();
$n->consumer_key = $consumer->key;
return FALSE;
}
}
-
+
function new_request_token($consumer) {
$t = new Token();
$t->consumer_key = $consumer->key;
}
# defined in OAuthDataStore, but not implemented anywhere
-
+
function fetch_request_token($consumer) {
return $this->new_request_token($consumer);
}
-
+
function new_access_token($token, $consumer) {
common_debug('new_access_token("'.$token->key.'","'.$consumer->key.'")', __FILE__);
$rt = new Token();
$rt->state = 2; # used
if (!$rt->update($orig_rt)) {
return NULL;
- }
+ }
common_debug('request token "'.$rt->tok.'" updated', __FILE__);
# Update subscription
# XXX: mixing levels here
} else {
common_debug('subscription updated to use access token', __FILE__);
return new OAuthToken($at->tok, $at->secret);
- }
+ }
}
} else {
return NULL;
}
}
-
+
# defined in OAuthDataStore, but not implemented anywhere
-
+
function fetch_access_token($consumer) {
return $this->new_access_token($consumer);
}