source: extensions/autoupdate/remote.php @ 4846

Last change on this file since 4846 was 4835, checked in by patdenice, 14 years ago

Force the ajax response charset to UTF-8.
Add some missing traductions.

File size: 1.3 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');
7
8check_status(ACCESS_ADMINISTRATOR);
9
10if (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 = '
34UPDATE '.CONFIG_TABLE.'
35SET value = "'.addslashes(serialize($ignore)).'"
36WHERE param = "autoupdate_ignore_list"
37;';
38  pwg_query($query);
39
40  unset($_SESSION['plugins_need_update']);
41  echo 'ok';
42}
43else
44{
45  load_language('plugin.lang', dirname(__FILE__).'/');
46  header('Content-Type: text/html; charset=UTF-8');
47
48  include(dirname(__FILE__).'/class.inc.php');
49  $autoupdate = new autoupdate();
50
51  echo $autoupdate->check_version();
52}
53
54?>
Note: See TracBrowser for help on using the repository browser.