Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: ApplianceJunk on June 03, 2012, 09:52:56 PM

Title: PM and email?
Post by: ApplianceJunk on June 03, 2012, 09:52:56 PM
If I uncheck:

"Contact members using the personal messaging system"

in Administration Center » Permissions » General Permissions

for the "Regular" member group it seems our "Technician" group can still send PM's to "Regular" members.
Why is the "Technician" group even able to see the PM icon for regular members when I have PM's turned off for them?

Also what do I need to change so members can't email other members.

Thanks,
Title: Re: PM and email?
Post by: Arantor on June 03, 2012, 10:13:27 PM
Sure, you've turned off the ability of Regular Members to send PMs, not for the Technician group... in order for the Technician group not to see it, you'd have to turn it off for them as well.

As for email, there should be a permission for sending email to other users...
Title: Re: PM and email?
Post by: ApplianceJunk on June 03, 2012, 10:18:39 PM
I turned of the ability for Regular Members to send and receive PM's, so why would another group be able to send "Regular Members" PM's when they (Regular Members) have no option to receive them?

When searching for a answer to my email question the only thing I have been able to find is to remove the code for the check box on the registration page. The check box for "Allow users to email me".
http://www.simplemachines.org/community/index.php?topic=471741.0


I would like to remove the ability for all current and future members to email each other.

Thanks,
Title: Re: PM and email?
Post by: Arantor on June 03, 2012, 10:44:23 PM
Because the permissions are totally independent. Technicians have the power to send, that's all they need, no check is done on whether the receiving user can *read* it. To do so would be a lot slower than not doing it, and for the vast majority of cases it's absolutely fine... so just disable that permission and it'll stop being a problem.

As far as users emailing each other, that's a code edit.

First to Sources/SendTopic.php
Code (find) Select
// Allow a user to send an email.
function CustomEmail()
{


Code (replace) Select

// Allow a user to send an email.
function CustomEmail()
{
fatal_lang_error('no_access', false);


That takes care of actually sending emails. Now we need to remove it from the display template too - your theme's Display.template.php:
// Don't show the email address if they want it hidden.
if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')))
echo '
<li><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.gif" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';


You should also remove the Send topics to friends permissions too, by the way, to remove the Send This Topic button which can do something similar.
Title: Re: PM and email?
Post by: ApplianceJunk on June 03, 2012, 11:17:04 PM
Do I need to do a code edit to remove "Send topics to friends permissions"?

Thanks,
Title: Re: PM and email?
Post by: Arantor on June 04, 2012, 09:45:15 AM
No, because it's a regular permission...
Title: Re: PM and email?
Post by: ApplianceJunk on June 04, 2012, 10:12:12 AM
Quote from: Arantor on June 04, 2012, 09:45:15 AM
No, because it's a regular permission...

Can't seem to find it.
Where do I find the setting for that permission?
Title: Re: PM and email?
Post by: Arantor on June 04, 2012, 10:25:56 AM
It's a board level permission.
Title: Re: PM and email?
Post by: ApplianceJunk on June 04, 2012, 11:25:54 AM
Quote from: Arantor on June 04, 2012, 10:25:56 AM
It's a board level permission.

Ok, but I'm not sure why I would want to remove the Send topics to friends.

I just want to keep members from emailing each other. If a member want to send a topic to a friend (non forum member) they need to have the friends email address already right?

They won't be able to get other members email address with the other edits I have made, but they can still send the topic to non member friends.

Maybe I'm not fully understanding just how the Send topic to friends works, even though I tried it.

The other edits worked great for not letting members email each other and removing the email icon, thanks!
Title: Re: PM and email?
Post by: Arantor on June 04, 2012, 11:27:38 AM
You don't *need* to do it, I just thought you wanted to prevent any emails going out to people like that, if that's not a problem, no need to change it.
Title: Re: PM and email?
Post by: ApplianceJunk on June 04, 2012, 11:35:50 AM
Just so the Send topic to friends option can't be used to get other members email address I don't care.
Title: Re: PM and email?
Post by: ApplianceJunk on June 04, 2012, 03:26:08 PM
Got it working the way i want thanks to Arantor!

Marking it solved.

Thanks again Arantor.
Title: Re: PM and email?
Post by: emanuele on June 05, 2012, 04:52:57 AM
Quote from: Arantor on June 03, 2012, 10:13:27 PM
As for email, there should be a permission for sending email to other users...
There will be:
http://dev.simplemachines.org/mantis/view.php?id=4978
Title: Re: PM and email?
Post by: ApplianceJunk on June 06, 2012, 02:40:44 PM
In my error log I have been getting a few of these today.

Quote
http://appliancejunk.com/forums/index.php?action=register2
Couldn't get mail server response codes

Would this be related to any of the edits I made in the post above?

Seems people are still able to register, so I'm not sure why this error is happening or what is causing it.

Any thoughts?

Thanks,