You are here

function gauth_user_services_user_account_delete_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_delete_submit()

Delete account form submit handler.

File

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

Code

function gauth_user_services_user_account_delete_submit($form, &$form_state) {
  if ($form_state['values']['id'] != NULL) {
    $rows = gauth_account_delete($form_state['values']['id'], FALSE);
    if ($rows == 1) {
      drupal_set_message(t("The account is deleted successfully"));
    }
    else {
      drupal_set_message(t("Error occured while deleting the account"), "error");
    }
  }
  else {
    drupal_set_message(t("Error occured: Can't find account to be deleted"), "error");
  }
  $form_state['redirect'] = 'user/' . arg(1) . '/gauth';
}