mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Fix coding style part 2
This commit is contained in:
@@ -13,36 +13,28 @@
|
||||
*/
|
||||
|
||||
// FUA
|
||||
|
||||
if(!is_numeric($_POST['config_id']))
|
||||
{
|
||||
echo('error with data');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($_POST['state'] == 'true')
|
||||
{
|
||||
$state = 1;
|
||||
}
|
||||
elseif($_POST['state'] == 'false')
|
||||
{
|
||||
$state = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$state = 0;
|
||||
}
|
||||
$update = dbUpdate(array('config_disabled' => $state), 'config', '`config_id` = ?', array($_POST['config_id']));
|
||||
if(!empty($update) || $update == '0')
|
||||
{
|
||||
echo('success');
|
||||
if (!is_numeric($_POST['config_id'])) {
|
||||
echo 'error with data';
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo('error');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($_POST['state'] == 'true') {
|
||||
$state = 1;
|
||||
}
|
||||
else if ($_POST['state'] == 'false') {
|
||||
$state = 0;
|
||||
}
|
||||
else {
|
||||
$state = 0;
|
||||
}
|
||||
|
||||
$update = dbUpdate(array('config_disabled' => $state), 'config', '`config_id` = ?', array($_POST['config_id']));
|
||||
if (!empty($update) || $update == '0') {
|
||||
echo 'success';
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
echo 'error';
|
||||
exit;
|
||||
}
|
||||
}//end if
|
||||
|
||||
Reference in New Issue
Block a user