Remove "Send Email" option with NAML

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove "Send Email" option with NAML

MW99
Is it possible to remove the "Send Email" button on user profiles on my Nabble forum? I've heard that this is possible with NAML, but I'm not sure how.

Help appreciated.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
You need to edit the "profile_header" macro. However, I would caution against doing a blanket removal of that code segment and suggest that you make it conditional so that Administrators will continue to see the option. Unfortunately, I don't have the skills to advise on how to do that.

However, your request begs the question... What exactly is the concern about a user privately revealing their address to another forum user?

Bare in mind these factors:
• Anyone who wishes to remain anonymous can always change their Nabble registered address to one that can be used for that forum only and abandoned at any time.
• When using the User Profile screen ordinary users cannot see the address to which an email is sent.
• A user's registered email address is kept secret to all except forum administrators, who are the only ones who see it on a user's Profile page.
• What is sent by Nabble from a user's Profile screen is a true email. In consequence the sender's registered address will be  revealed in the recipient's email program, but the sender does not know to what address it is sent. This has the big advantage that the recipient doesn't not have to be constantly checking a forum just in case they have been PMed and reduces the likelihood that that someone would maliciously start PM communication.

Of course this last factor does mean that if the recipient then replies, the message goes straight to the original poster's email address and, as you would expect when sending any email, that email will reveal the sender's email address, but it's their choice whether they do this and they could always use an address they are prepared to abandon too.

In short, Nabble does NOT offer a "PM" service where users can hide behind anonymous forum usernames, but all a user needs to do is use a temporary abandonable address.

• Simply having email contact disallowed could force your users to share information that might be best kept private and that has security implications for them.
• Posting information on the forum that may be best sent privately can lead to flame wars and generally be disruptive to the conduct of your forum.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

MW99
Hi Greg, thanks for your reply.

The reason I want to disable that option is that I do not want people giving out their emails by accident and such. For privacy reasons.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
Well, it's hard to send an email by accident within Nabble.

Everywhere within Nabble it is perfectly clear that it is an email that you are going to send and anyone used to the web should know that implies providing an address to which a reply can be addressed.

PM is a completely alien concept within Nabble.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
In reply to this post by MW99
To disable all emails, you can do this (if your Nabble setup is the same as mine):

Go to Edit this page in the lower right.
Search macros (in the tool button thing)
Search by name
search for send_email_to_user_link
Remove at least the line that says this:
<a href="[n.local_user.send_email_path/]"><t>Send Email to <t.author.local_user.name/></t></a> 

I'm still trying to figure out how to make it so it only takes the line out for certain groups, banned users, or such, though.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
Here's one way to make it so only admins can send emails (although with the option above, you can still see their email address on their profile—just without being able to use the form to email them):

Here's the new code for the macro called send_email_to_user_link:
 <override_macro name="send_email_to_user_link" requires="user">
    <n.set_local_user.this_user />
    <!-- If this is not the profile of the visitor AND the user is authenticated -->
    <n.if.both condition1="[n.not.visitor.equals.local_user/]" condition2="[n.local_user.is_authenticated/]">
        <then>
            <n.if.visitor.is_site_admin>
                <then>
                    <div style="margin-top:.5em">
                        <img src="/images/mail.png" align="absmiddle" width="18" height="13"/>
                        <a href="[n.local_user.send_email_path/]"><t>Send Email to <t.author.local_user.name/></t></a> (This will reveal your email address.)
                    </div>
                </then>
            </n.if.visitor.is_site_admin> 
        </then>
    </n.if.both>
</override_macro> 
 
Here's the old code:
 <macro name="send_email_to_user_link" requires="user">
    <n.set_local_user.this_user />
    <!-- If this is not the profile of the visitor AND the user is authenticated -->
    <n.if.both condition1="[n.not.visitor.equals.local_user/]" condition2="[n.local_user.is_authenticated/]">
        <then>
            <div style="margin-top:.5em">
                <img src="/images/mail.png" align="absmiddle" width="18" height="13"/>
                <a href="[n.local_user.send_email_path/]"><t>Send Email to <t.author.local_user.name/></t></a>
            </div>
        </then>
    </n.if.both>
</macro> 
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
Now if I only knew how to make it check for custom user groups.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
In reply to this post by mark
<n.if.visitor.is_banned>
…
</n.if.visitor.is_banned> 

The above can be used in place of

<n.if.visitor.is_site_admin>
…
</n.if.visitor.is_site_admin>

