diff options
author | patdenice <patdenice@piwigo.org> | 2011-04-21 15:12:38 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-04-21 15:12:38 +0000 |
commit | f5ef4fddd7ce277f27ef4face7933fe5a7406200 (patch) | |
tree | 128762355458b207214d41431c3bd9cabbfc6761 /include | |
parent | e1fd6aa04b301bb52a9ffa6423ba1885a3e21ddc (diff) |
feature:2271
Add pwg.extensions.checkUpdates method to webservices.
Add a warning message on intro page if update is availble for piwigo or extensions.
Add an "Ignore All" button on extensions update page.
git-svn-id: http://piwigo.org/svn/trunk@10538 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/ws_functions.inc.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index 0aaa5f561..2646abbe0 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -2845,6 +2845,7 @@ function ws_extensions_ignoreupdate($params, &$service) $conf['updates_ignored'] = unserialize($conf['updates_ignored']); + // Reset ignored extension if ($params['reset']) { $conf['updates_ignored'] = array( @@ -2871,4 +2872,40 @@ function ws_extensions_ignoreupdate($params, &$service) unset($_SESSION['extensions_need_update']); return true; } + +function ws_extensions_checkupdates($params, &$service) +{ + global $conf; + + define('IN_ADMIN', true); + include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); + include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php'); + $update = new updates(); + + if (!is_admin()) + { + return new PwgError(401, 'Access denied'); + } + + $result = array(); + + if (!isset($_SESSION['need_update'])) + $update->check_piwigo_upgrade(); + + $result['piwigo_need_update'] = $_SESSION['need_update']; + + $conf['updates_ignored'] = unserialize($conf['updates_ignored']); + + if (!isset($_SESSION['extensions_need_update'])) + $update->check_extensions(); + else + $update->check_updated_extensions(); + + if (!is_array($_SESSION['extensions_need_update'])) + $result['ext_need_update'] = null; + else + $result['ext_need_update'] = !empty($_SESSION['extensions_need_update']); + + return $result; +} ?> |