function _flickrapi_oauth_clear in Flickr API 7.2
Same name and namespace in other branches
- 7 flickrapi.module \_flickrapi_oauth_clear()
Clears OAuth token and keys.
Return value
Boolean TRUE if keys and oauth token were found
3 calls to _flickrapi_oauth_clear()
- flickrapi_admin_settings_submit in ./
flickrapi.admin.inc - Submit handler for the admin settings form.
- flickrapi_oauth_clear_form_submit in ./
flickrapi.admin.inc - Form submit: deletes flickr credentials
- flickrapi_uninstall in ./
flickrapi.install - Implements hook_uninstall(). Clean up old variables.
File
- ./
flickrapi.module, line 257 - FlickAPI integration module.
Code
function _flickrapi_oauth_clear() {
$consumer_key = variable_get('flickrapi_api_key');
$secret = variable_get('flickrapi_api_secret');
// TODO get rid of this query and use
// an oauth_common API method when available.
$csid = db_query("SELECT csid FROM {oauth_common_consumer} WHERE consumer_key = :consumer_key AND secret = :secret", array(
':consumer_key' => $consumer_key,
':secret' => $secret,
))
->fetchField();
if ($csid) {
DrupalOAuthConsumer::deleteConsumer($csid);
variable_del('flickrapi_api_key');
variable_del('flickrapi_api_secret');
return TRUE;
}
else {
return FALSE;
}
}