Changeset 4712


Ignore:
Timestamp:
01/20/10 19:03:37 (10 years ago)
Author:
patdenice
Message:

code simplification

Location:
extensions/autoupdate
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/autoupdate/class.inc.php

    r4711 r4712  
    9999      include_once(PHPWG_ROOT_PATH.'admin/include/plugins.class.php'); 
    100100      $plugins = new plugins(); 
    101       $plugin_list = array(); 
    102101      $ignore_list = unserialize($conf['autoupdate_ignore_list']); 
    103102 
     
    123122      if (!empty($_SESSION['plugins_need_update'])) 
    124123      { 
    125         $plugin_list = $_SESSION['plugins_need_update']; 
    126  
    127         // Check ignore list 
    128         foreach ($plugin_list as $plugin_id => $version) 
    129         { 
    130           if (in_array($plugins->fs_plugins[$plugin_id]['name'], $ignore_list)) 
    131           { 
    132             unset($plugin_list[$plugin_id]); 
    133           } 
    134         } 
    135  
    136         if (!empty($plugin_list)) 
    137         { 
    138           return l10n('Some upgrades are available for you plugins').'<br>' 
    139             . '<a href="admin.php?page=plugins_update">'.l10n('Click here see upgrade plugins page').'</a>'; 
    140         } 
     124        return l10n('Some upgrades are available for you plugins').'<br>' 
     125          . '<a href="admin.php?page=plugins_update">'.l10n('Click here see upgrade plugins page').'</a>'; 
    141126      } 
    142127    } 
    143128 
    144     if ($_SESSION['need_update'] === false and $plugin_list === array()) 
     129    if ($_SESSION['need_update'] === false and $_SESSION['plugins_need_update'] === array()) 
    145130    { 
    146131      return l10n('Gallery and plugins are up to date'); 
     
    169154          if (!$plugins->plugin_version_compare($fs_plugin['version'], $plugin_info['revision_name'])) 
    170155          { 
    171             // Plugin need upgrade 
    172             $_SESSION['plugins_need_update'][$plugin_id] = $plugin_info['revision_name']; 
    173  
    174156            if (in_array($fs_plugin['name'], $ignore_list)) 
    175157            { 
    176158              array_push($new_ignore_list, $fs_plugin['name']); 
     159            } 
     160            else 
     161            { 
     162              $_SESSION['plugins_need_update'][$plugin_id] = $plugin_info['revision_name']; 
    177163            } 
    178164          } 
  • extensions/autoupdate/remote.php

    r4711 r4712  
    3838  pwg_query($query); 
    3939 
     40  unset($_SESSION['plugins_need_update']); 
    4041  echo 'ok'; 
    4142} 
Note: See TracChangeset for help on using the changeset viewer.