function privatemsg_is_disabled

7-1 privatemsg.module privatemsg_is_disabled($account)
7-2 privatemsg.module privatemsg_is_disabled($account)
6-2 privatemsg.module privatemsg_is_disabled($account)

Checks the status of private messaging for provided user.

Parameters

user object to check:

Return value

TRUE if user has disabled private messaging, FALSE otherwise

4 calls to privatemsg_is_disabled()
privatemsg_form_alter in ./privatemsg.module
Implements hook_form_alter().
privatemsg_privatemsg_block_message in ./privatemsg.module
Implements hook_privatemsg_block_message().
privatemsg_user_access in ./privatemsg.module
Privatemsg wrapper for user_access.
privatemsg_user_update in ./privatemsg.module
Implements hook_user_update().

File

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

Code

function privatemsg_is_disabled($account) {
  if (!$account || !isset($account->uid) || !$account->uid) {
    return FALSE;
  }

  // Make sure we have a fully loaded user object and try to load it if not.
  if ((!empty($account->roles) || $account = user_load($account->uid)) && user_access('allow disabling privatemsg', $account)) {
    $ids = privatemsg_get_default_setting_ids($account);
    return (bool) privatemsg_get_setting('disabled', $ids);
  }
  else {
    return FALSE;
  }
}