-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.inc.php
More file actions
38 lines (29 loc) · 1.01 KB
/
main.inc.php
File metadata and controls
38 lines (29 loc) · 1.01 KB
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
<?php
/*
Plugin Name: Prune History
Version: auto
Description: Based on original History_cleanup plugin from VDigital, this plugin allows to manually or automatically prune history table according to configurable criteria
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=604
Author: Eric
Author URI: http://www.piwigo.org
Has Settings: true
*/
/* See release history and changes in changelog.txt file */
if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
if(!defined('PH_PATH'))
{
define('PH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
}
global $conf;
include_once (PH_PATH.'include/functions.inc.php');
add_event_handler('loading_lang', 'PH_loading_lang');
function PH_loading_lang(){
load_language('plugin.lang', PH_PATH);
}
$conf_PH = unserialize($conf['PruneHistory']);
/* Prune automation on user login */
if (isset($conf_PH['AUTOPRUNE']) and $conf_PH['AUTOPRUNE'] == 'true')
{
add_event_handler('login_success', 'history_autoprune', EVENT_HANDLER_PRIORITY_NEUTRAL, 10);
}
?>