Permalink
Browse files

Define variables, reduce error log

  • Loading branch information...
NEMS Linux
NEMS Linux committed Jan 7, 2019
1 parent dcb88c9 commit 7bdc12b88ff5361eddefc2414aeeb7c8a864d206
Showing with 11 additions and 4 deletions.
  1. +8 −1 config/index.php
  2. +3 −3 inc/functions.php
@@ -40,6 +40,13 @@
$uploaddir = '/var/www/html/userfiles/';
// define variables
$v=1;
while ($v<=32) {
${'USER' . $v} = '';
$v++;
}
// Nagios config
if (ver('nems') < 1.4) {
# LEGACY VERSION
@@ -193,7 +200,7 @@ function sanitize($string) {
$drivestmp = json_decode($drivestmp, true);
if (is_array($drivestmp['blockdevices']) && count($drivestmp['blockdevices']) > 0) {
foreach ($drivestmp['blockdevices'] as $blockdevice) {
if (is_array($blockdevice['children']) && count($blockdevice['children']) > 0) {
if (isset($blockdevice['children']) && is_array($blockdevice['children']) && count($blockdevice['children']) > 0) {
foreach ($blockdevice['children'] as $partition) {
if ($partition['fstype'] != 'swap' && $partition['mountpoint'] != '/boot') {
$partitions['usable'][$partition['uuid']] = $partition;
@@ -30,9 +30,9 @@ function ver($product='nems') {
$nems_branch_avail = $tmp[0] . '.' . $tmp[1];
return trim($nems_branch_avail);
break;
case 'nagios': // /usr/sbin/nagios3 --version
return '3.5.1'; // is this used anywhere?! If yes, need to fix this as it's completely wrong.
break;
// case 'nagios': // /usr/sbin/nagios3 --version
// return '3.5.1'; // is this used anywhere?! If yes, need to fix this as it's completely wrong.
// break;
case 'platform': // which platform is this for
$platform->num = trim(shell_exec('/usr/local/share/nems/nems-scripts/info.sh platform'));
// $platform = json_decode(file_get_contents('https://nemslinux.com/api/platform/' . $platform_num, false, stream_context_create($arrContextOptions)));

0 comments on commit 7bdc12b

Please sign in to comment.