fix apps page, stupid array()

git-svn-id: http://www.observium.org/svn/observer/trunk@2369 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-26 20:26:01 +00:00
parent 305d25eb8e
commit 3b95c74add
2 changed files with 8 additions and 7 deletions
+3 -3
View File
@@ -22,19 +22,19 @@ if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/"
if ($_POST['device'])
{
$updated = 0;
$param = array($device['device_id']);
$param[] = array($device['device_id']);
foreach (array_keys($_POST) as $key)
{
if (substr($key,0,4) == 'app_')
{
$param[] = substr($key,4);
$enabled[] = substr($key,4);
$query[] = "?";
$replace[] = "?";
}
}
if(count($enabled)) {
$updated += dbDelete('applications', "`device_id` = ? AND `app_type` NOT IN (".implode(',',$query).")", array($param));
$updated += dbDelete('applications', "`device_id` = ? AND `app_type` NOT IN (".implode(",",$replace).")", $param);
} else {
$updated += dbDelete('applications', "`device_id` = ?", array($param));
}