function sms_user_authenticate in SMS Framework 6
Same name and namespace in other branches
- 5 modules/sms_user/sms_user.module \sms_user_authenticate()
- 6.2 modules/sms_user/sms_user.module \sms_user_authenticate()
- 7 modules/sms_user/sms_user.module \sms_user_authenticate()
Authenticate a user based on mobile number.
Parameters
$number: The number to authenticate against. For security, this should only be provided by incoming messages, not through user input.
1 call to sms_user_authenticate()
- sms_user_sms_incoming in modules/
sms_user/ sms_user.module - Implementation of hook_sms_incoming().
File
- modules/
sms_user/ sms_user.module, line 490 - Provides integration between the SMS Framework and Drupal users.
Code
function sms_user_authenticate($number) {
global $user;
$uid = sms_user_get_uid($number);
if ($account = user_load(array(
'uid' => $uid,
'status' => 1,
))) {
$user = $account;
watchdog('sms', '%name was authenticated using SMS.', array(
'%name' => $user->name,
));
return $user;
}
}