-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathprivacyprotection.php
53 lines (44 loc) · 1.19 KB
/
privacyprotection.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
*
* @package phpBB Extension - tas2580 privacyprotection
* @copyright (c) 2018 tas2580 (https://tas2580.net)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace tas2580\privacyprotection;
/**
* Event listener
*/
class privacyprotection
{
public function anonymize_ip($time, $db)
{
$sql = 'UPDATE ' . POSTS_TABLE . "
SET poster_ip = '127.0.0.1'
WHERE post_time < " . (int) $time;
$db->sql_query($sql);
$sql = 'UPDATE ' . LOG_TABLE . "
SET log_ip = '127.0.0.1'
WHERE log_time < " . (int) $time;
$db->sql_query($sql);
$sql = 'UPDATE ' . POLL_VOTES_TABLE . "
SET vote_user_ip = '127.0.0.1'";
$db->sql_query($sql);
$sql = 'UPDATE ' . PRIVMSGS_TABLE . "
SET author_ip = '127.0.0.1'
WHERE message_time < " . (int) $time;
$db->sql_query($sql);
$sql = 'UPDATE ' . SESSIONS_TABLE . "
SET session_ip = '127.0.0.1'
WHERE session_time < " . (int) $time;
$db->sql_query($sql);
$sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "
SET last_ip = '127.0.0.1'";
$db->sql_query($sql);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_ip = '127.0.0.1'
WHERE user_regdate < " . (int) $time;
$db->sql_query($sql);
}
}