• Welcome to Simple Machines Community Forum. Please login or sign up.
October 19, 2021, 07:40:49 AM

News:

SMF 2.0.18 has been released! Please update. Read more.


Disable EMail-sending for users

Started by demlak, January 03, 2013, 01:42:31 PM

Previous topic - Next topic

demlak

Link to Mod

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/

NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

ms_ukyankee

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
SMF since 2004 <3

NanoSector

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 :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

OCJ

Nice... this saved me a lot of manual edits done previously.

Oscar the Grouch

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

demlak

you have to go into your database.. for example by using "Adminer 4.2.1 for MySQL"

ms_ukyankee

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.
SMF since 2004 <3

pocttopus

Is it possible to block sending emails for a specific user, not for all members?

lostpathway

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.

pocttopus

November 08, 2017, 09:45:54 AM #10 Last Edit: November 08, 2017, 10:10:35 AM by pocttopus
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.

dalslandan

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.

Advertisement: