Projet

Général

Profil

« Précédent | Suivant » 

Révision 67eec085

Ajouté par jim-p il y a presque 10 ans

Add (self) for an outbound NAT source as well

Voir les différences:

usr/local/www/firewall_nat_out_edit.php
121 121
	if ($_POST['source_type'] == "any") {
122 122
		$_POST['source'] = "any";
123 123
		$_POST['source_subnet'] = 24;
124
	} elseif ($_POST['source_type'] == "(self)") {
125
		$_POST['source'] = "(self)";
126
		$_POST['source_subnet'] = 24;
124 127
	}
125 128

  
126 129
	unset($input_errors);
......
165 168
	if($protocol_uses_ports && $_POST['natport'] <> "" && !is_port($_POST['natport']) && !isset($_POST['nonat']))
166 169
		$input_errors[] = gettext("You must supply a valid port for the NAT port entry.");
167 170

  
168
	if ($_POST['source_type'] != "any") {
171
	if (($_POST['source_type'] != "any") && ($_POST['source_type'] != "(self)")) {
169 172
		if ($_POST['source'] && !is_ipaddroralias($_POST['source']) && $_POST['source'] <> "any") {
170 173
			$input_errors[] = gettext("A valid source must be specified.");
171 174
		}
......
216 219
	/* if user has selected any as source, set it here */
217 220
	if($_POST['source_type'] == "any") {
218 221
		$osn = "any";
222
	} else if($_POST['source_type'] == "(self)") {
223
		$osn = "(self)";
219 224
	} else if(is_alias($_POST['source'])) {
220 225
		$osn = $_POST['source'];
221 226
	} else {
......
367 372
}
368 373
function sourcesel_change() {
369 374
	switch (document.iform.source_type.selectedIndex) {
370
	case 1: // network
375
	case 2: // network
371 376
		document.iform.source.disabled = 0;
372 377
		document.iform.source_subnet.disabled = 0;
373 378
		break;
......
530 535
						<td>
531 536
							<select name="source_type" class="formselect" onchange="sourcesel_change()">
532 537
								<option value="any" <?php if ($pconfig['source'] == "any") echo "selected=\"selected\""; ?>><?=gettext("any");?></option>
533
								<option value="network" <?php if ($pconfig['source'] != "any") echo "selected=\"selected\""; ?>><?=gettext("Network");?></option>
538
								<option value="(self)" <?PHP if ($pconfig['source'] == "(self)") echo "selected=\"selected\""; ?>><?=gettext("This Firewall (self)");?></option>
539
								<option value="network" <?php if (($pconfig['source'] != "any") && ($pconfig['source'] != "(self)")) echo "selected=\"selected\""; ?>><?=gettext("Network");?></option>
534 540
							</select>
535 541
						</td>
536 542
					</tr>

Formats disponibles : Unified diff