Portions created by the Initial Developer are Copyright (C) 2008-2024 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ //includes files require_once dirname(__DIR__, 2) . "/resources/require.php"; require_once "resources/check_auth.php"; //check permissions if (permission_exists('system_view_info') || permission_exists('system_view_cpu') || permission_exists('system_view_hdd') || permission_exists('system_view_ram') || permission_exists('system_view_backup')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support $language = new text; $text = $language->get(); //load editor preferences/defaults if (permission_exists("system_view_support")) { $setting_size = !empty($_SESSION["editor"]["font_size"]["text"]) ? $_SESSION["editor"]["font_size"]["text"] : '12px'; $setting_theme = !empty($_SESSION["editor"]["theme"]["text"]) ? $_SESSION["editor"]["theme"]["text"] : 'cobalt'; $setting_invisibles = isset($_SESSION['editor']['invisibles']['text']) ? $_SESSION['editor']['invisibles']["text"] : 'false'; $setting_indenting = isset($_SESSION['editor']['indent_guides']['text']) ? $_SESSION['editor']['indent_guides']["text"]: 'false'; $setting_numbering = isset($_SESSION['editor']['line_numbers']['text']) ? $_SESSION['editor']['line_numbers']["text"] : 'true'; } //additional includes require_once "resources/header.php"; require_once 'app/system/resources/functions/system_information.php'; //ace editor helpers if (permission_exists("system_view_support")) { echo ""; echo "\n"; echo "\n"; } //Load an array of system information $system_information = system_information(); //set the page title $document['title'] = $text['title-sys-status']; //system information echo "".$text['header-sys-status'].""; echo "

"; echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; if (permission_exists('system_view_info')) { echo "\n"; echo " \n"; echo " \n"; echo "\n"; $git_path = $system_information['git']['path']; if (file_exists($git_path)){ if ($system_information['git']['status'] === 'unknown') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } else { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } } echo "\n"; echo " \n"; echo " \n"; echo "\n"; if ($system_information['switch']['version'] !== 'connection failed') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; if ($system_information['switch']['git']['info'] !== 'connection failed') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } } echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-sys-info']."
\n"; echo " ".$text['label-version']."\n"; echo " \n"; echo " ".$system_information['version']."\n"; echo "
\n"; echo " ".$text['label-git_info']."\n"; echo " \n"; echo " ".$text['label-git_corrupted']."\n"; echo "
\n"; echo " ".$text['label-git_info']."\n"; echo " \n"; echo " ".$text['label-git_branch'].": ".$system_information['git']['branch']."
\n"; echo " ".$text['label-git_commit'].": ".$system_information['git']['commit']."
\n"; echo " ".$text['label-git_origin'].": ".$system_information['git']['origin']."
\n"; echo " ".$text['label-git_status'].": ".$system_information['git']['status'].($system_information['git']['age'])->format(' %R%a days ago')."
\n"; echo "
\n"; echo " ".$text['label-path']."\n"; echo " \n"; echo " ".$_SERVER['PROJECT_ROOT']."\n"; echo "
\n"; echo " ".$text['label-switch']." ".$text['label-version']."\n"; echo " {$system_information['switch']['version']} ({$system_information['switch']['bits']})
\n"; echo " ".$text['label-switch']." ".$text['label-git_info']."\n"; echo " {$system_information['switch']['git']['info']}
\n"; echo " ".$text['label-php']." ".$text['label-version']."\n"; echo " ".$system_information['php']['version']."
\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; if ($system_information['os']['name'] !== 'permission denied') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } if ($system_information['os']['version'] !== 'permission denied') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } if (!empty($system_information['os']['kernel'])) { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } if ($system_information['os']['uptime'] !== 'unknown') { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } } echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-os-info']."
\n"; echo " ".$text['label-os']." \n"; echo " \n"; echo " ".$system_information['os']['name']." \n"; echo "
\n"; echo " ".$text['label-version']." \n"; echo " \n"; echo " ".$system_information['os']['version']." \n"; echo "
\n"; echo " ".$text['label-kernel']." \n"; echo " \n"; echo " ".$system_information['os']['kernel']." \n"; echo "
\n"; echo " Uptime\n"; echo " \n"; echo " ".$system_information['os']['uptime']." \n"; echo "
\n"; echo " Date\n"; echo " \n"; echo " ".$system_information['os']['date']." \n"; echo "
\n"; echo "
\n"; //memory information if (permission_exists('system_view_ram')) { if ($system_information['os']['mem'] !== 'unknown' && $system_information['os']['mem'] !== 'permission denied') { echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-mem']."
\n"; echo " ".$text['label-mem']."\n"; echo " \n"; echo "
\n";
			echo "{$system_information['os']['mem']}
"; echo "
\n"; echo "
\n"; echo "
\n"; } } //cpu information if (permission_exists('system_view_cpu')) { if ($system_information['os']['cpu'] !== 'unknown' && $system_information['os']['cpu'] !== 'permission denied') { echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-cpu']."
\n"; echo " ".$text['label-cpu']."\n"; echo " \n"; echo "
\n";
			echo "{$system_information['os']['cpu']}
