Last change
on this file since 4711 was
4711,
checked in by patdenice, 15 years ago
|
[Plugin][Piwigo Auto Upgrade]
If gallery and plugins are up to date, display note on admin homepage only one time for each session.
Allow to disable notification for plugins you don't want to update.
|
File size:
1.2 KB
|
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | define('PHPWG_ROOT_PATH','../../'); |
---|
4 | define('IN_ADMIN', true); |
---|
5 | include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); |
---|
6 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
7 | |
---|
8 | check_status(ACCESS_ADMINISTRATOR); |
---|
9 | |
---|
10 | if (isset($_POST['autoupdate_ignore']) |
---|
11 | and is_array($_POST['autoupdate_ignore']) |
---|
12 | and count($_POST['autoupdate_ignore']) == 2) |
---|
13 | { |
---|
14 | $ignore = unserialize($conf['autoupdate_ignore_list']); |
---|
15 | $ignore = array_flip($ignore); |
---|
16 | |
---|
17 | if ($_POST['autoupdate_ignore'][1] == "false" and isset($ignore[$_POST['autoupdate_ignore'][0]])) |
---|
18 | { |
---|
19 | unset($ignore[$_POST['autoupdate_ignore'][0]]); |
---|
20 | $ignore = array_flip($ignore); |
---|
21 | } |
---|
22 | elseif ($_POST['autoupdate_ignore'][1] == "true" and !isset($ignore[$_POST['autoupdate_ignore'][0]])) |
---|
23 | { |
---|
24 | $ignore = array_flip($ignore); |
---|
25 | array_push($ignore, $_POST['autoupdate_ignore'][0]); |
---|
26 | } |
---|
27 | else |
---|
28 | { |
---|
29 | die; |
---|
30 | } |
---|
31 | sort($ignore); |
---|
32 | |
---|
33 | $query = ' |
---|
34 | UPDATE '.CONFIG_TABLE.' |
---|
35 | SET value = "'.addslashes(serialize($ignore)).'" |
---|
36 | WHERE param = "autoupdate_ignore_list" |
---|
37 | ;'; |
---|
38 | pwg_query($query); |
---|
39 | |
---|
40 | echo 'ok'; |
---|
41 | } |
---|
42 | else |
---|
43 | { |
---|
44 | load_language('plugin.lang', dirname(__FILE__).'/'); |
---|
45 | |
---|
46 | include(dirname(__FILE__).'/class.inc.php'); |
---|
47 | $autoupdate = new autoupdate(); |
---|
48 | |
---|
49 | echo $autoupdate->check_version(); |
---|
50 | } |
---|
51 | |
---|
52 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.