Ignore:
Timestamp:
Dec 11, 2010, 10:37:44 PM (13 years ago)
Author:
patdenice
Message:

merge r8079, r8080, r8082, r8083, r8084 from trunk to branch 2.1
feature 2057: fetchRemote can send POST data
feature 2048: Use POST to send server data
feature 2048: add $confsend_hosting_technical_details parameter
feature 2057: use $get_data parameter to send GET data.
feature 2048: send technical details only to get_version_list.php of PEM API.

Location:
branches/2.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1

  • branches/2.1/admin/include/plugins.class.php

    r6724 r8086  
    291291    global $user;
    292292
     293    $get_data = array(
     294      'category_id' => 12,
     295      'format' => 'php',
     296    );
     297
    293298    // Retrieve PEM versions
    294299    $version = PHPWG_VERSION;
    295300    $versions_to_check = array();
    296     $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
    297     if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
     301    $url = PEM_URL . '/api/get_version_list.php';
     302    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    298303    {
    299304      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
     
    326331
    327332    // Retrieve PEM plugins infos
    328     $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true';
    329     $url .= '&version=' . implode(',', $versions_to_check);
    330     $url .= '&lang=' . substr($user['language'], 0, 2);
    331     $url .= '&get_nb_downloads=true';
     333    $url = PEM_URL . '/api/get_revision_list.php';
     334    $get_data = array_merge($get_data, array(
     335      'last_revision_only' => 'true',
     336      'version' => implode(',', $versions_to_check),
     337      'lang' => substr($user['language'], 0, 2),
     338      'get_nb_downloads' => 'true',
     339      )
     340    );
    332341
    333342    if (!empty($plugins_to_check))
    334343    {
    335       $url .= $new ? '&extension_exclude=' : '&extension_include=';
    336       $url .= implode(',', $plugins_to_check);
    337     }
    338     if (fetchRemote($url, $result))
     344      if ($new)
     345      {
     346        $get_data['extension_exclude'] = implode(',', $plugins_to_check);
     347      }
     348      else
     349      {
     350        $get_data['extension_include'] = implode(',', $plugins_to_check);
     351      }
     352    }
     353    if (fetchRemote($url, $result, $get_data))
    339354    {
    340355      $pem_plugins = @unserialize($result);
     
    387402    if ($archive = tempnam( PHPWG_PLUGINS_PATH, 'zip'))
    388403    {
    389       $url = PEM_URL . '/download.php?rid=' . $revision;
    390       $url .= '&origin=piwigo_' . $action;
    391 
    392       if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
     404      $url = PEM_URL . '/download.php';
     405      $get_data = array(
     406        'rid' => $revision,
     407        'origin' => 'piwigo_'.$action,
     408      );
     409
     410      if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data))
    393411      {
    394412        fclose($handle);
Note: See TracChangeset for help on using the changeset viewer.