4822: data privacy improvement, purge log files
This commit is contained in:
@@ -133,6 +133,11 @@
|
|||||||
$opt['news']['mail'] = 'root';
|
$opt['news']['mail'] = 'root';
|
||||||
$opt['mail']['subject'] = '[local.opencaching.de] ';
|
$opt['mail']['subject'] = '[local.opencaching.de] ';
|
||||||
|
|
||||||
|
/* Purge log files - age in days (0 = keep infinite)
|
||||||
|
*/
|
||||||
|
$opt['logic']['logs']['purge_email'] = 0;
|
||||||
|
$opt['logic']['logs']['purge_userdata'] = 0;
|
||||||
|
|
||||||
/* 3rd party library options
|
/* 3rd party library options
|
||||||
* see https://my.garmin.com/api/communicator/key-generator.jsp
|
* see https://my.garmin.com/api/communicator/key-generator.jsp
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -341,6 +341,11 @@
|
|||||||
// fill_gaps = false: continue with the last waypoint
|
// fill_gaps = false: continue with the last waypoint
|
||||||
$opt['logic']['waypoint_pool']['fill_gaps'] = false;
|
$opt['logic']['waypoint_pool']['fill_gaps'] = false;
|
||||||
|
|
||||||
|
/* Purge log files - age in days (0 = keep infinite)
|
||||||
|
*/
|
||||||
|
$opt['logic']['logs']['purge_email'] = 30;
|
||||||
|
$opt['logic']['logs']['purge_userdata'] = 14;
|
||||||
|
|
||||||
/* Database charset
|
/* Database charset
|
||||||
* frontend and php charsets are UTF-8
|
* frontend and php charsets are UTF-8
|
||||||
* here you can set a different charset for the MySQL-Engine
|
* here you can set a different charset for the MySQL-Engine
|
||||||
|
|||||||
@@ -25,3 +25,4 @@ date commit ID change
|
|||||||
2012-11-17 39a25f99 removed cache_waypoint_pool.cache_id and index cache_id
|
2012-11-17 39a25f99 removed cache_waypoint_pool.cache_id and index cache_id
|
||||||
added cache_waypoint_pool.uuid and index uuid
|
added cache_waypoint_pool.uuid and index uuid
|
||||||
changed caches.wp_oc to 'NOT NULL'
|
changed caches.wp_oc to 'NOT NULL'
|
||||||
|
2013-02-12 added indices logentries:date and email_user:date
|
||||||
|
|||||||
@@ -604,6 +604,7 @@ INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('4', 'appro
|
|||||||
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('5', 'cache', 'changeowner');
|
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('5', 'cache', 'changeowner');
|
||||||
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('6', 'user', 'disable');
|
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('6', 'user', 'disable');
|
||||||
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('7', 'user', 'delete');
|
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('7', 'user', 'delete');
|
||||||
|
INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('8', 'notification', 'sendmail');
|
||||||
|
|
||||||
-- Table news_topics
|
-- Table news_topics
|
||||||
SET NAMES 'utf8';
|
SET NAMES 'utf8';
|
||||||
|
|||||||
@@ -9,5 +9,6 @@ CREATE TABLE `email_user` (
|
|||||||
`to_user_id` int(10) unsigned NOT NULL default '0',
|
`to_user_id` int(10) unsigned NOT NULL default '0',
|
||||||
`to_email` varchar(60) NOT NULL,
|
`to_email` varchar(60) NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `from_user_id` (`from_user_id`)
|
KEY `from_user_id` (`from_user_id`),
|
||||||
|
KEY `date` (`date_created`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ CREATE TABLE `logentries` (
|
|||||||
`objectid2` int(10) unsigned NOT NULL default '0',
|
`objectid2` int(10) unsigned NOT NULL default '0',
|
||||||
`logtext` mediumtext NOT NULL,
|
`logtext` mediumtext NOT NULL,
|
||||||
`details` blob NOT NULL,
|
`details` blob NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `date` (`date_created`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||||
|
|||||||
@@ -711,12 +711,13 @@ class user
|
|||||||
sql("UPDATE `user` SET `password`=NULL, `email`=NULL,
|
sql("UPDATE `user` SET `password`=NULL, `email`=NULL,
|
||||||
`is_active_flag`=0,
|
`is_active_flag`=0,
|
||||||
`latitude`=0, `longitude`=0,
|
`latitude`=0, `longitude`=0,
|
||||||
`last_name`='', `first_name`='',
|
`last_name`='', `first_name`='', `country`=NULL,
|
||||||
`country`=NULL, `new_pw_code`=NULL,
|
`new_pw_code`=NULL, `new_pw_date`=NULL,
|
||||||
`new_pw_date`=NULL, `new_email`=NULL,
|
`new_email`=NULL, `new_email_code`=NULL, `new_email_date`=NULL,
|
||||||
`new_email_code`=NULL, `activation_code`='',
|
`permanent_login_flag`=0, `activation_code`='',
|
||||||
`notify_radius`=0, `statpic_text`=''
|
`notify_radius`=0, `statpic_text`=''
|
||||||
WHERE `user_id`='&1'", $this->nUserId);
|
WHERE `user_id`='&1'", $this->nUserId);
|
||||||
|
sql("DELETE FROM `user_options` WHERE `user_id`='&1'", $this->nUserId);
|
||||||
$this->reload();
|
$this->reload();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function process_new_cache($notify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
|
// logentry($module, $eventid, $userid, $objectid1, $objectid2, $logtext, $details)
|
||||||
logentry('notify_newcache', 5, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, array());
|
logentry('notify_newcache', 8, $notify['recid'], $notify['cache_id'], 0, 'Sending mail to ' . $mailadr, array());
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
/***************************************************************************
|
||||||
|
* For license information see doc/license.txt
|
||||||
|
*
|
||||||
|
* Unicode Reminder メモ
|
||||||
|
*
|
||||||
|
* Delete old log entries with personal user data for data privacy
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
checkJob(new purge_logs());
|
||||||
|
|
||||||
|
class purge_logs
|
||||||
|
{
|
||||||
|
var $name = 'purge_logs';
|
||||||
|
var $interval = 86400; // daily
|
||||||
|
|
||||||
|
function run()
|
||||||
|
{
|
||||||
|
global $opt;
|
||||||
|
|
||||||
|
if ($opt['logic']['logs']['purge_email'] > 0)
|
||||||
|
{
|
||||||
|
sql("DELETE FROM `email_user` WHERE date_created < NOW() - INTERVAL &1 DAY",
|
||||||
|
$opt['logic']['logs']['purge_email']);
|
||||||
|
sql("DELETE FROM `logentries` WHERE date_created < NOW() - INTERVAL &1 DAY AND eventid IN (1,2,3,8)",
|
||||||
|
$opt['logic']['logs']['purge_email']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($opt['logic']['logs']['purge_userdata'] > 0)
|
||||||
|
sql("DELETE FROM `logentries` WHERE date_created < NOW() - INTERVAL &1 DAY AND eventid IN (6,7)",
|
||||||
|
$opt['logic']['logs']['purge_userdata']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user