function farm_api_modules_disabled in farmOS 7
Implements hook_modules_disabled().
File
- modules/
farm/ farm_api/ farm_api.module, line 268 - Farm API module.
Code
function farm_api_modules_disabled($modules) {
// If the modules provided OAuth2 clients, disable them.
$hook = 'farm_api_oauth2_client';
foreach ($modules as $module) {
$function = $module . '_' . $hook;
if (function_exists($function)) {
$clients = $function();
foreach ($clients as $client) {
$client_id = db_query('SELECT client_id FROM {oauth2_server_client} WHERE client_key = :client_key', array(
':client_key' => $client['client_key'],
))
->fetchField();
if (!empty($client_id)) {
entity_delete('oauth2_server_client', $client_id);
}
}
}
}
}