From dfa1158a9be0207ea2a9fd12cbc7324a224086b7 Mon Sep 17 00:00:00 2001 From: donal Date: Fri, 15 Feb 2008 08:04:20 +0000 Subject: [PATCH] Remove unneeded mnet_host2service records --- admin/mnet/mnet_services.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/mnet/mnet_services.php b/admin/mnet/mnet_services.php index 2af3e99876..dddff86b33 100644 --- a/admin/mnet/mnet_services.php +++ b/admin/mnet/mnet_services.php @@ -48,7 +48,14 @@ $publish = (isset($_POST['publish'][$key]) && $_POST['publish'][$key] == 'on')? 1 : 0; $subscribe = (isset($_POST['subscribe'][$key]) && $_POST['subscribe'][$key] == 'on')? 1 : 0; - if (false == $host2service && ($publish == 1 || $subscribe == 1)) { + if ($publish != 1 && $subscribe != 1) { + if (false == $host2service) { + // We don't have or need a record - do nothing! + } else { + // We don't need the record - delete it + delete_records('mnet_host2service', 'hostid', $_POST['hostid'], 'serviceid', $key); + } + } elseif (false == $host2service && ($publish == 1 || $subscribe == 1)) { $host2service = new stdClass(); $host2service->hostid = $_POST['hostid']; $host2service->serviceid = $key; -- 2.39.5