function privatemsg_allow_disable

7-2 privatemsg.module privatemsg_allow_disable($account)

Checks if the user is allowed to disable/enable private message.


object: User object to check.

Return value

bool TRUE if the user is allowed to disable the private message.

2 calls to privatemsg_allow_disable()
privatemsg_form_alter in ./privatemsg.module
Implements hook_form_alter().
privatemsg_user_update in ./privatemsg.module
Implements hook_user_update().


./privatemsg.module, line 1433
Allows users to send private messages to other users.


function privatemsg_allow_disable($account) {
  global $user;

  $allow_disable_privatemsg = TRUE;
  // Compare it to current user id.
  if ($user->uid != $account->uid) {
    // User must have administer permission to disable other users' private message
    // and the edited user must be able to change the setting.
    $allow_disable_privatemsg = (user_access('administer privatemsg settings') && user_access('allow disabling privatemsg', $account));

  return $allow_disable_privatemsg;