"; echo "
\n"; echo "
\n"; echo "
\n"; } } //drive space if (permission_exists('system_view_hdd')) { if (stristr(PHP_OS, 'Linux') || stristr(PHP_OS, 'FreeBSD')) { echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-drive']."
\n"; echo " ".$text['label-drive']." \n"; echo " \n"; echo "
\n";
			echo "{$system_information['os']['disk']['size']}
"; echo "
\n"; echo "
\n"; echo "
\n"; } else if (stristr(PHP_OS, 'WIN')) { //disk_free_space returns the number of bytes available on the drive; //1 kilobyte = 1024 byte //1 megabyte = 1024 kilobyte $drive_letter = substr($_SERVER["DOCUMENT_ROOT"], 0, 2); $disk_size = round(disk_total_space($drive_letter)/1024/1024, 2); $disk_size_free = round(disk_free_space($drive_letter)/1024/1024, 2); $disk_percent_available = round(($disk_size_free/$disk_size) * 100, 2); echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['label-drive']."
\n"; echo " ".$text['label-drive-capacity']." \n"; echo " \n"; echo " {$system_information['os']['disk']['size']} mb\n"; echo "
\n"; echo " ".$text['label-drive-free']." \n"; echo " \n"; echo " {$system_information['os']['disk']['free']} mb\n"; echo "
\n"; echo " ".$text['label-drive-percent']." \n"; echo " \n"; echo " {$system_information['os']['disk']['available']}% \n"; echo "
\n"; echo "
\n"; } } //database information if (permission_exists('system_view_database')) { if ($system_information['database']['type'] == 'pgsql') { echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "
".$text['title-database']."
\n"; echo " ".$text['label-version']." \n"; echo " \n"; echo " ".$system_information['database']['version']."
\n"; echo "
\n"; echo " ".$text['label-database_connections']." \n"; echo " \n"; echo " ".$system_information['database']['connections']."
\n"; echo "
\n"; echo " ".$text['label-databases']." \n"; echo " \n"; echo " \n"; echo " \n"; foreach ($system_information['database']['sizes'] as $datname => $size) { echo " \n"; } echo "
". $text['label-name'] ." ". $text['label-size'] ."
".$datname ." ". $size ."
\n"; echo "
\n"; echo "
\n"; } } //memcache information if (permission_exists("system_view_memcache") && file_exists($_SERVER["PROJECT_ROOT"]."/app/sip_status/app_config.php")){ echo "
\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; if ($system_information['memcache'] !== 'none' && $system_information['memcache'] !== 'permission denied or unavailable') { if (is_array($system_information['memcache']) && sizeof($system_information['memcache']) > 0) { foreach($system_information['memcache'] as $memcache_field => $memcache_value) { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } } } else { echo "\n"; echo " \n"; echo " \n"; echo "\n"; } echo "
".$text['title-memcache']."
".$memcache_field."".$memcache_value."
".$text['label-memcache_status']."".$text['message-unavailable']."
\n"; echo "
\n"; } if (permission_exists("system_view_support")) { echo "
\n"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo "\n"; echo "\n"; echo " \n"; echo "\n"; echo "
".$text['label-support']."\n"; echo " \n"; echo "
\n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo " \n"; $themes['Light']['chrome']= 'Chrome'; $themes['Light']['clouds']= 'Clouds'; $themes['Light']['crimson_editor']= 'Crimson Editor'; $themes['Light']['dawn']= 'Dawn'; $themes['Light']['dreamweaver']= 'Dreamweaver'; $themes['Light']['eclipse']= 'Eclipse'; $themes['Light']['github']= 'GitHub'; $themes['Light']['iplastic']= 'IPlastic'; $themes['Light']['solarized_light']= 'Solarized Light'; $themes['Light']['textmate']= 'TextMate'; $themes['Light']['tomorrow']= 'Tomorrow'; $themes['Light']['xcode']= 'XCode'; $themes['Light']['kuroir']= 'Kuroir'; $themes['Light']['katzenmilch']= 'KatzenMilch'; $themes['Light']['sqlserver']= 'SQL Server'; $themes['Dark']['ambiance']= 'Ambiance'; $themes['Dark']['chaos']= 'Chaos'; $themes['Dark']['clouds_midnight']= 'Clouds Midnight'; $themes['Dark']['cobalt']= 'Cobalt'; $themes['Dark']['idle_fingers']= 'idle Fingers'; $themes['Dark']['kr_theme']= 'krTheme'; $themes['Dark']['merbivore']= 'Merbivore'; $themes['Dark']['merbivore_soft']= 'Merbivore Soft'; $themes['Dark']['mono_industrial']= 'Mono Industrial'; $themes['Dark']['monokai']= 'Monokai'; $themes['Dark']['pastel_on_dark']= 'Pastel on dark'; $themes['Dark']['solarized_dark']= 'Solarized Dark'; $themes['Dark']['terminal']= 'Terminal'; $themes['Dark']['tomorrow_night']= 'Tomorrow Night'; $themes['Dark']['tomorrow_night_blue']= 'Tomorrow Night Blue'; $themes['Dark']['tomorrow_night_bright']= 'Tomorrow Night Bright'; $themes['Dark']['tomorrow_night_eighties']= 'Tomorrow Night 80s'; $themes['Dark']['twilight']= 'Twilight'; $themes['Dark']['vibrant_ink']= 'Vibrant Ink'; echo " \n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; } //include the footer require_once "resources/footer.php"; ?>