Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable the personal contact form option in the user edit form?

I am a Drupal beginner. When users create their account, they have the option to have a personal contact form. Where do I go to disable that? It's not in permissions. It's not a bad option, but I know it will confuse the hell out of my site's users. It may even scare some away!

like image 375
Behrooz Karjoo Avatar asked Mar 29 '10 19:03

Behrooz Karjoo


3 Answers

Tested in Drupal 7.

Place the following in template.php of your theme. Change MYTHEME to your theme name.

function MYTHEME_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_profile_form') {
    $form['contact']['#access'] = FALSE;
  }
}

Notice that access is set to false, instead of being unset(), i.e. removed. That way we're not interfering with the flow of data.

like image 68
timofey.com Avatar answered Nov 20 '22 03:11

timofey.com


If you visit admin/build/contact/settings in Drupal 6 or 5 you can untick "Enable personal contact form by default"

like image 3
Paul D'Ambra Avatar answered Nov 20 '22 03:11

Paul D'Ambra


A personal contact form is not something you get by default in Drupal. There are modules that can do this, you have probably activated such a module. Check what modules you have activated at admin/build/settings.

If you want to disable this for regular users only you should instead check you permission settings.

like image 2
googletorp Avatar answered Nov 20 '22 03:11

googletorp