Posted by jpmckinney on August 21, 2009 at 5:22pm
Jump to:
| Project: | SMS Framework |
| Version: | 6.x-2.x-dev |
| Component: | Send to Phone |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
In sms_sendtophone_page():
<?php
if (user_access('send to any number') || !empty($user->sms_user['0']['number'])) {
$form = drupal_get_form('sms_sendtophone_form', $type);
}
else {
if (empty($user->sms_user['0']['number']) && user_access('send to any number')) {
$register = array(
'#value' => t('You need need to <a href="@setup">setup</a> your mobile phone to send messages.', array('@setup' => url('user/'. $user->uid .'/mobile')))
);
}
else {
$register = array(
'#value' => t('You do not have permission to send messages. You may need to <a href="@signin">sign in</a> or <a href="@register">register</a> for an account to send messages to a mobile phone.', array('@signin' => url('user', array('query' => array('destination' => $_GET['destination']))), '@register' => url('user/register', array('query' => array('destination' => $_GET['destination']))))),
);
}
$form = drupal_render($register);
}
?>The following:
<?php
if (empty($user->sms_user['0']['number']) && user_access('send to any number')) {
?>will always evaluate to FALSE, as user_access('send to any number') cannot be TRUE at this point, because if it were TRUE, the code within the previous if-statement would have been run instead. The quoted line should be replaced with:
<?php
if (empty($user->sms_user['0']['number'])) {
?>which results in the expected behavior.
Comments
#1
#2
#3
Automatically closed -- issue fixed for 2 weeks with no activity.