Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2013-01-04 04:35:44

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Hide users IP from Moderators?

I would like to hide users IP addresses from Moderators, can someone advise of a simple plugin or code modification to do this?

Thanks.

Offline

#2 2013-01-07 17:24:20

adaur
Developer
From: France
Registered: 2010-01-07
Posts: 728
Website

Re: Hide users IP from Moderators?

Hi Squiggles,

What do you mean by "hide"? Would you like them not to be logged anymore?

If so, replace the get_remote_address function within include/functions.php by:

//
// Try to determine the correct remote IP-address
//
function get_remote_address()
{
        global $pun_user;

	$remote_addr = $_SERVER['REMOTE_ADDR'];

	// If we are behind a reverse proxy try to find the real users IP
	if (defined('FORUM_BEHIND_REVERSE_PROXY'))
	{
		if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
		{
			// The general format of the field is:
			// X-Forwarded-For: client1, proxy1, proxy2
			// where the value is a comma+space separated list of IP addresses, the left-most being the farthest downstream client,
			// and each successive proxy that passed the request adding the IP address where it received the request from.
			$forwarded_for = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
			$forwarded_for = trim($forwarded_for[0]);

			if (@preg_match('%^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$%', $forwarded_for) || @preg_match('%^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$%', $forwarded_for))
				$remote_addr = $forwarded_for;
		}
	}
	
	if ($pun_user['g_moderator'])
		$remote_addr = '127.0.0.1';

	return $remote_addr;
}

Last edited by adaur (2013-01-28 20:53:51)


Please excuse my bad english, I'm french tongue.

Offline

#3 2013-01-07 21:36:54

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: Hide users IP from Moderators?

Thanks for replying.

I still want IP addresses to be logged, I just don't want moderators to be able to view that kind of information. Only the Administrator.

Its no big deal I just thought it might be something simple to implement.

Offline

#4 2013-01-27 13:10:09

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: Hide users IP from Moderators?

Does anyone know of a way to do this? I dont really want my mods to have access to this sort of information.

It would be helpful to hide user email addresses from mods too.

Cheers.

Offline

#5 2013-01-28 20:56:18

adaur
Developer
From: France
Registered: 2010-01-07
Posts: 728
Website

Re: Hide users IP from Moderators?

It is actually simple, but very long to do... Everytime you see an IP displayed, you have to change the code this way:

(viewtopic.php)

if ($pun_user['is_admmod'])
		{
			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.pun_htmlspecialchars($cur_post['poster_ip']).'">'.$lang_topic['IP address logged'].'</a></span></dd>';

to

if ($pun_user['g_id'] == PUN_ADMIN)
		{
			$user_info[] = '<dd><span><a href="moderate.php?get_host='.$cur_post['id'].'" title="'.pun_htmlspecialchars($cur_post['poster_ip']).'">'.$lang_topic['IP address logged'].'</a></span></dd>';

Please excuse my bad english, I'm french tongue.

Offline

#6 2013-01-29 00:15:19

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: Hide users IP from Moderators?

Thanks I was able to hide user IP in posts and profiles but Moderators can still view them in the Moderator Menu.

Why do Moderators need to have so many privileges??? I just want them to be able to remove posts and topics when needed, that's it. They don't need to see users email addresses, IP address or Admin notes, it’s silly the way Fluxbb handles this.

Offline

#7 2013-01-29 00:20:05

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 5,946
Website

Re: Hide users IP from Moderators?

Permissions will be more flexible in v2.0, if that makes you a little happier. smile


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#8 2013-01-29 00:35:01

Squiggles
Member
Registered: 2012-12-14
Posts: 278

Re: Hide users IP from Moderators?

Sound great, but it doesn't help me know though hmm

Can you suggest a method to hide the Index and Users option from the Moderator Menu (hide from from Moderators Only)?

I don’t think my mods need to see server statistics or be able to check for upgrades etc.

Thanks.

Offline

#9 2013-12-29 08:12:52

Tomiriss
New member
Registered: 2013-12-29
Posts: 2

Re: Hide users IP from Moderators?

Look in the Google list of proxy servers or programs have type Proxy Switcher

Offline

#10 2013-12-29 08:24:07

Tomiriss
New member
Registered: 2013-12-29
Posts: 2

Re: Hide users IP from Moderators?

Squiggles wrote:

I would like to hide users IP addresses from Moderators, can someone advise of a simple plugin or code modification to do this?

Thanks.

I'm already a month use this service VPN faceless.me  , very cool.

Offline

#11 2014-01-06 16:54:42

Starcom
Member
Registered: 2009-01-07
Posts: 7

Re: Hide users IP from Moderators?

@Tomiriss: WTF !! He don't want to be anonymized but he want the Ip adress wasn't displayed for moderator's group. I don't understand why a proxy server will be usefull in this case ?

I would be interrested by a mod to do this too because I think we need waiting few years before FluxBB 2.0 will be released.


Sorry for my english... I'm french.

Offline

Board footer

Powered by FluxBB 1.5.7