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/themes.class.php

    r6551 r8086  
    448448    global $user;
    449449
    450     $pem_category_id = 10;
     450    $get_data = array(
     451      'category_id' => 10,
     452      'format' => 'php',
     453    );
    451454
    452455    // Retrieve PEM versions
    453456    $version = PHPWG_VERSION;
    454457    $versions_to_check = array();
    455     $url = PEM_URL . '/api/get_version_list.php?category_id='.$pem_category_id.'&format=php';
    456     if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
     458    $url = PEM_URL . '/api/get_version_list.php';
     459    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    457460    {
    458461      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
     
    485488
    486489    // Retrieve PEM themes infos
    487     $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true';
    488     $url .= '&version=' . implode(',', $versions_to_check);
    489     $url .= '&lang=' . substr($user['language'], 0, 2);
    490     $url .= '&get_nb_downloads=true';
     490    $url = PEM_URL . '/api/get_revision_list.php';
     491    $get_data = array_merge($get_data, array(
     492      'last_revision_only' => 'true',
     493      'version' => implode(',', $versions_to_check),
     494      'lang' => substr($user['language'], 0, 2),
     495      'get_nb_downloads' => 'true',
     496      )
     497    );
    491498
    492499    if (!empty($themes_to_check))
    493500    {
    494       $url .= $new ? '&extension_exclude=' : '&extension_include=';
    495       $url .= implode(',', $themes_to_check);
    496     }
    497     if (fetchRemote($url, $result))
     501      if ($new)
     502      {
     503        $get_data['extension_exclude'] = implode(',', $themes_to_check);
     504      }
     505      else
     506      {
     507        $get_data['extension_include'] = implode(',', $themes_to_check);
     508      }
     509    }
     510    if (fetchRemote($url, $result, $get_data))
    498511    {
    499512      $pem_themes = @unserialize($result);
     
    547560    if ($archive = tempnam( PHPWG_THEMES_PATH, 'zip'))
    548561    {
    549       $url = PEM_URL . '/download.php?rid=' . $revision;
    550       $url .= '&origin=piwigo_' . $action;
    551 
    552       if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
     562      $url = PEM_URL . '/download.php';
     563      $get_data = array(
     564        'rid' => $revision,
     565        'origin' => 'piwigo_'.$action,
     566      );
     567
     568      if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data))
    553569      {
    554570        fclose($handle);
Note: See TracChangeset for help on using the changeset viewer.