mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-09 14:55:25 +02:00
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 $conf['send_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. git-svn-id: http://piwigo.org/svn/branches/2.1@8086 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -196,13 +196,16 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
{
|
||||
global $user;
|
||||
|
||||
$pem_category_id = 8;
|
||||
$get_data = array(
|
||||
'category_id' => 8,
|
||||
'format' => 'php',
|
||||
);
|
||||
|
||||
// Retrieve PEM versions
|
||||
$version = PHPWG_VERSION;
|
||||
$versions_to_check = array();
|
||||
$url = PEM_URL . '/api/get_version_list.php?category_id='.$pem_category_id.'&format=php';
|
||||
if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
|
||||
$url = PEM_URL . '/api/get_version_list.php';
|
||||
if (fetchRemote($url, $result, $get_data, get_hosting_technical_details()) and $pem_versions = @unserialize($result))
|
||||
{
|
||||
if (!preg_match('/^\d+\.\d+\.\d+/', $version))
|
||||
{
|
||||
@@ -223,11 +226,15 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
}
|
||||
|
||||
// Retrieve PEM languages infos
|
||||
$url = PEM_URL . '/api/get_revision_list.php?category_id='.$pem_category_id.'&format=php&last_revision_only=true';
|
||||
$url .= '&version=' . implode(',', $versions_to_check);
|
||||
$url .= '&lang='.$user['language'];
|
||||
$url = PEM_URL . '/api/get_revision_list.php';
|
||||
$get_data = array_merge($get_data, array(
|
||||
'last_revision_only' => 'true',
|
||||
'version' => implode(',', $versions_to_check),
|
||||
'lang' => $user['language'],
|
||||
)
|
||||
);
|
||||
|
||||
if (fetchRemote($url, $result))
|
||||
if (fetchRemote($url, $result, $get_data))
|
||||
{
|
||||
$pem_languages = @unserialize($result);
|
||||
if (!is_array($pem_languages))
|
||||
@@ -258,10 +265,13 @@ UPDATE '.USER_INFOS_TABLE.'
|
||||
{
|
||||
if ($archive = tempnam( PHPWG_ROOT_PATH.'language', 'zip'))
|
||||
{
|
||||
$url = PEM_URL . '/download.php?rid=' . $revision;
|
||||
$url .= '&origin=piwigo_' . $action;
|
||||
$url = PEM_URL . '/download.php';
|
||||
$get_data = array(
|
||||
'rid' => $revision,
|
||||
'origin' => 'piwigo_'.$action,
|
||||
);
|
||||
|
||||
if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle))
|
||||
if ($handle = @fopen($archive, 'wb') and fetchRemote($url, $handle, $get_data))
|
||||
{
|
||||
fclose($handle);
|
||||
include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php');
|
||||
|
||||
Reference in New Issue
Block a user