Skip to content

Commit cea6212

Browse files
authored
Fixing managers actions not taking action (#6901)
1 parent 136ae6e commit cea6212

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

managers.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,14 +818,19 @@ function highlightStatus(selectID) {
818818
if ($item['description']) {
819819
$description = '';
820820
$lines = preg_split( '/\r\n|\r|\n/', $item['description']);
821+
821822
foreach($lines as $line) {
822823
$description .= html_escape(trim($line)) . '<br>';
823824
}
825+
824826
print '<td><a href="#" onMouseOut="hideTooltip(snmpagentTooltip)" onMouseMove="showTooltip(event, snmpagentTooltip, \'' . $item['notification'] . '\', \'' . $description . '\')">' . $item['notification'] . '</a></td>';
825827
} else {
828+
826829
print "<td>{$item['notification']}</td>";
827830
}
831+
828832
print "<td>$varbinds</td>";
833+
829834
form_end_row();
830835
}
831836
} else {
@@ -845,7 +850,9 @@ function highlightStatus(selectID) {
845850
}
846851

847852
function form_save() {
848-
if (!isset_request_var('tab')) set_request_var('tab', 'general');
853+
if (!isset_request_var('tab')) {
854+
set_request_var('tab', 'general');
855+
}
849856

850857
/* ================= input validation ================= */
851858
get_filter_request_var('id');
@@ -915,7 +922,7 @@ function form_actions() {
915922

916923
if (isset_request_var('selected_items')) {
917924
if (isset_request_var('action_receivers')) {
918-
$selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_graphs_array'));
925+
$selected_items = sanitize_unserialize_selected_items(get_nfilter_request_var('selected_items'));
919926

920927
if ($selected_items !== false) {
921928
$ids = implode(',', array_map('intval', $selected_items));
@@ -930,7 +937,8 @@ function form_actions() {
930937
db_execute("UPDATE snmpagent_managers SET disabled = 'on' WHERE id IN (" . $ids . ')');
931938
}
932939

933-
header('Location: managers.php?header=false');
940+
header('Location: managers.php');
941+
934942
exit;
935943
}
936944
} elseif (isset_request_var('action_receiver_notifications')) {
@@ -1020,7 +1028,7 @@ function form_actions() {
10201028
<input type='hidden' name='drp_action' value='" . html_escape(get_nfilter_request_var('drp_action')) . "'>
10211029
$save_html
10221030
</td>
1023-
</tr>\n";
1031+
</tr>";
10241032

10251033
html_end_box();
10261034

@@ -1068,7 +1076,7 @@ function form_actions() {
10681076

10691077
$save_html = "<input type='button' class='ui-button ui-corner-all ui-widget' value='" . __esc('Cancel') . "' onClick='cactiReturnTo()'>&nbsp;<input type='submit' class='ui-button ui-corner-all ui-widget' value='" . __esc('Continue') . "' title='" . __esc('Disable Notification Objects') . "'>";
10701078
} else {
1071-
print "<tr><td><span class='textError'>" . __('You must select at least one notification object.') . "</span></td></tr>\n";
1079+
print "<tr><td><span class='textError'>" . __('You must select at least one notification object.') . "</span></td></tr>";
10721080
$save_html = "<input type='button' class='ui-button ui-corner-all ui-widget' value='" . __esc('Return') . "' onClick='cactiReturnTo()'>";
10731081
}
10741082

0 commit comments

Comments
 (0)