You are here

function contact_permissions_form_alter in Contact Permissions 6

Implementation of hook_user().

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

File

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

Code

function contact_permissions_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_profile_form') {
    $account = $form['_account']['#value'];
    $access = contact_permissions_check_access($account);
    if (!$access) {
      unset($form['contact']);
    }
  }
}