to make something happen for banned users.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
This post was updated on .
In reply to this post by mark
EDIT: Nevermind this reply (the code snippets don't work; still figuring NAML out). See my reply to it for an example that works for me.

I have to go, but maybe you can test make a macro (similar to the is_site_admin macro) with code similar to this (not sure if this code is functional, yet):

<macro name="is_x" requires="user">
    <condition1.is_in_group group="[n.x_group/]" />
</macro> 

x is the name of the group.

Or maybe just not make a macro and use

<n.if.visitor.is_in_group group="[n.x_group/]">
…
</n.if.visitor.is_in_group group="[n.x_group/]">

I haven't tested that.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
In reply to this post by mark
mark wrote
I'm still trying to figure out how to make it so it only takes the line out for certain groups, banned users, or such, though.
As banned users can't login they won't be able reach the send email screen so that's not a group worth bothering about.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
In reply to this post by mark
mark wrote
Here's one way to make it so only admins can send emails (although with the option above, you can still see their email address on their profile—just without being able to use the form to email them):
But only an Administrator sees that line on a user's profile page, so it doesn't matter.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
I guess what I am really saying in my last two posts is that I think the idea of disabling email for users is a bad idea for the various reasons explicit and implicit in my post above.

If you run a forum where you feel that you have naive users who might unwisely email undesirables by using the send email feature then in your forum description strongly recommend those who register to use a disposable address used on on that forum.
Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
This post was updated on .
In reply to this post by GregChapman
I actually have tested this, and yes, my banned users can log in.

On January 4, 2020, at 11:11 AM, "GregChapman [via Nabble Support]" <ml+s1n7604790h23@n2.nabble.com> wrote:

mark wrote

I'm still trying to figure out how to make it so it only takes the line out for certain groups, banned users, or such, though.

As banned users can't login they won't be able reach the send email screen so that's not a group worth bothering about.

                                Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.

       
       
         

               

If you reply to this email, your message will be added to the discussion below:

                http://support.nabble.com/Remove-Send-Email-option-with-NAML-tp7591364p7604790.html 

       

                  To unsubscribe from Remove "Send Email" option with NAML, click here.
                NAML

Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
This post was updated on .
In reply to this post by GregChapman
All users can see it in my forum. I did test it. Banned users can log in and email other users, too. But, changing the NAML code removes that link for them.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
This post was updated on .
In reply to this post by GregChapman
I don't pretend to understand why the user who asked wanted the feature, but I do think there are situations where it's possibly a good idea. Not every forum (or blog or newspaper) has the same goals. Not every forum needs email, IMO.

As for my own forum, I actually do want other users to be able to email each other, but I'm trying to make it so I can revoke the privilege on a case by case basis (and learning these things along the way is helpful). I mean, if a user obviously abuses email, or is a blatant spammer, I'd rather them not be able to email people, while I still want other users to be able to.

I'm not sure what you can and can't do on other Nabble servers, but on mine, profile pages render for users differently, apparently. Yes, I've temporarily disabled emails for all users but administrators, but that's only for the sake of being in the middle of figuring things out (not because I want that feature to remain in my forum). I'm the only person with user accounts right now (so, it's not a big deal leaving it like that for a day).

Anyway, whether you think the feature the user requested is a good idea or not, you've already warned them. If they don't take your advice, they probably have what they believe to be a good reason. People don't always ask the questions for their own exact scenario, either.

I could probably easily use NAML to make it so banned users (or even other user groups) can't log in on my forum. So, I'm not upset about banned users being able to log in or anything. That's kind of cool.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
In reply to this post by mark
I figured out how make emails only show up for a custom group (on n8.nabble.com, at the very least)! Here's how:

Create a new user group called Emailers. Add all users to this group that you want to be able to email (including administrators). This is only good for forums where you don't mind doing that.

Create macros named emailers_group and is_emailer. The code for each is below.

<macro name="emailers_group">
    Emailers
</macro> 

<macro name="is_emailer" requires="user">
    <n.is_in_group group="[n.emailers_group/]" />
</macro> 

Then, modify the macro called send_email_to_user_link to say the following:

 <override_macro name="send_email_to_user_link" requires="user">
    <n.set_local_user.this_user />
    <!-- If this is not the profile of the visitor AND the user is authenticated -->
    <n.if.both condition1="[n.not.visitor.equals.local_user/]" condition2="[n.local_user.is_authenticated/]">
        <then>
            <n.if.visitor.is_emailer>
                <then>
                    <div style="margin-top:.5em">
                        <img src="/images/mail.png" align="absmiddle" width="18" height="13"/>
                        <a href="[n.local_user.send_email_path/]"><t>Send Email to <t.author.local_user.name/></t></a> (This will reveal your email address.)
                    </div>
                </then>
                <else>
                    <div style="margin-top:.5em">
                        You do not have email privileges.
                    </div>
                </else>
            </n.if.visitor.is_emailer>
        </then>
    </n.if.both>
</override_macro> 

The overriden code on mine is this, again (just in case anyone else's is different):
 <macro name="send_email_to_user_link" requires="user">
    <n.set_local_user.this_user />
    <!-- If this is not the profile of the visitor AND the user is authenticated -->
    <n.if.both condition1="[n.not.visitor.equals.local_user/]" condition2="[n.local_user.is_authenticated/]">
        <then>
            <div style="margin-top:.5em">
                <img src="/images/mail.png" align="absmiddle" width="18" height="13"/>
                <a href="[n.local_user.send_email_path/]"><t>Send Email to <t.author.local_user.name/></t></a>
            </div>
        </then>
    </n.if.both>
</macro> 
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
Now I just need to figure out how to make it so a banned user can email some groups, but not others. I mean, if they want the potential to become unbanned they might need the option to communicate with admins, moderators, or a special group (but not every single user).

This should be doable.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
It should be doable (with NAML) to make it so the email link for users in a certain group can't be seen, too (and/or can't be seen by certain groups). (But they would have to get an admin to add them to the group, of course).
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

GregChapman
I have to confess I had never tested what banned user could do but took the text on the Ban User screen at its word - "If you ban this user, he/she won't be able to do anything in [forum name]" and simply assumed that a banned user was unable to do anything a registered might be able to do. However, I did express it badly when I said "couldn't login" when what I meant had no greater access than a non-registered user once logged in, but I see that's not true.

Keep up the good work!

Just a Volunteer Nabble Helper - because the nice folk at Nabble have helped me!
GregHelp - Building a set of answers to Nabble FAQs.
Reply | Threaded
Open this post in threaded view
|

Re: Remove "Send Email" option with NAML

mark
Thanks!

That's understandable.

I was pretty surprised that they could email everyone, but I think I know why they can log in. The only thing they can't do, as far as I know, is post. But, we can use NAML to handle all this stuff, which is pretty nice.

I think they're allowed to log in so spambots won't immediately realize they're banned and start creating new accounts (although a lot of spambots just post only once or twice anyway). I could be wrong about that being the reason.