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 | include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php'); |
---|
8 | |
---|
9 | check_status(ACCESS_ADMINISTRATOR); |
---|
10 | |
---|
11 | if (isset($_POST['autoupdate_ignore']) |
---|
12 | and is_array($_POST['autoupdate_ignore']) |
---|
13 | and count($_POST['autoupdate_ignore']) == 2) |
---|
14 | { |
---|
15 | // Add or remove plugin from ignore list |
---|
16 | $ignore = unserialize($conf['autoupdate_ignore_list']); |
---|
17 | $ignore = array_flip($ignore); |
---|
18 | |
---|
19 | if ($_POST['autoupdate_ignore'][1] == "false" and isset($ignore[$_POST['autoupdate_ignore'][0]])) |
---|
20 | { |
---|
21 | unset($ignore[$_POST['autoupdate_ignore'][0]]); |
---|
22 | $ignore = array_flip($ignore); |
---|
23 | } |
---|
24 | elseif ($_POST['autoupdate_ignore'][1] == "true" and !isset($ignore[$_POST['autoupdate_ignore'][0]])) |
---|
25 | { |
---|
26 | $ignore = array_flip($ignore); |
---|
27 | array_push($ignore, $_POST['autoupdate_ignore'][0]); |
---|
28 | } |
---|
29 | else |
---|
30 | { |
---|
31 | die; |
---|
32 | } |
---|
33 | sort($ignore); |
---|
34 | |
---|
35 | $query = ' |
---|
36 | UPDATE '.CONFIG_TABLE.' |
---|
37 | SET value = "'.addslashes(serialize($ignore)).'" |
---|
38 | WHERE param = "autoupdate_ignore_list" |
---|
39 | ;'; |
---|
40 | pwg_query($query); |
---|
41 | |
---|
42 | unset($_SESSION['plugins_need_update']); |
---|
43 | echo 'ok'; |
---|
44 | } |
---|
45 | else |
---|
46 | { |
---|
47 | // Check if gallery or plugins are up to date |
---|
48 | load_language('plugin.lang', dirname(__FILE__).'/'); |
---|
49 | header('Content-Type: text/html; charset=UTF-8'); |
---|
50 | |
---|
51 | include(AUTOUPDATE_PATH.'include/functions_remote.inc.php'); |
---|
52 | echo autoupdate_check_version(); |
---|
53 | } |
---|
54 | |
---|
55 | ?> |
---|