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('