aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-12-07 12:40:09 +0000
committerpatdenice <patdenice@piwigo.org>2010-12-07 12:40:09 +0000
commit2f144d33fa14a065b7d32a4f9f8f3c010f60518f (patch)
treea5f79caf329840e44f6c5261a5d7b1ddd8b5f604 /admin/include
parent20837a876e7a0efa76fc0e937203782262e4d257 (diff)
merge r8020 from trunk to branch 2.1
Feature 2048: Send data to piwigo server anonymously (like php and mysql versions) git-svn-id: http://piwigo.org/svn/branches/2.1@8021 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 3c5e9c77d..47574166f 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1701,6 +1701,23 @@ function fetchRemote($src, &$dest, $user_agent='Piwigo', $step=0)
}
}
+ // Send anonymous data to piwigo server
+ if ($_SERVER['HTTP_HOST'] != 'localhost' and $step==0
+ and preg_match('#^http://(?:[a-z]+\.)?piwigo\.org#', $src))
+ {
+ global $conf;
+
+ $src = add_url_params($src, array(
+ 'uuid' => hash_hmac('md5', get_absolute_root_url(), $conf['secret_key']),
+ 'os' => urlencode(PHP_OS),
+ 'phpversion' => urlencode(phpversion()),
+ 'dbengine' => urlencode(DB_ENGINE),
+ 'dbversion' => urlencode(pwg_get_db_version()),
+ )
+ );
+ $src = str_replace('&amp;', '&', $src);
+ }
+
// After 3 redirections, return false
if ($step > 3) return false;