Changeset 5153 for trunk/admin/include/plugins.class.php
- Timestamp:
- Mar 17, 2010, 1:48:38 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/plugins.class.php
r5143 r5153 269 269 * Retrieve PEM server datas to $server_plugins 270 270 */ 271 function get_server_plugins($new=false , $ext_type='plugin')271 function get_server_plugins($new=false) 272 272 { 273 273 global $user; 274 275 $pem_category_id = 12;276 if ('theme' == $ext_type)277 {278 $pem_category_id = 10;279 }280 274 281 275 // Retrieve PEM versions 282 276 $version = PHPWG_VERSION; 283 277 $versions_to_check = array(); 284 $url = PEM_URL . '/api/get_version_list.php?category_id= '.$pem_category_id.'&format=php';278 $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php'; 285 279 if (fetchRemote($url, $result) and $pem_versions = @unserialize($result)) 286 280 { … … 314 308 315 309 // Retrieve PEM plugins infos 316 $url = PEM_URL . '/api/get_revision_list.php?category_id= '.$pem_category_id.'&format=php&last_revision_only=true';310 $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true'; 317 311 $url .= '&version=' . implode(',', $versions_to_check); 318 312 $url .= '&lang=' . substr($user['language'], 0, 2); … … 371 365 * @param string - plugin id or extension id 372 366 */ 373 function extract_plugin_files($action, $revision, $dest, $ext_type = 'plugin') 374 { 375 if ('plugin' == $ext_type) 376 { 377 $install_basedir = PHPWG_PLUGINS_PATH; 378 $main_filename = 'main.inc.php'; 379 } 380 elseif ('theme' == $ext_type) 381 { 382 $install_basedir = PHPWG_ROOT_PATH.'themes/'; 383 $main_filename = 'themeconf.inc.php'; 384 } 385 else 386 { 387 fatal_error('unknown extension type "'.$ext_type.'"'); 388 } 389 390 if ($archive = tempnam( $install_basedir, 'zip')) 367 function extract_plugin_files($action, $revision, $dest) 368 { 369 if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip')) 391 370 { 392 371 $url = PEM_URL . '/download.php?rid=' . $revision; … … 403 382 { 404 383 // we search main.inc.php in archive 405 if (basename($file['filename']) == $main_filename384 if (basename($file['filename']) == 'main.inc.php' 406 385 and (!isset($main_filepath) 407 386 or strlen($file['filename']) < strlen($main_filepath))) … … 415 394 if ($action == 'upgrade') 416 395 { 417 $extract_path = $install_basedir. $dest;396 $extract_path = PHPWG_PLUGINS_PATH . $dest; 418 397 } 419 398 else 420 399 { 421 $extract_path = $install_basedir400 $extract_path = PHPWG_PLUGINS_PATH 422 401 . ($root == '.' ? 'extension_' . $dest : basename($root)); 423 402 }
Note: See TracChangeset
for help on using the changeset viewer.