Permalink
Browse files

anonymize server information

  • Loading branch information...
1 parent f85e80b commit f58590f33f31e09b9b707345abf98e004cfaa05a @haraldpdl haraldpdl committed Aug 29, 2010
Showing with 5 additions and 21 deletions.
  1. +2 −18 catalog/admin/includes/functions/general.php
  2. +3 −3 catalog/admin/server_info.php
View
20 catalog/admin/includes/functions/general.php
@@ -805,7 +805,7 @@ function tep_mod_select_option($select_array, $key_name, $key_value) {
////
// Retreive server information
- function tep_get_system_information($anonymous = false) {
+ function tep_get_system_information() {
global $HTTP_SERVER_VARS;
$db_query = tep_db_query("select now() as datetime");
@@ -820,18 +820,14 @@ function tep_get_system_information($anonymous = false) {
$data['system'] = array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
'os' => PHP_OS,
'kernel' => $kernel,
- 'host' => $host,
'uptime' => @exec('uptime'),
- 'ip' => gethostbyname($host),
'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE']);
$data['mysql'] = array('version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),
- 'server' => DB_SERVER,
- 'ip' => gethostbyname(DB_SERVER),
'date' => tep_datetime_short($db['datetime']));
$data['php'] = array('version' => PHP_VERSION,
- 'zend' => (function_exists('zend_version') ? zend_version() : ''),
+ 'zend' => zend_version(),
'sapi' => PHP_SAPI,
'int_size' => defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '',
'safe_mode' => (int) @ini_get('safe_mode'),
@@ -855,18 +851,6 @@ function tep_get_system_information($anonymous = false) {
'zend_thread_safty' => (int) function_exists('zend_thread_id'),
'extensions' => get_loaded_extensions());
- // If we need anonymous data we need to remove some data which could
- // potentially be used to identify a particular installation. An MD5 hash
- // is used purely to identify duplicate submissions
- if ($anonymous === true) {
- $data['system']['host'] = md5($data['system']['ip']);
- $data['system']['ip'] = '0.0.0.0';
- $data['system']['uptime'] = '0';
-
- $data['mysql']['server'] = '';
- $data['mysql']['ip'] = '';
- }
-
return $data;
}
View
6 catalog/admin/server_info.php
@@ -16,14 +16,14 @@
switch ($action) {
case 'export':
- $info = tep_get_system_information(true);
+ $info = tep_get_system_information();
break;
case 'submit':
$target_host = 'www.oscommerce.com';
$target_path = '/usage_info.php';
- $encoded = base64_encode(serialize(tep_get_system_information(true)));
+ $encoded = base64_encode(serialize(tep_get_system_information()));
$response = false;
@@ -70,7 +70,7 @@
break;
case 'save':
- $info = tep_get_system_information(true);
+ $info = tep_get_system_information();
$info_file = 'server_info-' . date('YmdHis') . '.txt';
header('Content-type: text/plain');
header('Content-disposition: attachment; filename=' . $info_file);

0 comments on commit f58590f

Please sign in to comment.