Changeset 10538 for trunk/include


Ignore:
Timestamp:
Apr 21, 2011, 5:12:38 PM (14 years ago)
Author:
patdenice
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/ws_functions.inc.php

    r10511 r10538  
    28462846  $conf['updates_ignored'] = unserialize($conf['updates_ignored']);
    28472847
     2848  // Reset ignored extension
    28482849  if ($params['reset'])
    28492850  {
     
    28722873  return true;
    28732874}
     2875
     2876function ws_extensions_checkupdates($params, &$service)
     2877{
     2878  global $conf;
     2879
     2880  define('IN_ADMIN', true);
     2881  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     2882  include_once(PHPWG_ROOT_PATH.'admin/include/updates.class.php');
     2883  $update = new updates();
     2884
     2885  if (!is_admin())
     2886  {
     2887    return new PwgError(401, 'Access denied');
     2888  }
     2889
     2890  $result = array();
     2891
     2892  if (!isset($_SESSION['need_update']))
     2893    $update->check_piwigo_upgrade();
     2894
     2895  $result['piwigo_need_update'] = $_SESSION['need_update'];
     2896
     2897  $conf['updates_ignored'] = unserialize($conf['updates_ignored']);
     2898
     2899  if (!isset($_SESSION['extensions_need_update']))
     2900    $update->check_extensions();
     2901  else
     2902    $update->check_updated_extensions();
     2903
     2904  if (!is_array($_SESSION['extensions_need_update']))
     2905    $result['ext_need_update'] = null;
     2906  else
     2907    $result['ext_need_update'] = !empty($_SESSION['extensions_need_update']);
     2908
     2909  return $result;
     2910}
    28742911?>
Note: See TracChangeset for help on using the changeset viewer.