Changeset 10037 for extensions/autoupdate/trunk/ws_functions.inc.php
- Timestamp:
- Apr 4, 2011, 4:09:03 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/autoupdate/trunk/ws_functions.inc.php
r9947 r10037 73 73 $plugins = new plugins(); 74 74 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 96 75 if (empty($params['id']) or empty($params['revision'])) 97 76 { … … 103 82 104 83 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') 106 86 { 107 87 $plugins->perform_action('deactivate', $plugin_id); … … 128 108 $template->delete_compiled_templates(); 129 109 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 } 139 127 } 140 128
Note: See TracChangeset
for help on using the changeset viewer.