source: extensions/autoupdate/trunk/remote.php @ 6200

Last change on this file since 6200 was 6168, checked in by patdenice, 15 years ago

Create branch 1.7

File size: 1.4 KB
Line 
1<?php
2
3define('PHPWG_ROOT_PATH','../../');
4define('IN_ADMIN', true);
5include_once( PHPWG_ROOT_PATH.'include/common.inc.php' );
6include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
7include_once(PHPWG_ROOT_PATH.'admin/include/functions_plugins.inc.php');
8
9check_status(ACCESS_ADMINISTRATOR);
10
11if (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 = '
36UPDATE '.CONFIG_TABLE.'
37SET value = "'.addslashes(serialize($ignore)).'"
38WHERE param = "autoupdate_ignore_list"
39;';
40  pwg_query($query);
41
42  unset($_SESSION['plugins_need_update']);
43  echo 'ok';
44}
45else
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?>
Note: See TracBrowser for help on using the repository browser.