|
@@ -12,74 +12,76 @@ user.
|
12
|
12
|
|
13
|
13
|
$UserID = $_GET['userid'];
|
14
|
14
|
if (!is_number($UserID)) {
|
15
|
|
- error(404);
|
|
15
|
+ error(404);
|
16
|
16
|
}
|
17
|
17
|
|
18
|
18
|
$DB->query("
|
19
|
|
- SELECT
|
20
|
|
- ui.JoinDate,
|
21
|
|
- p.Level AS Class
|
22
|
|
- FROM users_main AS um
|
23
|
|
- JOIN users_info AS ui ON um.ID = ui.UserID
|
24
|
|
- JOIN permissions AS p ON p.ID = um.PermissionID
|
25
|
|
- WHERE um.ID = $UserID");
|
|
19
|
+ SELECT
|
|
20
|
+ ui.JoinDate,
|
|
21
|
+ p.Level AS Class
|
|
22
|
+ FROM users_main AS um
|
|
23
|
+ JOIN users_info AS ui ON um.ID = ui.UserID
|
|
24
|
+ JOIN permissions AS p ON p.ID = um.PermissionID
|
|
25
|
+ WHERE um.ID = $UserID");
|
26
|
26
|
list($Joined, $Class) = $DB->next_record();
|
27
|
27
|
|
28
|
28
|
if (!check_perms('users_view_email', $Class)) {
|
29
|
|
- error(403);
|
|
29
|
+ error(403);
|
30
|
30
|
}
|
31
|
31
|
|
32
|
|
-$UsersOnly = $_GET['usersonly'];
|
|
32
|
+// TODO: Is this even used?
|
|
33
|
+$UsersOnly = $_GET['usersonly'] ?? false;
|
33
|
34
|
|
34
|
35
|
$DB->query("
|
35
|
|
- SELECT Username
|
36
|
|
- FROM users_main
|
37
|
|
- WHERE ID = $UserID");
|
|
36
|
+ SELECT Username
|
|
37
|
+ FROM users_main
|
|
38
|
+ WHERE ID = $UserID");
|
38
|
39
|
list($Username) = $DB->next_record();
|
39
|
40
|
View::show_header("Email history for $Username");
|
40
|
41
|
|
41
|
42
|
// Get current email (and matches)
|
42
|
43
|
$DB->query("
|
43
|
|
- SELECT
|
44
|
|
- m.Email,
|
45
|
|
- '".sqltime()."' AS Time,
|
46
|
|
- m.IP,
|
47
|
|
- GROUP_CONCAT(h.UserID SEPARATOR '|') AS UserIDs,
|
48
|
|
- GROUP_CONCAT(h.Time SEPARATOR '|') AS UserSetTimes,
|
49
|
|
- GROUP_CONCAT(h.IP SEPARATOR '|') AS UserIPs,
|
50
|
|
- GROUP_CONCAT(m2.Username SEPARATOR '|') AS Usernames,
|
51
|
|
- GROUP_CONCAT(m2.Enabled SEPARATOR '|') AS UsersEnabled,
|
52
|
|
- GROUP_CONCAT(i.Donor SEPARATOR '|') AS UsersDonor,
|
53
|
|
- GROUP_CONCAT(i.Warned SEPARATOR '|') AS UsersWarned
|
54
|
|
- FROM users_main AS m
|
55
|
|
- LEFT JOIN users_history_emails AS h ON h.Email = m.Email
|
56
|
|
- AND h.UserID != m.ID
|
57
|
|
- LEFT JOIN users_main AS m2 ON m2.ID = h.UserID
|
58
|
|
- LEFT JOIN users_info AS i ON i.UserID = h.UserID
|
59
|
|
- WHERE m.ID = '$UserID'"
|
|
44
|
+ SELECT
|
|
45
|
+ m.Email,
|
|
46
|
+ '".sqltime()."' AS Time,
|
|
47
|
+ m.IP,
|
|
48
|
+ GROUP_CONCAT(h.UserID SEPARATOR '|') AS UserIDs,
|
|
49
|
+ GROUP_CONCAT(h.Time SEPARATOR '|') AS UserSetTimes,
|
|
50
|
+ GROUP_CONCAT(h.IP SEPARATOR '|') AS UserIPs,
|
|
51
|
+ GROUP_CONCAT(m2.Username SEPARATOR '|') AS Usernames,
|
|
52
|
+ GROUP_CONCAT(m2.Enabled SEPARATOR '|') AS UsersEnabled,
|
|
53
|
+ GROUP_CONCAT(i.Donor SEPARATOR '|') AS UsersDonor,
|
|
54
|
+ GROUP_CONCAT(i.Warned SEPARATOR '|') AS UsersWarned
|
|
55
|
+ FROM users_main AS m
|
|
56
|
+ LEFT JOIN users_history_emails AS h ON h.Email = m.Email
|
|
57
|
+ AND h.UserID != m.ID
|
|
58
|
+ LEFT JOIN users_main AS m2 ON m2.ID = h.UserID
|
|
59
|
+ LEFT JOIN users_info AS i ON i.UserID = h.UserID
|
|
60
|
+ WHERE m.ID = '$UserID'"
|
60
|
61
|
);
|
61
|
|
-$CurrentEmail = array_shift($DB->to_array());
|
|
62
|
+//$CurrentEmail = array_shift($DB->to_array());
|
|
63
|
+$CurrentEmail = ($DB->to_array())[0]; // Only variables should be passed by reference
|
62
|
64
|
|
63
|
65
|
// Get historic emails (and matches)
|
64
|
66
|
$DB->query("
|
65
|
|
- SELECT
|
66
|
|
- h2.Email,
|
67
|
|
- h2.Time,
|
68
|
|
- h2.IP,
|
69
|
|
- h3.UserID AS UserIDs,
|
70
|
|
- h3.Time AS UserSetTimes,
|
71
|
|
- h3.IP AS UserIPs,
|
72
|
|
- m3.Username AS Usernames,
|
73
|
|
- m3.Enabled AS UsersEnabled,
|
74
|
|
- i2.Donor AS UsersDonor,
|
75
|
|
- i2.Warned AS UsersWarned
|
76
|
|
- FROM users_history_emails AS h2
|
77
|
|
- LEFT JOIN users_history_emails AS h3 ON h3.Email = h2.Email
|
78
|
|
- AND h3.UserID != h2.UserID
|
79
|
|
- LEFT JOIN users_main AS m3 ON m3.ID = h3.UserID
|
80
|
|
- LEFT JOIN users_info AS i2 ON i2.UserID = h3.UserID
|
81
|
|
- WHERE h2.UserID = '$UserID'
|
82
|
|
- ORDER BY Time DESC"
|
|
67
|
+ SELECT
|
|
68
|
+ h2.Email,
|
|
69
|
+ h2.Time,
|
|
70
|
+ h2.IP,
|
|
71
|
+ h3.UserID AS UserIDs,
|
|
72
|
+ h3.Time AS UserSetTimes,
|
|
73
|
+ h3.IP AS UserIPs,
|
|
74
|
+ m3.Username AS Usernames,
|
|
75
|
+ m3.Enabled AS UsersEnabled,
|
|
76
|
+ i2.Donor AS UsersDonor,
|
|
77
|
+ i2.Warned AS UsersWarned
|
|
78
|
+ FROM users_history_emails AS h2
|
|
79
|
+ LEFT JOIN users_history_emails AS h3 ON h3.Email = h2.Email
|
|
80
|
+ AND h3.UserID != h2.UserID
|
|
81
|
+ LEFT JOIN users_main AS m3 ON m3.ID = h3.UserID
|
|
82
|
+ LEFT JOIN users_info AS i2 ON i2.UserID = h3.UserID
|
|
83
|
+ WHERE h2.UserID = '$UserID'
|
|
84
|
+ ORDER BY Time DESC"
|
83
|
85
|
);
|
84
|
86
|
$History = $DB->to_array();
|
85
|
87
|
|
|
@@ -91,292 +93,286 @@ $Current['IP'] = $History[(count($History) - 1)]['IP'];
|
91
|
93
|
|
92
|
94
|
// Matches for current email
|
93
|
95
|
if ($CurrentEmail['Usernames'] != '') {
|
94
|
|
- $UserIDs = explode('|', $CurrentEmail['UserIDs']);
|
95
|
|
- $Usernames = explode('|', $CurrentEmail['Usernames']);
|
96
|
|
- $UsersEnabled = explode('|', $CurrentEmail['UsersEnabled']);
|
97
|
|
- $UsersDonor = explode('|', $CurrentEmail['UsersDonor']);
|
98
|
|
- $UsersWarned = explode('|', $CurrentEmail['UsersWarned']);
|
99
|
|
- $UserSetTimes = explode('|', $CurrentEmail['UserSetTimes']);
|
100
|
|
- $UserIPs = explode('|', $CurrentEmail['UserIPs']);
|
|
96
|
+ $UserIDs = explode('|', $CurrentEmail['UserIDs']);
|
|
97
|
+ $Usernames = explode('|', $CurrentEmail['Usernames']);
|
|
98
|
+ $UsersEnabled = explode('|', $CurrentEmail['UsersEnabled']);
|
|
99
|
+ $UsersDonor = explode('|', $CurrentEmail['UsersDonor']);
|
|
100
|
+ $UsersWarned = explode('|', $CurrentEmail['UsersWarned']);
|
|
101
|
+ $UserSetTimes = explode('|', $CurrentEmail['UserSetTimes']);
|
|
102
|
+ $UserIPs = explode('|', $CurrentEmail['UserIPs']);
|
101
|
103
|
|
102
|
|
- foreach ($UserIDs as $Key => $Val) {
|
103
|
|
- $CurrentMatches[$Key]['Username'] = ' » '.Users::format_username($Val, true, true, true);
|
104
|
|
- $CurrentMatches[$Key]['IP'] = $UserIPs[$Key];
|
105
|
|
- $CurrentMatches[$Key]['EndTime'] = $UserSetTimes[$Key];
|
106
|
|
- }
|
|
104
|
+ foreach ($UserIDs as $Key => $Val) {
|
|
105
|
+ $CurrentMatches[$Key]['Username'] = ' » '.Users::format_username($Val, true, true, true);
|
|
106
|
+ $CurrentMatches[$Key]['IP'] = $UserIPs[$Key];
|
|
107
|
+ $CurrentMatches[$Key]['EndTime'] = $UserSetTimes[$Key];
|
|
108
|
+ }
|
107
|
109
|
}
|
108
|
110
|
|
109
|
111
|
// Email history records
|
110
|
112
|
if (count($History) === 1) {
|
111
|
|
- $Invite['Email'] = $History[0]['Email'];
|
112
|
|
- $Invite['EndTime'] = $Joined;
|
113
|
|
- $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
|
114
|
|
- $Invite['IP'] = $History[0]['IP'];
|
115
|
|
- if ($Current['StartTime'] == '0000-00-00 00:00:00') {
|
116
|
|
- $Current['StartTime'] = $Joined;
|
117
|
|
- }
|
|
113
|
+ $Invite['Email'] = $History[0]['Email'];
|
|
114
|
+ $Invite['EndTime'] = $Joined;
|
|
115
|
+ $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
|
|
116
|
+ $Invite['IP'] = $History[0]['IP'];
|
|
117
|
+ if ($Current['StartTime'] == '0000-00-00 00:00:00') {
|
|
118
|
+ $Current['StartTime'] = $Joined;
|
|
119
|
+ }
|
118
|
120
|
} else {
|
119
|
|
- foreach ($History as $Key => $Val) {
|
120
|
|
- if ($History[$Key + 1]['Time'] == '0000-00-00 00:00:00' && $Val['Time'] != '0000-00-00 00:00:00') {
|
121
|
|
- // Invited email
|
122
|
|
- $Invite['Email'] = $Val['Email'];
|
123
|
|
- $Invite['EndTime'] = $Joined;
|
124
|
|
- $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
|
125
|
|
- $Invite['IP'] = $Val['IP'];
|
|
121
|
+ foreach ($History as $Key => $Val) {
|
|
122
|
+ if (isset($History[$Key + 1]) && $History[$Key + 1]['Time'] == '0000-00-00 00:00:00' && $Val['Time'] != '0000-00-00 00:00:00') {
|
|
123
|
+ // Invited email
|
|
124
|
+ $Invite['Email'] = $Val['Email'];
|
|
125
|
+ $Invite['EndTime'] = $Joined;
|
|
126
|
+ $Invite['AccountAge'] = date(time() + time() - strtotime($Joined)); // Same as EndTime but without ' ago'
|
|
127
|
+ $Invite['IP'] = $Val['IP'];
|
126
|
128
|
|
127
|
|
- } elseif ($History[$Key - 1]['Email'] != $Val['Email'] && $Val['Time'] != '0000-00-00 00:00:00') {
|
128
|
|
- // Old email
|
129
|
|
- $i = 1;
|
130
|
|
- while ($Val['Email'] == $History[$Key + $i]['Email']) {
|
131
|
|
- $i++;
|
132
|
|
- }
|
133
|
|
- $Old[$Key]['StartTime'] = (isset($History[$Key + $i]) && $History[$Key + $i]['Time'] != '0000-00-00 00:00:00') ? $History[$Key + $i]['Time'] : $Joined;
|
134
|
|
- $Old[$Key]['EndTime'] = $Val['Time'];
|
135
|
|
- $Old[$Key]['IP'] = $Val['IP'];
|
136
|
|
- $Old[$Key]['ElapsedTime'] = date(time() + strtotime($Old[$Key]['EndTime']) - strtotime($Old[$Key]['StartTime']));
|
137
|
|
- $Old[$Key]['Email'] = $Val['Email'];
|
|
129
|
+ } elseif (isset($History[$Key - 1]) && $History[$Key - 1]['Email'] != $Val['Email'] && $Val['Time'] != '0000-00-00 00:00:00') {
|
|
130
|
+ // Old email
|
|
131
|
+ $i = 1;
|
|
132
|
+ while ($Val['Email'] == $History[$Key + $i]['Email']) {
|
|
133
|
+ $i++;
|
|
134
|
+ }
|
|
135
|
+ $Old[$Key]['StartTime'] = (isset($History[$Key + $i]) && $History[$Key + $i]['Time'] != '0000-00-00 00:00:00') ? $History[$Key + $i]['Time'] : $Joined;
|
|
136
|
+ $Old[$Key]['EndTime'] = $Val['Time'];
|
|
137
|
+ $Old[$Key]['IP'] = $Val['IP'];
|
|
138
|
+ $Old[$Key]['ElapsedTime'] = date(time() + strtotime($Old[$Key]['EndTime']) - strtotime($Old[$Key]['StartTime']));
|
|
139
|
+ $Old[$Key]['Email'] = $Val['Email'];
|
|
140
|
+ }
|
138
|
141
|
|
139
|
|
- } else {
|
140
|
|
- // Shouldn't have to be here but I'll leave it anyway
|
141
|
|
- $Other[$Key]['StartTime'] = (isset($History[$Key + $i])) ? $History[$Key + $i]['Time'] : $Joined;
|
142
|
|
- $Other[$Key]['EndTime'] = $Val['Time'];
|
143
|
|
- $Other[$Key]['IP'] = $Val['IP'];
|
144
|
|
- $Other[$Key]['ElapsedTime'] = date(time() + strtotime($Other[$Key]['EndTime']) - strtotime($Other[$Key]['StartTime']));
|
145
|
|
- $Other[$Key]['Email'] = $Val['Email'];
|
146
|
|
- }
|
147
|
|
-
|
148
|
|
- if ($Val['Usernames'] != '') {
|
149
|
|
- // Match with old email
|
150
|
|
- $OldMatches[$Key]['Email'] = $Val['Email'];
|
151
|
|
- $OldMatches[$Key]['Username'] = ' » '.Users::format_username($Val['UserIDs'], true, true, true);
|
152
|
|
- $OldMatches[$Key]['EndTime'] = $Val['UserSetTimes'];
|
153
|
|
- $OldMatches[$Key]['IP'] = $Val['UserIPs'];
|
154
|
|
- }
|
155
|
|
- }
|
|
142
|
+ if ($Val['Usernames'] != '') {
|
|
143
|
+ // Match with old email
|
|
144
|
+ $OldMatches[$Key]['Email'] = $Val['Email'];
|
|
145
|
+ $OldMatches[$Key]['Username'] = ' » '.Users::format_username($Val['UserIDs'], true, true, true);
|
|
146
|
+ $OldMatches[$Key]['EndTime'] = $Val['UserSetTimes'];
|
|
147
|
+ $OldMatches[$Key]['IP'] = $Val['UserIPs'];
|
|
148
|
+ }
|
|
149
|
+ }
|
156
|
150
|
}
|
157
|
151
|
|
158
|
152
|
// Clean up arrays
|
159
|
|
-if ($Old) {
|
160
|
|
- $Old = array_reverse(array_reverse($Old));
|
161
|
|
- $LastOld = count($Old) - 1;
|
162
|
|
- if ($Old[$LastOld]['StartTime'] != $Invite['EndTime']) {
|
163
|
|
- // Make sure the timeline is intact (invite email was used as email for the account in the beginning)
|
164
|
|
- $Old[$LastOld + 1]['Email'] = $Invite['Email'];
|
165
|
|
- $Old[$LastOld + 1]['StartTime'] = $Invite['EndTime'];
|
166
|
|
- $Old[$LastOld + 1]['EndTime'] = $Old[$LastOld]['StartTime'];
|
167
|
|
- $Old[$LastOld + 1]['ElapsedTime'] = date(time() + strtotime($Old[$LastOld + 1]['EndTime'] ) - strtotime($Old[$LastOld + 1]['StartTime']));
|
168
|
|
- $Old[$LastOld + 1]['IP'] = $Invite['IP'];
|
169
|
|
- }
|
|
153
|
+if ($Old ?? false) {
|
|
154
|
+ $Old = array_reverse(array_reverse($Old));
|
|
155
|
+ $LastOld = count($Old) - 1;
|
|
156
|
+ if ($Old[$LastOld]['StartTime'] != $Invite['EndTime']) {
|
|
157
|
+ // Make sure the timeline is intact (invite email was used as email for the account in the beginning)
|
|
158
|
+ $Old[$LastOld + 1]['Email'] = $Invite['Email'];
|
|
159
|
+ $Old[$LastOld + 1]['StartTime'] = $Invite['EndTime'];
|
|
160
|
+ $Old[$LastOld + 1]['EndTime'] = $Old[$LastOld]['StartTime'];
|
|
161
|
+ $Old[$LastOld + 1]['ElapsedTime'] = date(time() + strtotime($Old[$LastOld + 1]['EndTime'] ) - strtotime($Old[$LastOld + 1]['StartTime']));
|
|
162
|
+ $Old[$LastOld + 1]['IP'] = $Invite['IP'];
|
|
163
|
+ }
|
170
|
164
|
}
|
171
|
165
|
|
172
|
166
|
// Start page with current email
|
173
|
167
|
?>
|
174
|
168
|
<div class="thin">
|
175
|
|
- <div class="header">
|
176
|
|
- <h2>Email history for <a href="user.php?id=<?=$UserID ?>"><?=$Username ?></a></h2>
|
177
|
|
- <div class="linkbox center">
|
178
|
|
- <a href="userhistory.php?action=email&userid=<?=$UserID?>" class="brackets">Old email history</a>
|
179
|
|
- </div>
|
180
|
|
- </div>
|
181
|
|
- <br />
|
182
|
|
- <table width="100%">
|
183
|
|
- <tr class="colhead">
|
184
|
|
- <td>Current email</td>
|
185
|
|
- <td>Start</td>
|
186
|
|
- <td>End</td>
|
187
|
|
- <td>Current IP <a href="userhistory.php?action=ips&userid=<?=$UserID ?>" class="brackets">H</a></td>
|
188
|
|
- <td>Set from IP</td>
|
189
|
|
- </tr>
|
|
169
|
+ <div class="header">
|
|
170
|
+ <h2>Email history for <a href="user.php?id=<?=$UserID ?>"><?=$Username ?></a></h2>
|
|
171
|
+ <div class="linkbox center">
|
|
172
|
+ <a href="userhistory.php?action=email&userid=<?=$UserID?>" class="brackets">Old email history</a>
|
|
173
|
+ </div>
|
|
174
|
+ </div>
|
|
175
|
+ <br />
|
|
176
|
+ <table width="100%">
|
|
177
|
+ <tr class="colhead">
|
|
178
|
+ <td>Current email</td>
|
|
179
|
+ <td>Start</td>
|
|
180
|
+ <td>End</td>
|
|
181
|
+ <td>Current IP <a href="userhistory.php?action=ips&userid=<?=$UserID ?>" class="brackets">H</a></td>
|
|
182
|
+ <td>Set from IP</td>
|
|
183
|
+ </tr>
|
190
|
184
|
<?
|
191
|
185
|
$Current['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['Email']) : '[Encrypted]';
|
192
|
186
|
$Current['CurrentIP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['CurrentIP']) : '[Encrypted]';
|
193
|
187
|
$Current['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Current['IP']) : '[Encrypted]';
|
194
|
188
|
?>
|
195
|
|
- <tr class="row">
|
196
|
|
- <td><?=display_str($Current['Email'])?></td>
|
197
|
|
- <td><?=time_diff($Current['StartTime'])?></td>
|
198
|
|
- <td></td>
|
199
|
|
- <td>
|
200
|
|
- <?=display_str($Current['CurrentIP'])?>
|
201
|
|
- (<?=Tools::get_country_code_by_ajax($Current['CurrentIP'])?>)
|
202
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['CurrentIP'])?>" class="brackets tooltip" title="Search">S</a>
|
203
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Current['CurrentIP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
204
|
|
- <br />
|
205
|
|
- <?=Tools::get_host_by_ajax($Current['CurrentIP'])?>
|
206
|
|
- </td>
|
207
|
|
- <td>
|
208
|
|
- <?=display_str($Current['IP'])?>
|
209
|
|
- (<?=Tools::get_country_code_by_ajax($Current['IP'])?>)
|
210
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
211
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Current['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
212
|
|
- <br />
|
213
|
|
- <?=Tools::get_host_by_ajax($Current['IP'])?>
|
214
|
|
- </td>
|
215
|
|
- </tr>
|
|
189
|
+ <tr class="row">
|
|
190
|
+ <td><?=display_str($Current['Email'])?></td>
|
|
191
|
+ <td><?=time_diff($Current['StartTime'])?></td>
|
|
192
|
+ <td></td>
|
|
193
|
+ <td>
|
|
194
|
+ <?=display_str($Current['CurrentIP'])?>
|
|
195
|
+ (<?=Tools::get_country_code_by_ajax($Current['CurrentIP'])?>)
|
|
196
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['CurrentIP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
197
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Current['CurrentIP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
198
|
+ <br />
|
|
199
|
+ <?=Tools::get_host_by_ajax($Current['CurrentIP'])?>
|
|
200
|
+ </td>
|
|
201
|
+ <td>
|
|
202
|
+ <?=display_str($Current['IP'])?>
|
|
203
|
+ (<?=Tools::get_country_code_by_ajax($Current['IP'])?>)
|
|
204
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Current['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
205
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Current['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
206
|
+ <br />
|
|
207
|
+ <?=Tools::get_host_by_ajax($Current['IP'])?>
|
|
208
|
+ </td>
|
|
209
|
+ </tr>
|
216
|
210
|
<?
|
217
|
|
-if ($CurrentMatches) {
|
218
|
|
- // Match on the current email
|
219
|
|
- foreach ($CurrentMatches as $Match) {
|
|
211
|
+if ($CurrentMatches ?? false) {
|
|
212
|
+ // Match on the current email
|
|
213
|
+ foreach ($CurrentMatches as $Match) {
|
220
|
214
|
$Match['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
|
221
|
215
|
?>
|
222
|
|
- <tr class="row">
|
223
|
|
- <td><?=$Match['Username']?></td>
|
224
|
|
- <td></td>
|
225
|
|
- <td><?=time_diff($Match['EndTime'])?></td>
|
226
|
|
- <td></td>
|
227
|
|
- <td>
|
228
|
|
- <?=display_str($Match['IP'])?>
|
229
|
|
- (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
230
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
231
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
232
|
|
- <br />
|
233
|
|
- <?=Tools::get_host_by_ajax($Match['IP'])?>
|
234
|
|
- </td>
|
235
|
|
- </tr>
|
|
216
|
+ <tr class="row">
|
|
217
|
+ <td><?=$Match['Username']?></td>
|
|
218
|
+ <td></td>
|
|
219
|
+ <td><?=time_diff($Match['EndTime'])?></td>
|
|
220
|
+ <td></td>
|
|
221
|
+ <td>
|
|
222
|
+ <?=display_str($Match['IP'])?>
|
|
223
|
+ (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
|
224
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
225
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
226
|
+ <br />
|
|
227
|
+ <?=Tools::get_host_by_ajax($Match['IP'])?>
|
|
228
|
+ </td>
|
|
229
|
+ </tr>
|
236
|
230
|
<?
|
237
|
|
- }
|
|
231
|
+ }
|
238
|
232
|
}
|
239
|
233
|
// Old emails
|
240
|
|
-if ($Old) {
|
|
234
|
+if ($Old ?? false) {
|
241
|
235
|
?>
|
242
|
|
- <tr class="colhead">
|
243
|
|
- <td>Old emails</td>
|
244
|
|
- <td>Start</td>
|
245
|
|
- <td>End</td>
|
246
|
|
- <td>Elapsed</td>
|
247
|
|
- <td>Set from IP</td>
|
248
|
|
- </tr>
|
|
236
|
+ <tr class="colhead">
|
|
237
|
+ <td>Old emails</td>
|
|
238
|
+ <td>Start</td>
|
|
239
|
+ <td>End</td>
|
|
240
|
+ <td>Elapsed</td>
|
|
241
|
+ <td>Set from IP</td>
|
|
242
|
+ </tr>
|
249
|
243
|
<?
|
250
|
|
- $j = 0;
|
251
|
|
- // Old email
|
252
|
|
- foreach ($Old as $Record) {
|
253
|
|
- ++$j;
|
|
244
|
+ $j = 0;
|
|
245
|
+ // Old email
|
|
246
|
+ foreach ($Old as $Record) {
|
|
247
|
+ ++$j;
|
254
|
248
|
|
255
|
|
- // Matches on old email
|
256
|
|
- ob_start();
|
257
|
|
- $i = 0;
|
258
|
|
- foreach ($OldMatches as $Match) {
|
259
|
|
- if ($Match['Email'] == $Record['Email']) {
|
260
|
|
- ++$i;
|
261
|
|
- // Email matches
|
262
|
|
-?>
|
263
|
|
- <tr class="row hidden" id="matches_<?=$j?>">
|
264
|
|
- <td><?=$Match['Username']?></td>
|
265
|
|
- <td></td>
|
266
|
|
- <td><?=time_diff($Match['EndTime'])?></td>
|
267
|
|
- <td></td>
|
268
|
|
- <td>
|
269
|
|
- <?=display_str($Match['IP'])?>
|
270
|
|
- (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
271
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
272
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
273
|
|
- <br />
|
274
|
|
- <?=Tools::get_host_by_ajax($Match['IP'])?>
|
275
|
|
- </td>
|
276
|
|
- </tr>
|
277
|
|
-<?
|
278
|
|
- }
|
279
|
|
- }
|
|
249
|
+ // Matches on old email
|
|
250
|
+ ob_start();
|
|
251
|
+ $i = 0;
|
|
252
|
+ if ($OldMatches ?? false) {
|
|
253
|
+ foreach ($OldMatches as $Match) {
|
|
254
|
+ if ($Match['Email'] == $Record['Email']) {
|
|
255
|
+ ++$i;
|
|
256
|
+ // Email matches
|
|
257
|
+ ?>
|
|
258
|
+ <tr class="row hidden" id="matches_<?=$j?>">
|
|
259
|
+ <td><?=$Match['Username']?></td>
|
|
260
|
+ <td></td>
|
|
261
|
+ <td><?=time_diff($Match['EndTime'])?></td>
|
|
262
|
+ <td></td>
|
|
263
|
+ <td>
|
|
264
|
+ <?=display_str($Match['IP'])?>
|
|
265
|
+ (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
|
266
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
267
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
268
|
+ <br />
|
|
269
|
+ <?=Tools::get_host_by_ajax($Match['IP'])?>
|
|
270
|
+ </td>
|
|
271
|
+ </tr>
|
|
272
|
+ <?
|
|
273
|
+ }
|
|
274
|
+ }
|
|
275
|
+ }
|
280
|
276
|
|
281
|
|
- // Save matches to variable
|
282
|
|
- $MatchCount = $i;
|
283
|
|
- $Matches = ob_get_contents();
|
284
|
|
- ob_end_clean();
|
|
277
|
+ // Save matches to variable
|
|
278
|
+ $MatchCount = $i;
|
|
279
|
+ $Matches = ob_get_contents();
|
|
280
|
+ ob_end_clean();
|
285
|
281
|
|
286
|
282
|
$Record['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Record['Email']) : '[Encrypted]';
|
287
|
283
|
$Record['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Record['IP']) : '[Encrypted]';
|
288
|
284
|
?>
|
289
|
|
- <tr class="row">
|
290
|
|
- <td><?=display_str($Record['Email'])?><?=(($MatchCount > 0) ? ' <a href="#" onclick="$(\'#matches_'.$j.'\').gtoggle(); return false;">('.$MatchCount.')</a>' : '')?></td>
|
291
|
|
- <td><?=time_diff($Record['StartTime'])?></td>
|
292
|
|
- <td><?=time_diff($Record['EndTime'])?></td>
|
293
|
|
- <td><?=time_diff($Record['ElapsedTime'])?></td>
|
294
|
|
- <td>
|
295
|
|
- <?=display_str($Record['IP'])?>
|
296
|
|
- (<?=Tools::get_country_code_by_ajax($Record['IP'])?>)
|
297
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Record['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
298
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Record['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
299
|
|
- <br />
|
300
|
|
- <?=Tools::get_host_by_ajax($Record['IP'])?>
|
301
|
|
- </td>
|
302
|
|
- </tr>
|
|
285
|
+ <tr class="row">
|
|
286
|
+ <td><?=display_str($Record['Email'])?><?=(($MatchCount > 0) ? ' <a href="#" onclick="$(\'#matches_'.$j.'\').gtoggle(); return false;">('.$MatchCount.')</a>' : '')?></td>
|
|
287
|
+ <td><?=time_diff($Record['StartTime'])?></td>
|
|
288
|
+ <td><?=time_diff($Record['EndTime'])?></td>
|
|
289
|
+ <td><?=time_diff($Record['ElapsedTime'])?></td>
|
|
290
|
+ <td>
|
|
291
|
+ <?=display_str($Record['IP'])?>
|
|
292
|
+ (<?=Tools::get_country_code_by_ajax($Record['IP'])?>)
|
|
293
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Record['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
294
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Record['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
295
|
+ <br />
|
|
296
|
+ <?=Tools::get_host_by_ajax($Record['IP'])?>
|
|
297
|
+ </td>
|
|
298
|
+ </tr>
|
303
|
299
|
<?
|
304
|
|
- if ($MatchCount > 0) {
|
305
|
|
- if (isset($Matches)) {
|
306
|
|
- echo $Matches;
|
307
|
|
- unset($Matches);
|
308
|
|
- unset($MatchCount);
|
309
|
|
- }
|
310
|
|
- }
|
311
|
|
- }
|
|
300
|
+ if ($MatchCount > 0) {
|
|
301
|
+ if (isset($Matches)) {
|
|
302
|
+ echo $Matches;
|
|
303
|
+ unset($Matches);
|
|
304
|
+ unset($MatchCount);
|
|
305
|
+ }
|
|
306
|
+ }
|
|
307
|
+ }
|
312
|
308
|
}
|
313
|
309
|
// Invite email (always there)
|
314
|
310
|
?>
|
315
|
|
- <tr class="colhead">
|
316
|
|
- <td>Invite email</td>
|
317
|
|
- <td>Start</td>
|
318
|
|
- <td>End</td>
|
319
|
|
- <td>Age of account</td>
|
320
|
|
- <td>Registration IP address</td>
|
321
|
|
- </tr>
|
|
311
|
+ <tr class="colhead">
|
|
312
|
+ <td>Invite email</td>
|
|
313
|
+ <td>Start</td>
|
|
314
|
+ <td>End</td>
|
|
315
|
+ <td>Age of account</td>
|
|
316
|
+ <td>Registration IP address</td>
|
|
317
|
+ </tr>
|
322
|
318
|
<?
|
323
|
319
|
// Matches on invite email
|
324
|
|
-if ($OldMatches) {
|
325
|
|
- $i = 0;
|
326
|
|
- ob_start();
|
327
|
|
- foreach ($OldMatches as $Match) {
|
328
|
|
- if ($Match['Email'] == $Invite['Email']) {
|
329
|
|
- ++$i;
|
330
|
|
- // Match email is the same as the invite email
|
|
320
|
+$i = 0;
|
|
321
|
+ob_start();
|
|
322
|
+if ($OldMatches ?? false) {
|
|
323
|
+ foreach ($OldMatches as $Match) {
|
|
324
|
+ if ($Match['Email'] == $Invite['Email']) {
|
|
325
|
+ ++$i;
|
|
326
|
+ // Match email is the same as the invite email
|
331
|
327
|
|
332
|
328
|
$Match['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Match['IP']) : '[Encrypted]';
|
333
|
329
|
?>
|
334
|
|
- <tr class="row hidden" id="matches_invite">
|
335
|
|
- <td><?=$Match['Username']?></td>
|
336
|
|
- <td></td>
|
337
|
|
- <td><?=time_diff($Match['EndTime'])?></td>
|
338
|
|
- <td></td>
|
339
|
|
- <td>
|
340
|
|
- <?=display_str($Match['IP'])?>
|
341
|
|
- (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
342
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
343
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
344
|
|
- <br />
|
345
|
|
- <?=Tools::get_host_by_ajax($Match['IP'])?>
|
346
|
|
- </td>
|
347
|
|
- </tr>
|
|
330
|
+ <tr class="row hidden" id="matches_invite">
|
|
331
|
+ <td><?=$Match['Username']?></td>
|
|
332
|
+ <td></td>
|
|
333
|
+ <td><?=time_diff($Match['EndTime'])?></td>
|
|
334
|
+ <td></td>
|
|
335
|
+ <td>
|
|
336
|
+ <?=display_str($Match['IP'])?>
|
|
337
|
+ (<?=Tools::get_country_code_by_ajax($Match['IP'])?>)
|
|
338
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
339
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Match['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
340
|
+ <br />
|
|
341
|
+ <?=Tools::get_host_by_ajax($Match['IP'])?>
|
|
342
|
+ </td>
|
|
343
|
+ </tr>
|
348
|
344
|
<?
|
349
|
|
- }
|
350
|
|
- }
|
351
|
|
- $MatchCount = $i;
|
352
|
|
- $Matches = ob_get_contents();
|
353
|
|
- ob_end_clean();
|
|
345
|
+ }
|
|
346
|
+ }
|
354
|
347
|
}
|
|
348
|
+$MatchCount = $i;
|
|
349
|
+$Matches = ob_get_contents();
|
|
350
|
+ob_end_clean();
|
355
|
351
|
|
356
|
352
|
$Invite['Email'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Invite['Email']) : '[Encrypted]';
|
357
|
353
|
$Invite['IP'] = apc_exists('DBKEY') ? DBCrypt::decrypt($Invite['IP']) : '[Encrypted]';
|
358
|
354
|
?>
|
359
|
|
- <tr class="row">
|
360
|
|
- <td><?=display_str($Invite['Email'])?><?=(($MatchCount > 0) ? ' <a href="#" onclick="$(\'#matches_invite\').gtoggle(); return false;">('.$MatchCount.')</a>' : '')?></td>
|
361
|
|
- <td>Never</td>
|
362
|
|
- <td><?=time_diff($Invite['EndTime'])?></td>
|
363
|
|
- <td><?=time_diff($Invite['AccountAge'])?></td>
|
364
|
|
- <td>
|
365
|
|
- <?=display_str($Invite['IP'])?>
|
366
|
|
- (<?=Tools::get_country_code_by_ajax($Invite['IP'])?>)
|
367
|
|
- <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Invite['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
368
|
|
- <a href="http://whatismyipaddress.com/ip/<?=display_str($Invite['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
369
|
|
- <br />
|
370
|
|
- <?=Tools::get_host_by_ajax($Invite['IP'])?>
|
371
|
|
- </td>
|
372
|
|
- </tr>
|
|
355
|
+ <tr class="row">
|
|
356
|
+ <td><?=display_str($Invite['Email'])?><?=(($MatchCount > 0) ? ' <a href="#" onclick="$(\'#matches_invite\').gtoggle(); return false;">('.$MatchCount.')</a>' : '')?></td>
|
|
357
|
+ <td>Never</td>
|
|
358
|
+ <td><?=time_diff($Invite['EndTime'])?></td>
|
|
359
|
+ <td><?=time_diff($Invite['AccountAge'])?></td>
|
|
360
|
+ <td>
|
|
361
|
+ <?=display_str($Invite['IP'])?>
|
|
362
|
+ (<?=Tools::get_country_code_by_ajax($Invite['IP'])?>)
|
|
363
|
+ <a href="user.php?action=search&ip_history=on&ip=<?=display_str($Invite['IP'])?>" class="brackets tooltip" title="Search">S</a>
|
|
364
|
+ <a href="http://whatismyipaddress.com/ip/<?=display_str($Invite['IP'])?>" class="brackets tooltip" title="Search WIMIA.com">WI</a>
|
|
365
|
+ <br />
|
|
366
|
+ <?=Tools::get_host_by_ajax($Invite['IP'])?>
|
|
367
|
+ </td>
|
|
368
|
+ </tr>
|
373
|
369
|
<?
|
374
|
370
|
|
375
|
371
|
if ($Matches) {
|
376
|
|
- echo $Matches;
|
|
372
|
+ echo $Matches;
|
377
|
373
|
}
|
378
|
374
|
|
379
|
375
|
?>
|
380
|
|
- </table>
|
|
376
|
+ </table>
|
381
|
377
|
</div>
|
382
|
378
|
<? View::show_footer(); ?>
|