You are here

function gauth_user_services_user_account_revoke_submit in Google Auth 7

Same name and namespace in other branches
  1. 7.2 gauth_user/gauth_user.pages.inc \gauth_user_services_user_account_revoke_submit()

Revoke access form submit handler

File

gauth_user/gauth_user.pages.inc, line 125
User pages for Google Auth User Services.

Code

function gauth_user_services_user_account_revoke_submit($form, &$form_state) {
  if ($form_state['values']['id'] != NULL) {
    $rows = gauth_account_revoke_token($form_state['values']['id'], FALSE);
    if ($rows == TRUE) {
      drupal_set_message(t("Acess token revoked successfully"));
    }
    else {
      drupal_set_message(t("Error occured while revoking token of this account"), "error");
    }
  }
  else {
    drupal_set_message(t("Error occured: Can't find account to be revoked"), "error");
  }
  $form_state['redirect'] = 'user/' . arg(1) . '/gauth';
}