You are here

function commons_group_is_trusted_contact in Drupal Commons 7.3

Returns whether or not two users are trusted contacts.

Parameters

$uid: User ID.

$account: Optional; Other user's object. If not provided, current user will be used.

1 call to commons_group_is_trusted_contact()
commons_trusted_contacts_privatemsg_write_access in modules/commons/commons_trusted_contacts/commons_trusted_contacts.module
Access callback for writing a private message to another user; Checks permissions and makes sure that the given user and the logged-in user are Trusted-Contacts.

File

modules/commons/commons_trusted_contacts/commons_trusted_contacts.module, line 919

Code

function commons_group_is_trusted_contact($uid, $account = NULL) {
  if (empty($account)) {
    global $user;
    $account = $user;
  }
  return og_is_member('user', $uid, 'user', $account, array(
    OG_STATE_ACTIVE,
  ));
}