Skip to content

Commit

Permalink
drop getAccessedIP and getWebService
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj committed Mar 19, 2018
1 parent 00b76fb commit f5210a9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 49 deletions.
12 changes: 0 additions & 12 deletions src/Linfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ public function scan()
'method' => 'getKernel',
),

'AccessedIP' => array(
'show' => !isset(Settings::getInstance()->getSettings()['show']['ip']) || !empty(Settings::getInstance()->getSettings()['show']['ip']),
'default' => '',
'method' => 'getAccessedIP',
),

'Distro' => array(
'show' => !empty(Settings::getInstance()->getSettings()['show']['distro']),
'default' => '',
Expand Down Expand Up @@ -224,12 +218,6 @@ public function scan()
'method' => 'getPhpVersion',
),

'webService' => array(
'show' => !empty(Settings::getInstance()->getSettings()['show']['webservice']),
'default' => false,
'method' => 'getWebService',
),

// Extra info such as which fields to not show
'contains' => array(
'show' => true,
Expand Down
26 changes: 9 additions & 17 deletions src/Meta/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,29 @@ public function getDefaultSettings()
{
$settings = array();

/*
* Usual configuration
*/
$settings['byte_notation'] = 1024; // Either 1024 or 1000; defaults to 1024
$settings['dates'] = 'm/d/y h:i A (T)'; // Format for dates shown. See php.net/date for syntax

/*
* Possibly don't show stuff
*/

// For certain reasons, some might choose to not display all we can
// Set these to true to enable; false to disable. They default to false.
$settings['show']['kernel'] = true;
$settings['show']['ip'] = true;
$settings['show']['os'] = true;
$settings['show']['load'] = true;
$settings['show']['ram'] = true;
$settings['show']['hd'] = true;
$settings['show']['mounts'] = true;
$settings['show']['mounts_options'] = true; // Might be useless/confidential information; disabled by default.
$settings['show']['webservice'] = false; // Might be dangerous/confidential information; disabled by default.
$settings['show']['phpversion'] = true; // Might be dangerous/confidential information; disabled by default.
$settings['show']['mounts_options'] = true;
$settings['show']['phpversion'] = true;
$settings['show']['network'] = true;
$settings['show']['uptime'] = true;
$settings['show']['cpu'] = true;
$settings['show']['process_stats'] = true;
$settings['show']['hostname'] = true;
$settings['show']['distro'] = true; # Attempt finding name and version of distribution on Linux systems
$settings['show']['devices'] = true; # Slow on old systems
$settings['show']['model'] = true; # Model of system. Supported on certain OS's. ex: Macbook Pro
$settings['show']['numLoggedIn'] = true; # Number of unqiue users with shells running (on Linux)
$settings['show']['virtualization'] = true; # whether this is a VPS/VM and what kind
$settings['show']['distro'] = true; // Attempt finding name and version of distribution on Linux systems
$settings['show']['devices'] = true; // Slow on old systems
$settings['show']['model'] = true; // Model of system. Supported on certain OS's. ex: Macbook Pro
$settings['show']['numLoggedIn'] = true; // Number of unqiue users with shells running (on Linux)
$settings['show']['virtualization'] = true; // whether this is a VPS/VM and what kind

// CPU Usage on Linux (per core and overall). This requires running sleep(1) once so it slows
// the entire page load down. Enable at your own inconvenience, especially since the load averages
Expand Down Expand Up @@ -109,7 +100,8 @@ public function getDefaultSettings()
$settings['hide']['filesystems'] = array(
'tmpfs', 'ecryptfs', 'nfsd', 'rpc_pipefs', 'proc', 'sysfs',
'usbfs', 'devpts', 'fusectl', 'securityfs', 'fuse.truecrypt',
'cgroup', 'debugfs', 'mqueue', 'hugetlbfs', 'pstore', 'rootfs', 'binfmt_misc'
'cgroup', 'debugfs', 'mqueue', 'hugetlbfs', 'pstore', 'rootfs',
'binfmt_misc',
);
$settings['hide']['storage_devices'] = array('gvfs-fuse-daemon', 'none', 'systemd-1', 'udev');

Expand Down
20 changes: 0 additions & 20 deletions src/OS/OS.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@

abstract class OS
{
/**
* getAccessedIP
*
* @return string SERVER_ADDR or LOCAL_ADDR key in $_SERVER superglobal or Unknown
*/
public function getAccessedIP()
{
return isset($_SERVER['SERVER_ADDR']) && $_SERVER['SERVER_ADDR'] ? $_SERVER['SERVER_ADDR'] : (isset($_SERVER['LOCAL_ADDR']) && $_SERVER['LOCAL_ADDR'] ? $_SERVER['LOCAL_ADDR'] : 'Unknown');
}

/**
* getWebService
*
* @return string SERVER_SOFTWARE key in $_SERVER superglobal or Unknown
*/
public function getWebService()
{
return isset($_SERVER['SERVER_SOFTWARE']) && $_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : 'Unknown';
}

/**
* getPhpVersion
*
Expand Down

0 comments on commit f5210a9

Please sign in to comment.