diff --git a/html/includes/app-add.inc.php b/html/includes/app-add.inc.php deleted file mode 100644 index 63daa0838..000000000 --- a/html/includes/app-add.inc.php +++ /dev/null @@ -1,15 +0,0 @@ -" - - -?> diff --git a/html/includes/app-delete.inc.php b/html/includes/app-delete.inc.php deleted file mode 100644 index 1b026c7b7..000000000 --- a/html/includes/app-delete.inc.php +++ /dev/null @@ -1,15 +0,0 @@ -" - - -?> diff --git a/html/pages/device/edit/apps.inc.php b/html/pages/device/edit/apps.inc.php index f4c9eb9ee..6fd482b9f 100644 --- a/html/pages/device/edit/apps.inc.php +++ b/html/pages/device/edit/apps.inc.php @@ -1,102 +1,108 @@ '); -if($_POST['addapp']) { - if($_SESSION['userlevel'] == '10') { - include("includes/app-add.inc.php"); +if (mysql_result(mysql_query("SELECT COUNT(*) from `applications` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') +{ + $app_query = mysql_query("select * from applications WHERE device_id = '".$device['device_id']."' ORDER BY app_type"); + while ($application = mysql_fetch_assoc($app_query)) + { + $app_enabled[] = $application['app_type']; } } -if($_POST['delapp']) { - if($_SESSION['userlevel'] == '10') { - include("includes/app-delete.inc.php"); - } -} - -if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/")) { - while (false !== ($file = readdir($handle))) { - if ($file != "." && $file != ".." && strstr($file, ".inc.php")) { - $file = str_replace(".inc.php", "", $file); - $applicationsform .= ""; - } - } - closedir($handle); -} - -$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`"); -while($device = mysql_fetch_array($query)) { - $devicesform .= ""; -} - -if($updated) { print_message("Applications Updated"); } - -if(mysql_result(mysql_query("SELECT COUNT(*) from `applications` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') { - $i = "1"; - $app_query = mysql_query("select * from applications WHERE device_id = '".$device['device_id']."' ORDER BY app_type"); - while($application = mysql_fetch_array($app_query)) { - $existform .= ""; - } - -} - -if($existform){ -echo('
'); -echo(" - -

Remove application

- -
- - - - - +echo("
+ + +
- Type - - -
+ + + -
EnableApplication
- - -
"); +"); +$row = 1; -echo('
'); +foreach ($applications as $app) +{ + if (is_integer($row/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } + + echo(" "); + echo(" "); + echo(" "); + echo(" "); + echo(" ". ucfirst($app) . ""); + echo(" +"); + + $row++; } -echo('
'); - -echo(" -

Add application

- -
- - - - - - -
- Type - - -
- - -
"); - +echo(''); +echo(''); +echo(''); echo('
'); -echo(''); - -?> +?> \ No newline at end of file diff --git a/html/pages/device/edit/ipmi.inc.php b/html/pages/device/edit/ipmi.inc.php index 962dde5c0..77e32d1ea 100644 --- a/html/pages/device/edit/ipmi.inc.php +++ b/html/pages/device/edit/ipmi.inc.php @@ -8,7 +8,6 @@ if ($_POST['editing']) } } -$device = mysql_fetch_assoc(mysql_query("SELECT * FROM `devices` WHERE `device_id` = '".$device['device_id']."'")); $descr = $device['purpose']; if ($updated && $update_message)