Changeset 8084


Ignore:
Timestamp:
Dec 11, 2010, 10:20:12 PM (10 years ago)
Author:
patdenice
Message:

feature 2048: send technical details only to get_version_list.php of PEM API.

Location:
trunk/admin/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r8082 r8084  
    17051705function fetchRemote($src, &$dest, $get_data=array(), $post_data=array(), $user_agent='Piwigo', $step=0)
    17061706{
    1707   global $conf;
    1708 
    17091707  // Try to retrieve data from local file?
    17101708  if (!url_is_remote($src))
     
    17241722  // After 3 redirections, return false
    17251723  if ($step > 3) return false;
    1726 
    1727   // Send anonymous data to piwigo server
    1728   if ($conf['send_hosting_technical_details']
    1729     and $_SERVER['HTTP_HOST'] != 'localhost' and $step==0
    1730     and preg_match('#^http://(?:[a-z]+\.)?piwigo\.org#', $src))
    1731   {
    1732     $post_data = array_merge($post_data, array(
    1733       'uuid' => hash_hmac('md5', get_absolute_root_url(), $conf['secret_key']),
    1734       'os' => urlencode(PHP_OS),
    1735       'pwgversion' => urlencode(PHPWG_VERSION),
    1736       'phpversion' => urlencode(phpversion()),
    1737       'dbengine' => urlencode(DB_ENGINE),
    1738       'dbversion' => urlencode(pwg_get_db_version()),
    1739       )
    1740     );
    1741   }
    17421724
    17431725  // Initialization
     
    20632045  return $tag_ids;
    20642046}
     2047
     2048function get_hosting_technical_details()
     2049{
     2050  global $conf;
     2051
     2052  $details = array();
     2053  if ($conf['send_hosting_technical_details'] and $_SERVER['HTTP_HOST'] != 'localhost')
     2054  {
     2055    $details = array(
     2056      'uuid' => hash_hmac('md5', get_absolute_root_url(), $conf['secret_key']),
     2057      'os' => urlencode(PHP_OS),
     2058      'pwgversion' => urlencode(PHPWG_VERSION),
     2059      'phpversion' => urlencode(phpversion()),
     2060      'dbengine' => urlencode(DB_ENGINE),
     2061      'dbversion' => urlencode(pwg_get_db_version()),
     2062    );
     2063  }
     2064
     2065  return $details;
     2066}
    20652067?>
  • trunk/admin/include/languages.class.php

    r8083 r8084  
    206206    $versions_to_check = array();
    207207    $url = PEM_URL . '/api/get_version_list.php';
    208     if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result))
     208    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    209209    {
    210210      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
  • trunk/admin/include/plugins.class.php

    r8083 r8084  
    300300    $versions_to_check = array();
    301301    $url = PEM_URL . '/api/get_version_list.php';
    302     if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result))
     302    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    303303    {
    304304      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
  • trunk/admin/include/themes.class.php

    r8083 r8084  
    457457    $versions_to_check = array();
    458458    $url = PEM_URL . '/api/get_version_list.php';
    459     if (fetchRemote($url, $result, $get_data) and $pem_versions = @unserialize($result))
     459    if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
    460460    {
    461461      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
Note: See TracChangeset for help on using the changeset viewer.