You are here

function restful_token_auth_user_update in RESTful 7.2

Same name and namespace in other branches
  1. 7 modules/restful_token_auth/restful_token_auth.module \restful_token_auth_user_update()

Implements hook_user_update().

File

modules/restful_token_auth/restful_token_auth.module, line 133
RESTful token authentication.

Code

function restful_token_auth_user_update(&$edit, $account, $category) {
  if ($edit['status']) {
    return;
  }
  $query = new EntityFieldQuery();
  $result = $query
    ->entityCondition('entity_type', 'restful_token_auth')
    ->propertyCondition('uid', $account->uid)
    ->execute();
  if (empty($result['restful_token_auth'])) {
    return;
  }
  entity_delete_multiple('restful_token_auth', array_keys($result['restful_token_auth']));
}