diff options
Diffstat (limited to 'modules/contact')
-rw-r--r-- | modules/contact/contact.module | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/modules/contact/contact.module b/modules/contact/contact.module index bbe1389c5..4eb82043f 100644 --- a/modules/contact/contact.module +++ b/modules/contact/contact.module @@ -130,12 +130,10 @@ function contact_load($cid) { } /** - * Implementation of hook_user(). - * - * Allows the user the option of enabling/disabling his personal contact form. + * Implementation of hook_user_form(). */ -function contact_user($type, &$edit, &$user, $category = NULL) { - if ($type == 'form' && $category == 'account') { +function contact_user_form(&$edit, &$user, $category = NULL) { + if ($category == 'account') { $form['contact'] = array('#type' => 'fieldset', '#title' => t('Contact settings'), '#weight' => 5, @@ -148,12 +146,20 @@ function contact_user($type, &$edit, &$user, $category = NULL) { ); return $form; } - elseif ($type == 'validate') { - return array('contact' => isset($edit['contact']) ? $edit['contact'] : FALSE); - } - elseif ($type == 'insert') { - $edit['contact'] = variable_get('contact_default_status', 1); - } +} + +/** + * Implementation of hook_user_insert(). + */ +function contact_user_insert(&$edit, &$user, $category = NULL) { + $edit['contact'] = variable_get('contact_default_status', 1); +} + +/** + * Implementation of hook_user_validate(). + */ +function contact_user_validate(&$edit, &$user, $category = NULL) { + return array('contact' => isset($edit['contact']) ? $edit['contact'] : FALSE); } /** |