where it stores IP adresses of the post?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
gr33n
Registered User
Posts: 20
Joined: Mon Aug 23, 2004 11:13 pm

where it stores IP adresses of the post?

Post by gr33n » Sun Jan 23, 2005 11:52 pm

where it stores IP adresses of the post?

User avatar
zeroK
Former Team Member
Posts: 20964
Joined: Sun Jan 20, 2002 7:36 pm
Location: Klagenfurt / Austria
Contact:

Post by zeroK » Mon Jan 24, 2005 12:07 am

In the phpbb_posts table (poster_ip field).
Image My weblog | gamerslog.com | No support via PM or ICQ or email - If you don't know a term or a program mentioned in a post -> Google is your friend

gr33n
Registered User
Posts: 20
Joined: Mon Aug 23, 2004 11:13 pm

Post by gr33n » Mon Jan 24, 2005 12:23 am

jep.. their encrypted there... i was wondering if they are in plain text there.

ok.. but how can i turn my bb 2.0.10 to show IPs to only administrators.. not to moderators?

User avatar
zeroK
Former Team Member
Posts: 20964
Joined: Sun Jan 20, 2002 7:36 pm
Location: Klagenfurt / Austria
Contact:

Post by zeroK » Mon Jan 24, 2005 9:06 am

gr33n wrote: jep.. their encrypted there... i was wondering if they are in plain text there.
You could simply use the encode_ip and decode_ip functions in the include/functions.php :-)
ok.. but how can i turn my bb 2.0.10 to show IPs to only administrators.. not to moderators?

I think you'll have to change this section in the viewtopic.php to achieve this (line 1006-1032):

Code: Select all

	if ( $is_auth['auth_mod'] )
	{
		$temp_url = "modcp.$phpEx?mode=ip&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&" . POST_TOPIC_URL . "=" . $topic_id . "&sid=" . $userdata['session_id'];
		$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>';
		$ip = '<a href="' . $temp_url . '">' . $lang['View_IP'] . '</a>';

		$temp_url = "posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
		$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
		$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
	}
	else
	{
		$ip_img = '';
		$ip = '';

		if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $forum_topic_data['topic_last_post_id'] == $postrow[$i]['post_id'] )
		{
			$temp_url = "posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
			$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
			$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
		}
		else
		{
			$delpost_img = '';
			$delpost = '';
		}
	}
I think this should hide the link for moderators:

Code: Select all

	if ($userdata['user_level'] == ADMIN)
	{
		$temp_url = "modcp.$phpEx?mode=ip&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&" . POST_TOPIC_URL . "=" . $topic_id . "&sid=" . $userdata['session_id'];
		$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>';
		$ip = '<a href="' . $temp_url . '">' . $lang['View_IP'] . '</a>';
	}
	else 
	{
		$ip_img = '';
		$ip = '';
	}
	if ( $is_auth['auth_mod'] )
	{
		$temp_url = "posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
		$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
		$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
	}
	else
	{

		if ( $userdata['user_id'] == $poster_id && $is_auth['auth_delete'] && $forum_topic_data['topic_last_post_id'] == $postrow[$i]['post_id'] )
		{
			$temp_url = "posting.$phpEx?mode=delete&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&sid=" . $userdata['session_id'];
			$delpost_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_delpost'] . '" alt="' . $lang['Delete_post'] . '" title="' . $lang['Delete_post'] . '" border="0" /></a>';
			$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>';
		}
		else
		{
			$delpost_img = '';
			$delpost = '';
		}
	}
Then you'll have to restrict the access to the modcp a little bit. Open the modcp.php and search for following section:

Code: Select all

//
// Start auth check
//
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);

if ( !$is_auth['auth_mod'] )
{
	message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
}
//
// End Auth Check
//
We only want admins to be able to use the ip-mode. So replacing this section with something like this should do the job:

Code: Select all

//
// Start auth check
//
$is_auth = auth(AUTH_ALL, $forum_id, $userdata);

if ( !$is_auth['auth_mod'] || ($mode=='ip' && $userdata['user_level'] != ADMIN) )
{
	message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']);
}
//
// End Auth Check
//
Please make backups of your files before doing this. I have not tried these changes!
Image My weblog | gamerslog.com | No support via PM or ICQ or email - If you don't know a term or a program mentioned in a post -> Google is your friend

gr33n
Registered User
Posts: 20
Joined: Mon Aug 23, 2004 11:13 pm

Post by gr33n » Sat Mar 05, 2005 6:52 pm

thank you!

Locked

Return to “2.0.x Support Forum”