MyBB Community Forums

Full Version: Remove IP Logging completely?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey there, 

Can you please help me remove all IP logging within MyBB. From the actual users IP on-site, to it all being stored in the database. It's just me and my friends having a forum and we don't need any IP logs to be honest.


I know I can 'disable' in the admin panel but that's just for posts. I really want to remove it from users, posts, yes everything.

Another solution would just be to set '127.0.0.1' as IP for everyone. I saw a tutorial for this on 1.6 but I tried that and It didn't work.

What do you think? Is this possible?
Another way is to create a task, launched each 5 minutes, wich will replace all IP by an arbitrary one.

The following code was for 1.6, but can be easily converted for 1.8:
function task_cleanip($task)
{
 global $db, $lang, $cache;

 // Delay: 24h
 $cut = TIME_NOW-60*60;
 
 // Cleaning Admin logs
 $query = $db->update_query('adminlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 // Cleaning Admin sessions
 $query = $db->update_query('adminsessions', array('ip' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Mail logs
 $query = $db->update_query('maillogs', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Moderators logs
 $query = $db->update_query('moderatorlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Posts
 $query = $db->update_query('posts', array(
 'ipaddress' => '127.0.0.1',
 'longipaddress' => ip2long('127.0.0.1')
 ), 
 'dateline < '.$cut);
 
 // Cleaning Search logs
 $query = $db->update_query('searchlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning sessions
 $query = $db->update_query('sessions', array('ip' => '127.0.0.1'), 'time < '.$cut);
 
 // Cleaning all users IP
 $query = $db->update_query('users', array(
 'regip' => '127.0.0.1',
 'lastip' => '127.0.0.1',
 'longregip' => ip2long('127.0.0.1'),
 'longlastip' => ip2long('127.0.0.1')
 ), 
 '1=1');

 add_task_log($task, 'IP cleaneds');

}
(2016-10-26, 06:06 AM)Crazycat Wrote: [ -> ]Another way is to create a task, launched each 5 minutes, wich will replace all IP by an arbitrary one.

The following code was for 1.6, but can be easily converted for 1.8:
function task_cleanip($task)
{
 global $db, $lang, $cache;

 // Delay: 24h
 $cut = TIME_NOW-60*60;
 
 // Cleaning Admin logs
 $query = $db->update_query('adminlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 // Cleaning Admin sessions
 $query = $db->update_query('adminsessions', array('ip' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Mail logs
 $query = $db->update_query('maillogs', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Moderators logs
 $query = $db->update_query('moderatorlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Posts
 $query = $db->update_query('posts', array(
 'ipaddress' => '127.0.0.1',
 'longipaddress' => ip2long('127.0.0.1')
 ), 
 'dateline < '.$cut);
 
 // Cleaning Search logs
 $query = $db->update_query('searchlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning sessions
 $query = $db->update_query('sessions', array('ip' => '127.0.0.1'), 'time < '.$cut);
 
 // Cleaning all users IP
 $query = $db->update_query('users', array(
 'regip' => '127.0.0.1',
 'lastip' => '127.0.0.1',
 'longregip' => ip2long('127.0.0.1'),
 'longlastip' => ip2long('127.0.0.1')
 ), 
 '1=1');

 add_task_log($task, 'IP cleaneds');

}

What file needs to be edited?

Cheers!

(2016-10-25, 09:50 PM)Devilshakerz Wrote: [ -> ]Take a look at https://community.mybb.com/mods.php?action=view&pid=384

After installing & activating plugin it doesn't update all the existing stored IPs as it says it should.
Is there any way I could update all existing IP then to the 127.0.0.1?
Bump. Still needs help with this.
If the only issue of the plugin Devilshakerz posted are existing IPs. You can change them manually.

Just run this querys manually:
UPDATE adminlog SET ipaddress = '127.0.0.1';
UPDATE adminsessions SET ip = '127.0.0.1';
UPDATE maillogs SET ipaddress = '127.0.0.1';
UPDATE moderatorlog SET ipaddress => '127.0.0.1';
UPDATE posts SET ipaddress = '127.0.0.1', longipaddress = INET_ATON('127.0.0.1');
UPDATE searchlog SET ipaddress = '127.0.0.1';
UPDATE sessions SET ip = '127.0.0.1';
UPDATE users SET regip = '127.0.0.1', lastip = '127.0.0.1', longregip = INET_ATON('127.0.0.1'), longlastip = INET_ATON('127.0.0.1');
(2016-11-01, 01:25 PM)Neeeeeeeeeel.- Wrote: [ -> ]If the only issue of the plugin Devilshakerz posted are existing IPs. You can change them manually.

Just run this querys manually:
UPDATE adminlog SET ipaddress = '127.0.0.1';
UPDATE adminsessions SET ip = '127.0.0.1';
UPDATE maillogs SET ipaddress = '127.0.0.1';
UPDATE moderatorlog SET ipaddress => '127.0.0.1';
UPDATE posts SET ipaddress = '127.0.0.1', longipaddress = INET_ATON('127.0.0.1');
UPDATE searchlog SET ipaddress = '127.0.0.1';
UPDATE sessions SET ip = '127.0.0.1';
UPDATE users SET regip = '127.0.0.1', lastip = '127.0.0.1', longregip = INET_ATON('127.0.0.1'), longlastip = INET_ATON('127.0.0.1');

I got it to work but his plugin don't update maillogs, moderatorlog, posts, searchlog and all that. His plugin only fake ips on register. Is it possible to make a file that run this query every 30 seconds or that make this default? I think many people are looking for this.
I don't think many people are looking for this, but it can be done easily.

Create a file called cleanip.php, put the code from post #3, save it on /inc/tasks

Go to ACP => Manteinice => Tasks => Add task
Set a title, a description and choose the cleanip.php file from the list.

Save it, and that's it.
(2016-11-05, 02:40 PM)Neeeeeeeeeel.- Wrote: [ -> ]I don't think many people are looking for this, but it can be done easily.

Create a file called cleanip.php, put the code from post #3, save it on /inc/tasks

Go to ACP => Manteinice => Tasks => Add task
Set a title, a description and choose the cleanip.php file from the list.

Save it, and that's it.

Hey. I did that now. Here's the code I put into cleanip.php. 

<?php
function task_cleanip($task)
{
 global $db, $lang, $cache;

 // Delay: 24h
 $cut = TIME_NOW-60*60;
 
 // Cleaning Admin logs
 $query = $db->update_query('adminlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 // Cleaning Admin sessions
 $query = $db->update_query('adminsessions', array('ip' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Mail logs
 $query = $db->update_query('maillogs', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Moderators logs
 $query = $db->update_query('moderatorlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning Posts
 $query = $db->update_query('posts', array(
 'ipaddress' => '127.0.0.1',
 'longipaddress' => ip2long('127.0.0.1')
 ), 
 'dateline < '.$cut);
 
 // Cleaning Search logs
 $query = $db->update_query('searchlog', array('ipaddress' => '127.0.0.1'), 'dateline < '.$cut);
 
 // Cleaning sessions
 $query = $db->update_query('sessions', array('ip' => '127.0.0.1'), 'time < '.$cut);
 
 // Cleaning all users IP
 $query = $db->update_query('users', array(
 'regip' => '127.0.0.1',
 'lastip' => '127.0.0.1',
 'longregip' => ip2long('127.0.0.1'),
 'longlastip' => ip2long('127.0.0.1')
 ), 
 '1=1');

 add_task_log($task, 'IP cleaneds');

} 
?>


But I added a task with these settings: https://gyazo.com/3888dd7922ff4c7d2c039b1d2daec1f8

But it's not updating anything sadly. I put the file in the directory you told me so everything should be fine.
Go to: ACP > Mantainice > Tasks > Tasks history and check if "IP cleaneds" appers.

As you said yours its a very small and private forum, you may need to know that some page of the forum must be hit in order to run the task. If no one loads any page, the task won't run. So be sure to refresh your forum index while testing.
Pages: 1 2