Project

General

Profile

« Previous | Next » 

Revision c65e1e0d

Added by Ermal LUÇI almost 15 years ago

Ticket #876. Actually use the friendly name for the key of the array returned by return_gateways_array() so the dynamic gateway and status pages work correctly.

View differences:

etc/inc/gwlb.inc
330 330
		}
331 331

  
332 332
		/* retrieve a proper monitor IP? */
333
		$interface = $config['interfaces'][$ifname];
334
		if(is_ipaddr($interface['monitorip'])) {
335
			$gateway['monitor'] = $interface['monitorip'];
336
		} else {
333
		$ifcfg =& $config['interfaces'][$ifname];
334
		if (is_ipaddr($ifcfg['monitorip']))
335
			$gateway['monitor'] = $ifcfg['monitorip'];
336
		else
337 337
			$gateway['monitor'] = $gateway['gateway'];
338
		}
339
		$gateway['descr'] = "Interface $ifname Dynamic Gateway";
340
		$gateways_arr[$ifname] = $gateway;
338

  
339
		$gateway['descr'] = "Interface {$friendly} Dynamic Gateway";
340
		$gateways_arr[$friendly] = $gateway;
341 341
	}
342 342

  
343 343
	return($gateways_arr);
usr/local/www/system_gateways.php
176 176
                  </td>
177 177
                  <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';">
178 178
                    <?php
179
				echo htmlspecialchars(convert_real_interface_to_friendly_descr($gateway['interface']));
179
				echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($gateway['friendlyiface']));
180 180
			?>
181 181
                  </td>
182 182
                  <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';">
183 183
				  <?php
184
					if(isset($gateway['interfacegateway'])) {
185
						echo strtoupper($gateway['interface']) . " ";
186
					} else {
187
						if(is_numeric($gateway['attribute']) && ($a_gateway_item[$gateway['attribute']]['gateway'] == "dynamic")) {
188
							echo "dynamic";
189
						} else {
190
							echo $gateway['gateway'] . " ";
191
						}
192
					}
184
					echo $gateway['gateway'] . " ";
193 185
				  ?>
194 186
                  </td>
195 187
                  <td class="listr" ondblclick="document.location='system_gateways_edit.php?id=<?=$i;?>';">
196 188
                    <?php
197
			if(is_numeric($gateway['attribute']) && ($a_gateway_item[$gateway['attribute']]['monitor'] == "dynamic")) {
198
				echo "dynamic";
199
			} else {
200 189
				echo htmlspecialchars($gateway['monitor']) . " ";
201
			}
202 190
		    ?>
203 191
                  </td>
204 192
		<?php if($gateway['attribute'] == "system") : ?>

Also available in: Unified diff