You are here

function sms_user_get_uid in SMS Framework 6

Same name and namespace in other branches
  1. 5 modules/sms_user/sms_user.module \sms_user_get_uid()
  2. 6.2 modules/sms_user/sms_user.module \sms_user_get_uid()
  3. 7 modules/sms_user/sms_user.module \sms_user_get_uid()

Returns the uid of the owner of a number.

3 calls to sms_user_get_uid()
sms_user_authenticate in modules/sms_user/sms_user.module
Authenticate a user based on mobile number.
sms_user_sms_send in modules/sms_user/sms_user.module
Implementation of hook_sms_send().
sms_user_validate_number in modules/sms_user/sms_user.module

File

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

Code

function sms_user_get_uid($number, $status = NULL) {
  $sql = "SELECT uid FROM {sms_user} WHERE number = '%s'";
  $arguments = array(
    $number,
  );
  if (isset($status)) {
    $sql .= " AND status = %d";
    $arguments[] = $status;
  }
  $data = db_fetch_array(db_query($sql, $arguments));
  return $data['uid'];
}