mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-07 22:31:59 +01:00
anonimize shown ip address in demo mode
This commit is contained in:
parent
3d8d08f2bd
commit
3f4962990d
@ -29,6 +29,7 @@ $config['SITE_NAME'] = 'piler.yourdomain.com';
|
||||
$config['SITE_URL'] = 'http://piler.yourdomain.com/';
|
||||
|
||||
$config['ENABLE_SAAS'] = 0;
|
||||
$config['DEMO_MODE'] = 0;
|
||||
|
||||
$config['TIMEZONE'] = 'Europe/Budapest';
|
||||
|
||||
|
@ -92,7 +92,7 @@ class ModelAuditAudit extends Model {
|
||||
'action' => $a['action'],
|
||||
'email' => $a['email'],
|
||||
'date' => date(AUDIT_DATE_FORMAT, $a['ts']),
|
||||
'ipaddr' => $a['ipaddr'],
|
||||
'ipaddr' => DEMO_MODE == 1 ? anonimize_ip_addr($a['ipaddr']) : $a['ipaddr'],
|
||||
'description' => $a['description'],
|
||||
'shortdescription' => make_short_string($a['description'], MAX_CGI_FROM_SUBJ_LEN)
|
||||
);
|
||||
|
@ -492,6 +492,18 @@ function safe_feof($fp, &$start = NULL) {
|
||||
}
|
||||
|
||||
|
||||
function anonimize_ip_addr($ip = '') {
|
||||
$ip = explode(".", $ip);
|
||||
if(count($ip) == 4) {
|
||||
$ip[0] = $ip[1] = 'x';
|
||||
|
||||
$ip = implode(".", $ip);
|
||||
}
|
||||
|
||||
return $ip;
|
||||
}
|
||||
|
||||
|
||||
function get_ldap_attribute_names($ldap_type = '') {
|
||||
|
||||
$ldap_mail_attr = LDAP_MAIL_ATTR;
|
||||
|
@ -16,7 +16,7 @@
|
||||
<?php foreach($users as $user) { ?>
|
||||
<tr>
|
||||
<td class="domaincell"><?php print $user['username']; ?></td>
|
||||
<td class="domaincell"><?php print $user['ipaddr']; ?></td>
|
||||
<td class="domaincell"><?php if(DEMO_MODE == 1) { print anonimize_ip_addr($user['ipaddr']); } else { print $user['ipaddr']; } ?></td>
|
||||
<td class="domaincell"><?php print date("Y.m.d. G:i:s", $user['ts']); ?></td>
|
||||
<td class="domaincell"><?php print date("Y.m.d. G:i:s", $user['last_activity']); ?></td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user