You are here

function contact_permissions_form_user_profile_form_alter in Contact Permissions 7

Implements hook_form_FORM_ID_alter().

Restricts the option of enabling/disabling his personal contact form. Based on permissions defined by this module.

File

./contact_permissions.module, line 55
Provides permissions for having a personal contact form

Code

function contact_permissions_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
  $account = $form['#user'];
  $access = contact_permissions_check_access($account);
  if (!$access) {
    $form['contact']['#access'] = FALSE;
  }
}