function sms_user_get_uid in SMS Framework 6.2
Same name and namespace in other branches
- 5 modules/sms_user/sms_user.module \sms_user_get_uid()
- 6 modules/sms_user/sms_user.module \sms_user_get_uid()
- 7 modules/sms_user/sms_user.module \sms_user_get_uid()
Returns the uid of the owner of a number.
4 calls to sms_user_get_uid()
- sms_action_match_user in modules/
sms_user/ sms_user.rules.inc - Rules action callback to match number to user.
- 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 82 - 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'];
}