Last change
on this file since 9729 was
9729,
checked in by patdenice, 13 years ago
|
Only one request to PEM server for plugins, themes and languages.
|
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 | include_once(AUTOUPDATE_PATH.'include/autoupdate.class.php'); |
---|
8 | $autoupdate = new autoupdate(); |
---|
9 | |
---|
10 | check_status(ACCESS_ADMINISTRATOR); |
---|
11 | |
---|
12 | // Check if gallery or plugins are up to date |
---|
13 | load_language('plugin.lang', dirname(dirname(__FILE__)).'/'); |
---|
14 | header('Content-Type: text/html; charset=UTF-8'); |
---|
15 | |
---|
16 | function autoupdate_error() |
---|
17 | { |
---|
18 | unset($_SESSION['extensions_need_update']); |
---|
19 | echo 'error'; |
---|
20 | exit; |
---|
21 | } |
---|
22 | |
---|
23 | if (!isset($_SESSION['need_update'])) |
---|
24 | { |
---|
25 | $autoupdate->check_piwigo_upgrade(); |
---|
26 | } |
---|
27 | |
---|
28 | if ($_SESSION['need_update']) |
---|
29 | { |
---|
30 | echo 'piwigo_upgrade'; exit(); |
---|
31 | } |
---|
32 | else |
---|
33 | { |
---|
34 | // Gallery is up to date -> check extensions |
---|
35 | if (!isset($_SESSION['extensions_need_update'])) |
---|
36 | { |
---|
37 | $autoupdate->check_extensions(); |
---|
38 | } |
---|
39 | else |
---|
40 | { |
---|
41 | $autoupdate->check_updated_extensions(); |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | if (!empty($_SESSION['extensions_need_update'])) |
---|
46 | { |
---|
47 | echo 'ext_upgrade'; exit; |
---|
48 | } |
---|
49 | elseif ($_SESSION['need_update'] === false and $_SESSION['extensions_need_update'] === array()) |
---|
50 | { |
---|
51 | echo 'up_to_date'; exit; |
---|
52 | } |
---|
53 | else |
---|
54 | { |
---|
55 | autoupdate_error(); |
---|
56 | } |
---|
57 | |
---|
58 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.