Ignore:
Timestamp:
Apr 4, 2011, 4:09:03 PM (13 years ago)
Author:
patdenice
Message:

Don't deactivate autoupdate when update itself.
Check merged extensions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/trunk/ws_functions.inc.php

    r9947 r10037  
    7373  $plugins = new plugins();
    7474
    75   if (isset($params['upgradestatus']) and isset($params['id']))
    76   {
    77     switch ($params['upgradestatus'])
    78     {
    79       case 'ok':
    80         return sprintf(l10n('%s has been successfully upgraded.'), $plugins->fs_plugins[$params['id']]['name']);
    81 
    82       case 'temp_path_error':
    83         return new PwgError(null, l10n('Can\'t create temporary file.'));
    84 
    85       case 'dl_archive_error':
    86         return new PwgError(null, l10n('Can\'t download archive.'));
    87 
    88       case 'archive_error':
    89         return new PwgError(null, l10n('Can\'t read or extract archive.'));
    90 
    91       default:
    92         return new PwgError(null, sprintf(l10n('An error occured during extraction (%s).'), $params['upgradestatus']));
    93     }
    94   }
    95 
    9675  if (empty($params['id']) or empty($params['revision']))
    9776  {
     
    10382
    10483  if (isset($plugins->db_plugins_by_id[$plugin_id])
    105     and $plugins->db_plugins_by_id[$plugin_id]['state'] == 'active')
     84    and $plugins->db_plugins_by_id[$plugin_id]['state'] == 'active'
     85    and $plugin_id != 'autoupdate')
    10686  {
    10787    $plugins->perform_action('deactivate', $plugin_id);
     
    128108  $template->delete_compiled_templates();
    129109
    130   redirect(PHPWG_ROOT_PATH
    131     . 'ws.php'
    132     . '?method=pwg.plugins.update'
    133     . '&revision=' . $revision
    134     . '&id=' . $plugin_id
    135     . '&upgradestatus='.$upgrade_status
    136     . '&pwg_token=' . get_pwg_token()
    137     . '&format=json'
    138   );
     110  switch ($upgrade_status)
     111  {
     112    case 'ok':
     113      return sprintf(l10n('%s has been successfully upgraded.'), $plugins->fs_plugins[$plugin_id]['name']);
     114
     115    case 'temp_path_error':
     116      return new PwgError(null, l10n('Can\'t create temporary file.'));
     117
     118    case 'dl_archive_error':
     119      return new PwgError(null, l10n('Can\'t download archive.'));
     120
     121    case 'archive_error':
     122      return new PwgError(null, l10n('Can\'t read or extract archive.'));
     123
     124    default:
     125      return new PwgError(null, sprintf(l10n('An error occured during extraction (%s).'), $upgrade_status));
     126  }
    139127}
    140128
Note: See TracChangeset for help on using the changeset viewer.