source: extensions/autoupdate/trunk/ajax/ignore_list.php @ 9707

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

New version 2.2

File size: 1.1 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['reset']))
12{
13  $conf['AU_ignore'] = array('plugins'=>array(),'themes'=>array(),'languages'=>array());
14  conf_update_param('autoupdate_ignore_list', pwg_db_real_escape_string(serialize($conf['AU_ignore'])));
15  unset($_SESSION['extensions_need_update']);
16  echo 'ok';
17}
18
19if (empty($_POST['id']) or empty($_POST['type']))
20{
21  die;
22}
23
24// Add or remove plugin from ignore list
25$ignore = $conf['AU_ignore'][$_POST['type']];
26$ignore = array_flip($ignore);
27
28if (isset($ignore[$_POST['id']]))
29{
30  unset($ignore[$_POST['id']]);
31  $ignore = array_flip($ignore);
32}
33else
34{
35  $ignore = array_flip($ignore);
36  array_push($ignore, $_POST['id']);
37}
38
39sort($ignore);
40$conf['AU_ignore'][$_POST['type']] = $ignore;
41conf_update_param('autoupdate_ignore_list', pwg_db_real_escape_string(serialize($conf['AU_ignore'])));
42unset($_SESSION['extensions_need_update']);
43echo 'ok';
44
45?>
Note: See TracBrowser for help on using the repository browser.