get($_SESSION['domain']['language']['code'], 'core/user_settings'); //system status echo "
\n"; $c = 0; $row_style['0'] = "row_style0"; $row_style['1'] = "row_style1"; //disk usage if (PHP_OS == 'FreeBSD' || PHP_OS == 'Linux') { $tmp = shell_exec("df / 2>&1"); $tmp = explode("\n", $tmp); $tmp = preg_replace('!\s+!', ' ', $tmp[1]); // multiple > single space $tmp = explode(' ', $tmp); foreach ($tmp as $stat) { if (substr_count($stat, '%') > 0) { $percent_disk_usage = rtrim($stat,'%'); break; } } if (!empty($percent_disk_usage)) { //add half doughnut chart echo "
\n"; echo " ".$text['label-disk_usage']."\n"; if (!isset($dashboard_chart_type) || $dashboard_chart_type == "doughnut") { ?>
".round($percent_disk_usage)."%"; } echo "
\n"; } } if ($dashboard_details_state != 'disabled') { echo "
"; echo "\n"; echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; //disk usage if (permission_exists('system_view_hdd')) { $system_information = []; if (stristr(PHP_OS, 'Linux') || stristr(PHP_OS, 'FreeBSD')) { $shell_result = shell_exec('df -hP'); if (!empty($shell_result)) { $lines = explode("\n",$shell_result); //name the columns $column_names = preg_split("/[\s,]+/", $lines[0]); $col_file_system = array_search('Filesystem', $column_names, true); //usually 0 $col_size = array_search('Size', $column_names, true); //usually 1 $col_used = array_search('Used', $column_names, true); //usually 2 $col_available = array_search('Avail', $column_names, true); //usually 3 $col_mount_point = array_search('Mounted', $column_names, true); //usually 5 but can be 4 //skip heading line by starting at 1 for ($i = 1; $i < count($lines); $i++) { $line = $lines[$i]; $columns = preg_split("/[\s,]+/", $line); $system_information['os']['disk'][$i-1]['file_system'] = $columns[$col_file_system]; $system_information['os']['disk'][$i-1][ 'size' ] = $columns[ $col_size ]; $system_information['os']['disk'][$i-1][ 'used' ] = $columns[ $col_used ]; $system_information['os']['disk'][$i-1][ 'available' ] = $columns[ $col_available ]; $system_information['os']['disk'][$i-1]['mount_point'] = $columns[$col_mount_point]; } } foreach ($system_information['os']['disk'] as $disk) { echo "\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "\n"; $c = ($c) ? 0 : 1; } } else if (stristr(PHP_OS, 'WIN')) { } } echo "
".($text['label-mount_point'] ?? 'Mount Point')."".($text['label-size'] ?? 'Size')."".($text['label-used'] ?? 'Used')."".($text['label-available'] ?? 'Available')."
\n"; echo "
"; //$n++; echo ""; } echo "
\n"; ?>