Code help

Support for PhpBB3. Post here to get help with any phpBB3 related issue here
There is no support here! Only Read Access!
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.
Else your topic may be ignored or locked!
Locked
Ather
BBCoder II
BBCoder II
Posts: 14
Joined: 09 Apr 2010, 18:27

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
Ather
BBCoder II
BBCoder II
Posts: 14
Joined: 09 Apr 2010, 18:27

Re: Code help

Post by Ather »

bump
please any 1 help me :( :(
stef775
BBCoder I
BBCoder I
Posts: 2
Joined: 07 Mar 2010, 22:13

Re: Code help

Post by stef775 »

It's

Code: Select all

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