Page 1 of 1

Code help

Posted: 17 May 2010, 13:35
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

Posted: 18 May 2010, 14:03
by Ather
bump
please any 1 help me :( :(

Re: Code help

Posted: 04 Aug 2010, 00:38
by stef775
It's

Code: Select all

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