Fix redirect on zone editing

pull/3087/head
Isaac Connor 2020-11-18 13:04:56 -05:00
parent 6542072334
commit cf08010ebe
2 changed files with 4 additions and 1 deletions

View File

@ -71,7 +71,9 @@ if ( !empty($_REQUEST['mid']) && canEdit('Monitors', $_REQUEST['mid']) ) {
$monitor->sendControlCommand('quit'); $monitor->sendControlCommand('quit');
} }
} // end if changes } // end if changes
$redirect = $_SERVER['HTTP_REFERER']; # HTTP_REFERER will typically be ?view=zone so no good.
# if a referer is passed in $_REQUEST then use it otherwise go to ?view=zones
$redirect = isset($_REQUEST['REFERER']) ? $_REQUEST['REFERER'] : '?view=zones';
} // end if action } // end if action
} // end if $mid and canEdit($mid) } // end if $mid and canEdit($mid)
?> ?>

View File

@ -131,6 +131,7 @@ xhtmlHeaders(__FILE__, translate('Zone'));
</div> </div>
<div id="content"> <div id="content">
<form name="zoneForm" id="zoneForm" method="post" action="?"> <form name="zoneForm" id="zoneForm" method="post" action="?">
<input type="hidden" name="REFERER" value="<?php echo $_SERVER['HTTP_REFERER'] ?>"/>
<input type="hidden" name="view" value="<?php echo $view ?>"/> <input type="hidden" name="view" value="<?php echo $view ?>"/>
<input type="hidden" name="action" value="zone"/> <input type="hidden" name="action" value="zone"/>
<input type="hidden" name="mid" value="<?php echo $mid ?>"/> <input type="hidden" name="mid" value="<?php echo $mid ?>"/>