Tony Crockford wrote:
Hi
I'm new, please go easy on me.
I've been looking through the modules for Drupal 6.x and I can't quite match what I'm looking for, what i want to be able to do is have a user role that can access personal contact forms (if the user has allowed them)
e.g. anonymous can't see the personal contact form
authenticated user can't see the personal contact form
gold_authenticated user *can* see the personal contact form *if* the user has allowed it
any ideas?
Not sure if there's an existing module, but one idea for writing a simple one:
By using hook_menu_alter [1] you could re-define the access function:
function mymodule_menu_alter(&$callbacks) { $callbacks['user/%user/contact']['access callback'] = 'mymodule_contact_access_function_name'; }
then you could define:
function mymodule_contact_access_function($account) {
...implement whatever logic you want...
}
You can see how contact defines access by default here [2].
1. http://api.drupal.org/api/function/hook_menu_alter/6 2. http://api.drupal.org/api/function/_contact_user_tab_access/6
Cheers,
Jonathan