Code help

Support for PhpBB3.
Post here to get help with any phpBB3 related issue
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe your problem and what happened when the problem occured
3. Tell us what version of phpBB3 you are currently using.
If not your topic may be ignored or locked!

Code help

Post by Ather »

In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe your problem and what happened when the problem occured
3. Tell us what version of phpBB3 you are currently using.

includes/session.php

look for :

Code: Select all

$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
  
if you chagne this code to :

Code: Select all

$this->ip = '';  
ip logging is disabled, but for every one, inlcuding guests which is not i want :roll:

now, i have tried the following code, but its not affecting

Code: Select all

if ($user->data['group_id'] != 5)
{
   
   $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
}

else
{
  $this->ip = '';
}  
group 5 is the default for admins in phpbb, so if the user is not in group 5, log the ip, else not but doesn't work

i've also tried this :

Code: Select all

if (!$user->data['acp'])
{
   $this->ip = '';
}
else
{
   $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
}  
that doesent work either

and this too

Code: Select all

if ($user->data['username'] == "Anonymous" || $user->data['username']== "Guest")
{
   
   $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
}

else
{
  $this->ip = '';
}  
please debug my code and tell me whats wrong? :( i have been trying for 2 days now

Re: Code help

Post by Ather »

bump
please any 1 help me :( :(

Re: Code help

Post by stef775 »

It's

Code: Select all

$user->data['user_id'] == ANONYMOUS