Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: demlak on January 03, 2013, 01:42:31 PM

Title: Disable EMail-sending for users
Post by: demlak on January 03, 2013, 01:42:31 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3598)

Disable to send EMail with Forum-System for Users lower than Admin

Disable activation of this function for each user by removing option out of "Register Page" and "Profile Edit Page".
-> no one is able to activate this feature
-> if no one is able to activate this feature, no one is able to use it (only admins are still able to use it globaly)

drawback:
people who enabled "Allow users to email you?" before this mod is installed, can not change this feature anymore.
Mod needs to be disabled to change this option in profile.


licensed:
http://creativecommons.org/licenses/by-sa/3.0/
Title: Re: Disable EMail-sending for users
Post by: NanoSector on January 03, 2013, 01:47:07 PM
Congrats on your second mod :)
Title: Re: Disable EMail-sending for users
Post by: ms_ukyankee on January 07, 2013, 01:46:59 PM
Excellent, thank you. :)

I think this is the query to set everyone's profile to hide email:

UPDATE `smf_members` SET `hide_email` = 1 WHERE `hide_email`=0
Title: Re: Disable EMail-sending for users
Post by: NanoSector on January 07, 2013, 01:56:23 PM
Quote from: purplepaisley68 on January 07, 2013, 01:46:59 PM
Excellent, thank you. :)

I think this is the query to set everyone's profile to hide email:

UPDATE `smf_members` SET `hide_email` = 1 WHERE `hide_email`=0

That should work, yes :)
Title: Re: Disable EMail-sending for users
Post by: OCJ on March 25, 2013, 02:48:05 AM
Nice... this saved me a lot of manual edits done previously.
Title: Re: Disable EMail-sending for users
Post by: Oscar the Grouch on March 25, 2015, 08:10:31 AM
Quote from: purplepaisley68 on January 07, 2013, 01:46:59 PM
Excellent, thank you. :)

I think this is the query to set everyone's profile to hide email:

UPDATE `smf_members` SET `hide_email` = 1 WHERE `hide_email`=0


how do you do this. im still kind of new to this stuff
Title: Re: Disable EMail-sending for users
Post by: demlak on March 25, 2015, 08:33:04 AM
you have to go into your database.. for example by using "Adminer 4.2.1 for MySQL (http://www.adminer.org)"
Title: Re: Disable EMail-sending for users
Post by: ms_ukyankee on March 25, 2015, 05:38:58 PM
Quote from: Oscar the Grouch on March 25, 2015, 08:10:31 AM
how do you do this. im still kind of new to this stuff

If you have Cpanel hosting, you will probably already have PHPadmin to access the database.
Title: Re: Disable EMail-sending for users
Post by: pocttopus on November 07, 2017, 02:37:57 PM
Is it possible to block sending emails for a specific user, not for all members?
Title: Re: Disable EMail-sending for users
Post by: lostpathway on November 08, 2017, 08:38:26 AM
This isn't entirely a fix, but you could place that individual user into a unique forum group and change the permissions of the group to restrict the number of private messages they can send. 0 = unlimited, so may have to limit it to 1. Not sure if that will work for you, but maybe.
Title: Re: Disable EMail-sending for users
Post by: pocttopus on November 08, 2017, 09:45:54 AM
Quote from: lostpathway on November 08, 2017, 08:38:26 AM
This isn't entirely a fix, but you could place that individual user into a unique forum group and change the permissions of the group to restrict the number of private messages they can send. 0 = unlimited, so may have to limit it to 1. Not sure if that will work for you, but maybe.
Sure it would be helpful advice.:)
I am trying to figure how can I restrict that group a permissions for not allowing sending emails.

I don't want to send mails, not even 1.
Title: Re: Disable EMail-sending for users
Post by: dalslandan on November 04, 2019, 03:06:35 PM
Works well. However there is 1 flaw. During the registration, the POST can be successfully altered with manually inserted HTML code.
To fix this issue, you can find and change the following:

Open Register.php, and find:
// By default assume email is hidden, only show it if we tell it to.
$_POST['hide_email'] = !empty($_POST['allow_email']) ? 0 : 1;


Replace with:
// Email is always hidden by default, when registering.
$_POST['hide_email'] = 1;


Changed the comment, to reflect the new code correctly.