Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

anonymize server information

  • Loading branch information...
commit f58590f33f31e09b9b707345abf98e004cfaa05a 1 parent f85e80b
Harald Ponce de Leon authored
20  catalog/admin/includes/functions/general.php
@@ -805,7 +805,7 @@ function tep_mod_select_option($select_array, $key_name, $key_value) {
805 805
 
806 806
 ////
807 807
 // Retreive server information
808  
-  function tep_get_system_information($anonymous = false) {
  808
+  function tep_get_system_information() {
809 809
     global $HTTP_SERVER_VARS;
810 810
 
811 811
     $db_query = tep_db_query("select now() as datetime");
@@ -820,18 +820,14 @@ function tep_get_system_information($anonymous = false) {
820 820
     $data['system'] = array('date' => tep_datetime_short(date('Y-m-d H:i:s')),
821 821
                             'os' => PHP_OS,
822 822
                             'kernel' => $kernel,
823  
-                            'host' => $host,
824 823
                             'uptime' => @exec('uptime'),
825  
-                            'ip' => gethostbyname($host),
826 824
                             'http_server' => $HTTP_SERVER_VARS['SERVER_SOFTWARE']);
827 825
 
828 826
     $data['mysql']  = array('version' => 'MySQL ' . (function_exists('mysql_get_server_info') ? mysql_get_server_info() : ''),
829  
-                            'server' => DB_SERVER,
830  
-                            'ip' => gethostbyname(DB_SERVER),
831 827
                             'date' => tep_datetime_short($db['datetime']));
832 828
 
833 829
     $data['php']    = array('version' => PHP_VERSION,
834  
-                            'zend' => (function_exists('zend_version') ? zend_version() : ''),
  830
+                            'zend' => zend_version(),
835 831
                             'sapi' => PHP_SAPI,
836 832
                             'int_size'	=> defined('PHP_INT_SIZE') ? PHP_INT_SIZE : '',
837 833
                             'safe_mode'	=> (int) @ini_get('safe_mode'),
@@ -855,18 +851,6 @@ function tep_get_system_information($anonymous = false) {
855 851
                             'zend_thread_safty'	=> (int) function_exists('zend_thread_id'),
856 852
                             'extensions' => get_loaded_extensions());
857 853
 
858  
-    // If we need anonymous data we need to remove some data which could
859  
-    // potentially be used to identify a particular installation. An MD5 hash
860  
-    // is used purely to identify duplicate submissions
861  
-    if ($anonymous === true) {
862  
-        $data['system']['host'] = md5($data['system']['ip']);
863  
-        $data['system']['ip'] = '0.0.0.0';
864  
-        $data['system']['uptime'] = '0';
865  
-
866  
-        $data['mysql']['server'] = '';
867  
-        $data['mysql']['ip']  = '';
868  
-    }
869  
-
870 854
     return $data;
871 855
   }
872 856
 
6  catalog/admin/server_info.php
@@ -16,14 +16,14 @@
16 16
 
17 17
   switch ($action) {
18 18
     case 'export':
19  
-      $info = tep_get_system_information(true);
  19
+      $info = tep_get_system_information();
20 20
     break;
21 21
 
22 22
     case 'submit':
23 23
       $target_host = 'www.oscommerce.com';
24 24
       $target_path = '/usage_info.php';
25 25
 
26  
-      $encoded = base64_encode(serialize(tep_get_system_information(true)));
  26
+      $encoded = base64_encode(serialize(tep_get_system_information()));
27 27
 
28 28
       $response = false;
29 29
 
@@ -70,7 +70,7 @@
70 70
     break;
71 71
 
72 72
     case 'save':
73  
-      $info = tep_get_system_information(true);
  73
+      $info = tep_get_system_information();
74 74
       $info_file = 'server_info-' . date('YmdHis') . '.txt';
75 75
       header('Content-type: text/plain');
76 76
       header('Content-disposition: attachment; filename=' . $info_file);

0 notes on commit f58590f

Please sign in to comment.
Something went wrong with that request. Please try again.