I often build communities for groups of individuals where there is already a level of trust between users. Therefore, it makes sense for these sites to have the personal contact module automatically turned on when a new user is created. This patch makes "opt out" behavior for this module possible, when enabled by the adminstrator.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

+1 for the idea

Crell’s picture

Status: Needs review » Reviewed & tested by the community

I would probably have called it something like "Default to contactable" rather than "opt out", but this works too.

Code looks good, applies cleanly against CVS HEAD, works as advertised, and does something very very good.

+1, ready to commit.

Dries’s picture

Status: Reviewed & tested by the community » Needs work

I think the description could use some work. Can't we use something; 'enable the contact form for new users' or something? Also, please don't use tabs.

Steve Dondley’s picture

FileSize
1.89 KB

Don't know what's up with my text editor. I have it set to use spaces instead of tabs.

Anyway, here's a revised patch per Dries' suggestions. I also forgot to mention that this patch will not actually work until the patch at http://drupal.org/node/41351 is applied to HEAD.

Steve Dondley’s picture

Actually, strike that last sentence. This patch includes the change to the parameter.

Steve Dondley’s picture

FileSize
3.06 KB

Here's another revision that tweaks the help text some more.

This patch also adds some advisory language (seen only when the opt out feature is turned on) to users sending an email to other users "that the sending of unsolicited, commercial e-mail to other members of this site may be illegal in some countries". Thanks to osinet over in chat for pointing this out.

moshe weitzman’s picture

i don't think we need to advise people of things that may be illegal. writing slander is illegal too. and so on.

further, that sort of message is best ouput through drupal_set_message() not in the page body directly.

drewish’s picture

I'm all for this idea, I'll take a look at the patch when I get a minute.

Steve Dondley’s picture

FileSize
1.89 KB

Removed advisory about commercial spam.

Crell’s picture

Well as long as we're nitpicking text... :-)

Functionality looks good, but it would probably be clearer to say "Enable personal contact forms for new users by default" (to make it clear that we're talking about a default setting, not that no one can contact anyone without this checked). Also, the description text should then be prefixed with "If set,", or otherwise clarified.

Steve Dondley’s picture

Status: Needs work » Needs review
Steve Dondley’s picture

Status: Needs review » Needs work

Does not apply cleanly.

Zen’s picture

Status: Needs work » Needs review
FileSize
1.66 KB

Steve's patch re-rolled with some text fixes. Also changed the ifs to elseifs.

Thanks,
-K

Zen’s picture

Forgot to mention: #13 changes the default *admin* setting to 1 as opposed to #9 which was 0. The admin can opt-out as well :) #13 also initialises $edit['contact'] to avoid a PHP notice later on.

-K

Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks guys!

Anonymous’s picture

Status: Fixed » Closed (fixed)
Robert Castelo’s picture

Version: » 4.7.3
FileSize
1.05 KB

Here's a module that takes care of this if you need the feature now.

Put this in a 'contact_default' directory in your modules directory.

sym’s picture

Was this removed? I can't see it in 4.7.3 at all now...