You are here

function sms_user_delete in SMS Framework 6.2

Same name and namespace in other branches
  1. 5 modules/sms_user/sms_user.module \sms_user_delete()
  2. 6 modules/sms_user/sms_user.module \sms_user_delete()

Deletes a user's mobile information from the database

Parameters

$uid: The uid of the user who's data is to be removed.

$number: The number to delete. Defaults to FALSE which will delete all numbers.

See also

sms_user_user()

3 calls to sms_user_delete()
sms_user_settings_confirm_form_submit in modules/sms_user/sms_user.module
sms_user_settings_reset_form_submit in modules/sms_user/sms_user.module
sms_user_user in modules/sms_user/sms_user.module
Implmentation of hook_user().

File

modules/sms_user/sms_user.module, line 477
Provides integration between the SMS Framework and Drupal users.

Code

function sms_user_delete($uid, $number = FALSE) {
  $db_args = array(
    $uid,
  );
  if ($number == FALSE) {
    $number_where = '';
  }
  else {
    $number_where = "AND number = '%s'";
    $db_args[] = $number;
  }
  db_query("DELETE FROM {sms_user} WHERE uid = %d {$number_where}", $db_args);
}