Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
contact.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Apr 2007 at 17:11 UTC
Updated:
9 Jul 2011 at 15:47 UTC
Jump to comment: Most recent file
Comments
Comment #1
unghander commentedThis is exactly what I need but can anyone please tell me how to install that patch? Must I copy the file in the contact folder or in the permissions folder or where?
Comment #2
Gurpartap Singh commentedRead about patches: http://drupal.org/patch
Applying patches: http://drupal.org/patch/apply
Comment #3
dokumori commentedHere's a module for 5.x that does the same thing (pretty much). Using this module allows easier maintenance than applying a patch.
Comment #4
darumaki commentedI tried your mod for 5.x but it doesn't show up in the mod list
Comment #5
matt bThis module has been on my 5.x site for some time and works great. I'm thinking of upgrading to 6.x - any chance of a 6.x version of this module?
Comment #6
matt bI've upgraded this to work on drupal 6. Tarball attached.
Comment #7
mjourney2 commentedThe 6.x module does not seem to be working for me. I uploaded the files in the modules dir and enabled the module. Then I selected the roles who should have x_contact access. But the form still appears on everyone's profile. What am I missing? Thanks.
Comment #8
darumaki commentedIt worked for me, try rebuilding permissions
Comment #9
rsantiag commentedGreat!! that works!!!
Comment #10
pasqualleComment #11
Rob T commentedMatt's #6 worked as advertised in my 6.6 install. Thanks!
I ended up using x_contact_option to create a similar module - x_picture_option - that can restrict specified roles from accessing the upload picture form in profile.
If any of these bust, I'll be sure to chime back in.
Comment #12
wrb123 commentedThank you so much, Matt B, for the D6 module! I have a site that is live and I was forced to hide that part of User Profile / Edit with CSS (*shudder*). I extracted the tar to my /sites/all/modules/, enabled it under modules, and then gave only administrators the permission.
Awesome!
-Bill
Comment #13
matt bBill - you're welcome, but I think that the real thanks go to dokumori (#3) who provided the 5.x module in the first place!
This just shows that this permission should be in drupal core.
Comment #14
karens commentedThere may be overlap with #371621: Create permission to use personal contact form, #386572: Giving permission to contact any user, #58224: Allow anonymous users access to a members personal contact form. #58224: Allow anonymous users access to a members personal contact form seems to be the current issue for changes in the permissions for the contact form. Maybe this issue could or should be rolled into that one?
Comment #15
karens commentedIn fact, I'll mark it a duplicate. Someone can re-open if there is some reason why this can't be merged into that issue.
Comment #16
k3vin commented+1
Comment #17
crutch commentedyay, this is much better than my hack I was using. Thanks so much.
The only reason I hacked in the first place is that when a user clicks on the link in the help text under the check box it shows access denied. From a usability standpoint a user thinks this is an error and they think the personal contact form is not functional when in fact it works just fine. There is no way to explain it every time to every user to make them understand.
Comment #18
WildKitten commentedWorked perfect for me in drupal 6. Ty m8 :)
Comment #19
Weka commentedThank you Matt and documori. This is a must have module.
Is there a reason that this module is not included in the Modules section?
Comment #20
massimoi commentedI've just made a little modification to #6 in order to get the right form, even if the url is different.
/**
* implementation of hook_form_alter
* hide personal contact form for all users
*/
function myarea_option_form_alter(&$form, $form_state, $form_id)
{
if ($form_id=='user_profile_form'){
unset ($form['contact']);
}
}
Regards,
Massimo
----------------------------
http://impronta48.it
Comment #21
massimoi commentedI've just made a little modification to #6 in order to get the right form, even if the url is different.
/**
* implementation of hook_form_alter
* hide personal contact form for all users
*/
function myarea_option_form_alter(&$form, $form_state, $form_id)
{
if ($form_id=='user_profile_form'){
unset ($form['contact']);
}
}
Regards,
Massimo
----------------------------
http://impronta48.it
Comment #22
sol1313 commentedWorked like a charm! Many thanks!
Comment #23
mylesorme commentedAgh, shame, the module has not worked for me in 6.14 - I still have all the user contact forms.
I've tried setting ever role to having permission; then turning it off for every role, rebuilding permissions table each time - no joy. boo hoo.
Any suggestions anyone?
Thanks
Comment #24
3dloco commentedsubscribing
Comment #25
3dloco commentedInstalled #6 on 6.14 and it is working for me! Thank you!
Comment #26
xaviercas commentedInstalled #6 on 6.15, working great, thank you very much.
Comment #27
skelly commented@#15 KarenS
At your suggestion I have re-opened this as it has not been addressed by those issues and they are now closed.
I use this incredibly simple, straightforward and seemingly safe core patch on just about every site I create and have applied it to 4.7, 5, and 6 sites.
It would seem to me a pity not to at least get it added to D7.
I'm busy but happy to try to make that happen with guidance.
Comment #28
dave reidWe've had more progress so far in #254460: Add permission to *have* a personal contact form but at this point its too late to get into D7.
Comment #29
gillypots commentedExcellent, many thanks , worked a treat !!
Comment #30
sadist commentedThank you so much!!
Comment #31
dkane commented#6 is spectacular. Thanks so much!
Comment #32
john.kenney commented#6 works for me on 6.15.
nice job. thank you.
Comment #33
dc1258 commentedNumber 6 does not work for me. When a user selects another user profile two things happen:
-If they are friends, the contact tab is not shown.
-If they are not friends the contact tab is shown.
Any idea what's causing this problem?
Comment #34
john morahan commentedThe reason #6 doesn't work is because in D6, hook_menu is called once, when the menu is being rebuilt, and whatever the arg() and user_access() functions happen to return at that time will get stuck in the menu definition forever (or at least until the menu is rebuilt again). Also, 'access' doesn't exist anymore.
Instead, you need to implement hook_menu_alter and fiddle with the access callback. Something like this perhaps (untested):
Comment #35
dc1258 commentedUnfortunately I am really not good at code development and would have no idea to implement this. If someone else knew how to do this and confirm it works that would be great!
Comment #36
vireodesign commentedsubscribing
Comment #37
skizzo commentedSubscribing. Applied #6 to D6.18 and rebuilt access permissions. Contact settings is now correctly removed from Profile edit page but
Contact tab is still appearing in user page, and contact form can still be used. If anyone has applied suggestion #34 please share the updated patch. Thank you.
Comment #38
sadist commentedSkizzo. Did you logged in as a normal user or user-1? Superadmin (user-1) will still be able to use the contact form.
Comment #39
skizzo commentedI logged in as a normal user, but your response prompted me to do some more testing and I realized that one user had its "allow contact" flag turned on before enabling x_contact_option, and I happened to do my testing against that specific user... So, you could disable personal contact site-wide, and still enable it for some users (controlled only by admin). Thank you!
Comment #40
mr.j commentedPatch at #6 plus #34 works for D6 but a contact form for user 1 always shows up as the admin has all permissions.
But we don't want any user contact forms at all.
To remove it completely for all users you just need to put code like this in your own module:
Comment #41
freelylw commentedsubscribing
Comment #42
rplescia commentedThis all works fine except that when users register the 'contact' option is set to true by default so it means you can still see the tab unless the user unticks the box or the "contact";i:1; value is changed to "contact";i:0; in the data filed of the users table. Is there a way to change the default register behaviour so that this can be set to false.
Comment #43
rplescia commentedNevermind, answered my own question. Just go to Admin >> Contact >> Settings and uncheck the box at the bottom of the page.
Comment #44
deminyA D7 version (module 'no_contact_option') can be found from here http://drupal.org/sandbox/deminy/1213640 . Please note that there is a new permission "Use users' personal contact forms" introduced in D7 core, so this module doesn't need to add any new permission in D7.
In D7, module 'no_contact_option' does one thing only: remove option 'Contact settings' completely from user edit page.
For any issues, please report it under the sandbox project. Thanks