Project

General

Profile

« Previous | Next » 

Revision ade65176

Added by Stephen Beaver about 10 years ago

Fixed "Save" action

View differences:

usr/local/www/firewall_shaper_layer7.php
63 63
$pgtitle = array(gettext("Firewall"),gettext("Traffic Shaper"), gettext("Layer7"));
64 64
$shortcut_section = "trafficshaper";
65 65

  
66
$default_layer7shaper_msg = '<br />' . gettext('You can add new layer7 protocol patterns by simply uploading the file') . ' <a href="diag_patterns.php">' . gettext('here') . '</a>';
66
$default_layer7shaper_msg = '<br />' .
67
							gettext('You can add new layer7 protocol patterns by simply uploading the file') .
68
							' <a href="diag_patterns.php">' . gettext('here') . '</a>';
67 69

  
68 70
read_layer7_config();
69 71

  
......
119 121
}
120 122

  
121 123
//add a new l7rules container
122
else if ($_POST) {
124
if ($_POST) {
123 125
	$show_proto_form = true;
124 126
	unset($input_errors);
125 127

  
126
	if($_POST['submit']) {
128
	if($_POST['Submit']) {
129

  
127 130
		if (isset($layer7_rules_list[$name])) {
128 131
			$l7r = $layer7_rules_list[$name];
129 132
			$_POST['divert_port'] = $l7r->GetRPort();
......
217 220
		$show_proto_form = false;
218 221
	}
219 222
}
220
else {
223

  
224
if(!$_GET && !$_POST) {
221 225
	$show_proto_form = false;
222 226
	$dfltmsg = true;
223 227
}
......
231 235

  
232 236
$tree .= "</ul>";
233 237

  
234
$closehead = false;
235 238
include("head.inc");
236 239
?>
237 240

  
......
243 246
var initial_count = new Array();
244 247
var rows_limit = 0; // Set to 0 to disable limitation
245 248

  
246

  
247 249
/* Build the behaviours arrays in javascript */
248 250
var js_behaviours_action = ['block']; //static
249 251

  
......
327 329
/* Change the values on behaviours select when changing the structure row */
328 330
function changeBehaviourValues(row) {
329 331

  
330
	var selectedRow = row.rowIndex - 1; // The header is counted as row 0
332
	var selectedRow = row.rowIndex - 1; // The header is counted as the first row
331 333
	var structureSelected = document.getElementsByName("structure[]")[selectedRow].value;
332 334

  
333 335
	//Select the behaviours values to array a_behav
......
402 404
</script>
403 405

  
404 406
<?php
405
// This function create a table of rule selectors which are then inserted into the form
406
// using a StaticText class
407
// This function creates a table of rule selectors which are then inserted into the form
408
// using a StaticText class. While not pretty this maintains compatibility with all of
409
// the above javascript
407 410

  
408 411
function build_l7table() {
409 412
	global $container, $avail_protos, $avail_structures, $avail_behaviours_altq, $avail_behaviours_limiter,
410 413
		   $avail_behaviours_action;
411 414

  
412
	$tbl = '<table id="newtbl" name="netbl" class="table table-hover table-condensed">';
415
	$tbl = '<table id="newtbl" class="table table-hover table-condensed">'; // No stripes for this table
413 416
	$tbl .= '<thead><tr><th>Protocol</th><th>Structure</th><th>Behavior</th></tr></thead>';
414 417
	$tbl .= '<tbody>';
415 418

  
......
566 569
					<?=$tree?>
567 570
					<br />
568 571
					<a href="firewall_shaper_layer7.php?action=add" class="btn btn-sm btn-success">
569
						<?=gettext("Create new rule group")?>
572
						<?=gettext("Create new L7<br />rule group")?>
570 573
					</a>
571 574
				</div>
572 575
				<div class="col-sm-10">

Also available in: Unified diff