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

    r6551 r8086  
    197197    global $user;
    198198
    199     $pem_category_id = 8;
     199    $get_data = array(
     200      'category_id' => 8,
     201      'format' => 'php',
     202    );
    200203
    201204    // Retrieve PEM versions
    202205    $version = PHPWG_VERSION;
    203206    $versions_to_check = array();
    204     $url = PEM_URL . '/api/get_version_list.php?category_id='.$pem_category_id.'&format=php';
    205     if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
     207    $url = PEM_URL . '/api/get_version_list.php';
     208    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    206209    {
    207210      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
     
    224227
    225228    // Retrieve PEM languages infos
    226     $url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true';
    227     $url .= '&version=' . implode(',', $versions_to_check);
    228     $url .= '&lang='.$user['language'];
    229 
    230     if (fetchRemote($url, $result))
     229    $url = PEM_URL . '/api/get_revision_list.php';
     230    $get_data = array_merge($get_data, array(
     231      'last_revision_only' => 'true',
     232      'version' => implode(',', $versions_to_check),
     233      'lang' => $user['language'],
     234      )
     235    );
     236
     237    if (fetchRemote($url, $result, $get_data))
    231238    {
    232239      $pem_languages = @unserialize($result);
     
    259266    if ($archive = tempnam( PHPWG_ROOT_PATH.'language', 'zip'))
    260267    {
    261       $url = PEM_URL . '/download.php?rid=' . $revision;
    262       $url .= '&origin=piwigo_' . $action;
    263 
    264       if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
     268      $url = PEM_URL . '/download.php';
     269      $get_data = array(
     270        'rid' => $revision,
     271        'origin' => 'piwigo_'.$action,
     272      );
     273
     274      if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data))
    265275      {
    266276        fclose($handle);
Note: See TracChangeset for help on using the changeset viewer.