diff --git a/app/system/system.php b/app/system/system.php index 0956ec6468..97d285f485 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -17,55 +17,63 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2017 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane James Rose */ -include "root.php"; -require_once "resources/require.php"; -require_once "resources/check_auth.php"; -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; -} + +//includes + include "root.php"; + require_once "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(); -require_once "resources/header.php"; -$document['title'] = $text['title-sys-status']; +//additional includes + require_once "resources/header.php"; + +//set the page title + $document['title'] = $text['title-sys-status']; // OS Support -// -// For each section below wrap in an OS detection statement like: -// if (stristr(PHP_OS, 'Linux')) {} -// -// Some possibilites for PHP_OS... -// -// CYGWIN_NT-5.1 -// Darwin -// FreeBSD -// HP-UX -// IRIX64 -// Linux -// NetBSD -// OpenBSD -// SunOS -// Unix -// WIN32 -// WINNT -// Windows -// + // + // For each section below wrap in an OS detection statement like: + // if (stristr(PHP_OS, 'Linux')) {} + // + // Some possibilites for PHP_OS... + // + // CYGWIN_NT-5.1 + // Darwin + // FreeBSD + // HP-UX + // IRIX64 + // Linux + // NetBSD + // OpenBSD + // SunOS + // Unix + // WIN32 + // WINNT + // Windows + // //system information echo "".$text['header-sys-status'].""; @@ -210,8 +218,8 @@ $document['title'] = $text['title-sys-status']; //linux if (stristr(PHP_OS, 'Linux')) { echo "\n"; if (strlen($shell_result) > 0) { echo "\n"; @@ -237,8 +245,8 @@ $document['title'] = $text['title-sys-status']; //freebsd if (stristr(PHP_OS, 'FreeBSD')) { echo "\n"; if (strlen($shell_result) > 0) { echo "
\n"; @@ -267,8 +275,8 @@ $document['title'] = $text['title-sys-status']; //linux if (stristr(PHP_OS, 'Linux')) { echo "\n"; if (strlen($shell_result) > 0) { echo "
\n"; @@ -282,7 +290,7 @@ $document['title'] = $text['title-sys-status']; echo "
\n"; echo "
\n";
 
-				//$last_line = shell_exec($shellcmd, $shell_result);
+				//$last_line = shell_exec($shell_cmd, $shell_result);
 				//foreach ($shell_result as $value) {
 				//	echo substr($value, 0, 100);
 				//	echo "
"; @@ -302,8 +310,8 @@ $document['title'] = $text['title-sys-status']; //freebsd if (stristr(PHP_OS, 'FreeBSD')) { echo "\n"; if (strlen($shell_result) > 0) { echo "\n"; @@ -331,8 +339,8 @@ $document['title'] = $text['title-sys-status']; if (permission_exists('system_view_hdd')) { if (stristr(PHP_OS, 'Linux') || stristr(PHP_OS, 'FreeBSD')) { echo "\n"; echo "
\n"; echo "\n"; @@ -353,10 +361,10 @@ $document['title'] = $text['title-sys-status']; //disk_free_space returns the number of bytes available on the drive; //1 kilobyte = 1024 byte //1 megabyte = 1024 kilobyte - $driveletter = substr($_SERVER["DOCUMENT_ROOT"], 0, 2); - $disksize = round(disk_total_space($driveletter)/1024/1024, 2); - $disksizefree = round(disk_free_space($driveletter)/1024/1024, 2); - $diskpercentavailable = round(($disksizefree/$disksize) * 100, 2); + $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"; @@ -367,7 +375,7 @@ $document['title'] = $text['title-sys-status']; echo " ".$text['label-drive-capacity']." \n"; echo " \n"; echo " \n"; echo "\n"; @@ -376,7 +384,7 @@ $document['title'] = $text['title-sys-status']; echo " ".$text['label-drive-free']." \n"; echo " \n"; echo " \n"; echo "\n"; @@ -385,7 +393,7 @@ $document['title'] = $text['title-sys-status']; echo " ".$text['label-drive-percent']." \n"; echo " \n"; echo " \n"; echo "\n"; echo "
\n"; - echo " $disksize mb\n"; + echo " $disk_size mb\n"; echo "
\n"; - echo " $disksizefree mb\n"; + echo " $disk_size_free mb\n"; echo "
\n"; - echo " $diskpercentavailable% \n"; + echo " $disk_percent_available% \n"; echo "
\n"; @@ -441,11 +449,7 @@ $document['title'] = $text['title-sys-status']; echo "

\n"; } -//backup - if (permission_exists('zzz') && $db_type == 'sqlite') { - require_once "core/backup/backupandrestore.php"; - } - //include the footer require_once "resources/footer.php"; + ?>