Changeset 4711
- Timestamp:
- Jan 20, 2010, 6:03:37 PM (14 years ago)
- Location:
- extensions/autoupdate
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/autoupdate/autoupdate.php
r4700 r4711 102 102 } 103 103 104 $template->set_filename('autoupdate_head', realpath(dirname(__FILE__).'/head.tpl')); 105 array_push($header_notes, $template->parse('autoupdate_head', true)); 104 if (!isset($_SESSION['need_update']) or !isset($_SESSION['plugins_need_update']) 105 or $_SESSION['need_update'] !== false or $_SESSION['plugins_need_update'] !== array()) 106 { 107 $template->set_filename('autoupdate_head', realpath(dirname(__FILE__).'/head.tpl')); 108 array_push($header_notes, $template->parse('autoupdate_head', true)); 109 } 106 110 107 111 ?> -
extensions/autoupdate/class.inc.php
r4700 r4711 99 99 include_once(PHPWG_ROOT_PATH.'admin/include/plugins.class.php'); 100 100 $plugins = new plugins(); 101 $plugin_list = array(); 102 $ignore_list = unserialize($conf['autoupdate_ignore_list']); 101 103 102 104 if (!isset($_SESSION['plugins_need_update'])) 103 105 { 104 106 $_SESSION['plugins_need_update'] = null; 105 $this->check_plugins_upgrade($plugins );107 $this->check_plugins_upgrade($plugins, $ignore_list); 106 108 } 107 109 elseif (!empty($_SESSION['plugins_need_update'])) … … 114 116 { 115 117 // Plugin have been updated 116 $this->check_plugins_upgrade($plugins );118 $this->check_plugins_upgrade($plugins, $ignore_list); 117 119 } 118 120 } … … 121 123 if (!empty($_SESSION['plugins_need_update'])) 122 124 { 123 return l10n('Some upgrades are available for you plugins').'<br>' 124 . '<a href="admin.php?page=plugins_update">'.l10n('Click here see upgrade plugins page').'</a>'; 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 } 125 141 } 126 142 } 127 143 128 if ($_SESSION['need_update'] === false and $ _SESSION['plugins_need_update']=== array())144 if ($_SESSION['need_update'] === false and $plugin_list === array()) 129 145 { 130 146 return l10n('Gallery and plugins are up to date'); … … 138 154 } 139 155 140 function check_plugins_upgrade($plugins )156 function check_plugins_upgrade($plugins, $ignore_list) 141 157 { 142 158 if ($plugins->get_server_plugins()) 143 159 { 160 $new_ignore_list = array(); 144 161 $_SESSION['plugins_need_update'] = array(); 145 162 … … 154 171 // Plugin need upgrade 155 172 $_SESSION['plugins_need_update'][$plugin_id] = $plugin_info['revision_name']; 173 174 if (in_array($fs_plugin['name'], $ignore_list)) 175 { 176 array_push($new_ignore_list, $fs_plugin['name']); 177 } 156 178 } 157 179 } 158 180 } 181 182 // Update ignore list in database 183 $query = ' 184 UPDATE '.CONFIG_TABLE.' 185 SET value = "'.addslashes(serialize($new_ignore_list)).'" 186 WHERE param = "autoupdate_ignore_list" 187 ;'; 188 pwg_query($query); 159 189 } 160 190 } -
extensions/autoupdate/language/en_UK/plugin.lang.php
r4699 r4711 17 17 $lang['Click here to check upgrades now'] = 'Click here to check upgrades now'; 18 18 19 $lang['Notify on admin homepage'] = 'Notify on admin homepage'; 20 $lang['Don\'t notify on admin homepage'] = 'Don\'t notify on admin homepage'; 21 19 22 ?> -
extensions/autoupdate/language/es_ES/plugin.lang.php
r4699 r4711 17 17 /*TODO*/$lang['Click here to check upgrades now'] = 'Click here to check upgrades now'; 18 18 19 /*TODO*/$lang['Notify on admin homepage'] = 'Notify on admin homepage'; 20 /*TODO*/$lang['Don\'t notify on admin homepage'] = 'Don\'t notify on admin homepage'; 21 19 22 ?> -
extensions/autoupdate/language/fr_FR/plugin.lang.php
r4699 r4711 15 15 $lang['Unable to check upgrades...'] = 'Impossible de vérifier les mises à jour...'; 16 16 $lang['Click here to check upgrades now'] = 'Cliquez ici pour vérifier les mises à jour maintenant'; 17 18 $lang['Notify on admin homepage'] = 'Notifier sur l\'accueil de l\'administration'; 19 $lang['Don\'t notify on admin homepage'] = 'Ne pas notifier sur l\'accueil de l\'administration'; 20 17 21 ?> -
extensions/autoupdate/language/hu_HU/plugin.lang.php
r4699 r4711 17 17 /*TODO*/$lang['Click here to check upgrades now'] = 'Click here to check upgrades now'; 18 18 19 /*TODO*/$lang['Notify on admin homepage'] = 'Notify on admin homepage'; 20 /*TODO*/$lang['Don\'t notify on admin homepage'] = 'Don\'t notify on admin homepage'; 21 19 22 ?> -
extensions/autoupdate/language/it_IT/plugin.lang.php
r4701 r4711 16 16 $lang['Piwigo will automaticaly try again later.'] = 'Piwigo riproverà automaticamente più tardi.'; 17 17 $lang['Click here to check upgrades now'] = 'Cliccare qui per verificare gli aggiornameti ora'; 18 19 /*TODO*/$lang['Notify on admin homepage'] = 'Notify on admin homepage'; 20 /*TODO*/$lang['Don\'t notify on admin homepage'] = 'Don\'t notify on admin homepage'; 21 18 22 ?> -
extensions/autoupdate/language/pl_PL/plugin.lang.php
r4699 r4711 17 17 /*TODO*/$lang['Click here to check upgrades now'] = 'Click here to check upgrades now'; 18 18 19 /*TODO*/$lang['Notify on admin homepage'] = 'Notify on admin homepage'; 20 /*TODO*/$lang['Don\'t notify on admin homepage'] = 'Don\'t notify on admin homepage'; 21 19 22 ?> -
extensions/autoupdate/main.inc.php
r4699 r4711 22 22 } 23 23 24 if ($page['page'] == 'plugins_update') 25 { 26 include(dirname(__FILE__).'/plugins_update.php'); 27 } 28 24 29 return $plugin_menu_links; 25 30 } -
extensions/autoupdate/remote.php
r4699 r4711 8 8 check_status(ACCESS_ADMINISTRATOR); 9 9 10 load_language('plugin.lang', dirname(__FILE__).'/'); 10 if (isset($_POST['autoupdate_ignore']) 11 and is_array($_POST['autoupdate_ignore']) 12 and count($_POST['autoupdate_ignore']) == 2) 13 { 14 $ignore = unserialize($conf['autoupdate_ignore_list']); 15 $ignore = array_flip($ignore); 11 16 12 include(dirname(__FILE__).'/class.inc.php'); 13 $autoupdate = new autoupdate(); 17 if ($_POST['autoupdate_ignore'][1] == "false" and isset($ignore[$_POST['autoupdate_ignore'][0]])) 18 { 19 unset($ignore[$_POST['autoupdate_ignore'][0]]); 20 $ignore = array_flip($ignore); 21 } 22 elseif ($_POST['autoupdate_ignore'][1] == "true" and !isset($ignore[$_POST['autoupdate_ignore'][0]])) 23 { 24 $ignore = array_flip($ignore); 25 array_push($ignore, $_POST['autoupdate_ignore'][0]); 26 } 27 else 28 { 29 die; 30 } 31 sort($ignore); 14 32 15 echo $autoupdate->check_version(); 33 $query = ' 34 UPDATE '.CONFIG_TABLE.' 35 SET value = "'.addslashes(serialize($ignore)).'" 36 WHERE param = "autoupdate_ignore_list" 37 ;'; 38 pwg_query($query); 39 40 echo 'ok'; 41 } 42 else 43 { 44 load_language('plugin.lang', dirname(__FILE__).'/'); 45 46 include(dirname(__FILE__).'/class.inc.php'); 47 $autoupdate = new autoupdate(); 48 49 echo $autoupdate->check_version(); 50 } 16 51 17 52 ?>
Note: See TracChangeset
for help on using the changeset viewer.