Revision 9db1ff32
Added by Renato Botelho over 12 years ago
usr/local/www/firewall_aliases.php | ||
---|---|---|
179 | 179 |
$tab_array[] = array(gettext("All"), ($tab=="all"? true : false), "/firewall_aliases.php?tab=all"); |
180 | 180 |
display_top_tabs($tab_array); |
181 | 181 |
?> |
182 |
<input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>"> |
|
182 |
<input type="hidden" name="tab" value="<?=htmlspecialchars($tab);?>">
|
|
183 | 183 |
</td> |
184 | 184 |
</tr> |
185 |
<tr><td><div id="mainarea"> |
|
186 |
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
187 |
<tr> |
|
188 |
<td width="20%" class="listhdrr"><?=gettext("Name"); ?></td> |
|
189 |
<td width="43%" class="listhdrr"><?=gettext("Values"); ?></td> |
|
190 |
<td width="30%" class="listhdr"><?=gettext("Description"); ?></td> |
|
191 |
<td width="7%" class="list"> |
|
192 |
<table border="0" cellspacing="0" cellpadding="1"> |
|
193 |
<tr> |
|
194 |
<td valign="middle" width="17"> </td> |
|
195 |
<td valign="middle"><a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias"));?>></a></td> |
|
196 |
</tr> |
|
197 |
</table> |
|
198 |
</td> |
|
199 |
</tr> |
|
200 |
<?php |
|
201 |
asort($a_aliases); |
|
202 |
foreach ($a_aliases as $i=> $alias){ |
|
203 |
unset ($show_alias); |
|
204 |
switch ($tab){ |
|
205 |
case "all": |
|
206 |
$show_alias= true; |
|
207 |
break; |
|
208 |
case "ip": |
|
209 |
case "host": |
|
210 |
case "network": |
|
211 |
if (preg_match("/(host|network)/",$alias["type"])) |
|
212 |
$show_alias= true; |
|
213 |
break; |
|
214 |
case "url": |
|
215 |
if (preg_match("/(url)/i",$alias["type"])) |
|
216 |
$show_alias= true; |
|
217 |
break; |
|
218 |
case "port": |
|
219 |
if($alias["type"] == "port") |
|
220 |
$show_alias= true; |
|
221 |
break; |
|
222 |
} |
|
223 |
if ($show_alias){?> |
|
224 |
<tr> |
|
225 |
<td class="listlr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
226 |
<?=htmlspecialchars($alias['name']);?> |
|
227 |
</td> |
|
228 |
<td class="listr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
229 |
<?php |
|
230 |
if ($alias["url"]) { |
|
231 |
echo $alias["url"] . "<br/>"; |
|
232 |
} |
|
233 |
if(is_array($alias["aliasurl"])) { |
|
234 |
$aliasurls = implode(", ", array_slice($alias["aliasurl"], 0, 10)); |
|
235 |
echo $aliasurls; |
|
236 |
if(count($aliasurls) > 10) { |
|
237 |
echo "...<br/>"; |
|
238 |
} |
|
239 |
echo "<br/>\n"; |
|
240 |
} |
|
241 |
$tmpaddr = explode(" ", $alias['address']); |
|
242 |
$addresses = implode(", ", array_slice($tmpaddr, 0, 10)); |
|
243 |
echo $addresses; |
|
244 |
if(count($tmpaddr) > 10) { |
|
245 |
echo "..."; |
|
246 |
} |
|
247 |
?> |
|
248 |
</td> |
|
249 |
<td class="listbg" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
250 |
<?=htmlspecialchars($alias['descr']);?> |
|
251 |
</td> |
|
252 |
<td valign="middle" nowrap class="list"> |
|
253 |
<table border="0" cellspacing="0" cellpadding="1"> |
|
254 |
<tr> |
|
255 |
<td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=dom_title(gettext("Edit alias")." {$alias['name']}");?>></a></td> |
|
256 |
<td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=dom_title(gettext("Delete alias")." {$alias['name']}");?>></a></td> |
|
257 |
</tr> |
|
258 |
</table> |
|
259 |
</td> |
|
260 |
</tr> |
|
261 |
<?php |
|
262 |
} |
|
263 |
}?> |
|
185 |
<tr> |
|
186 |
<td> |
|
187 |
<div id="mainarea"> |
|
188 |
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> |
|
189 |
<tr> |
|
190 |
<td width="20%" class="listhdrr"><?=gettext("Name"); ?></td> |
|
191 |
<td width="43%" class="listhdrr"><?=gettext("Values"); ?></td> |
|
192 |
<td width="30%" class="listhdr"><?=gettext("Description"); ?></td> |
|
193 |
<td width="7%" class="list"> |
|
194 |
<table border="0" cellspacing="0" cellpadding="1"> |
|
195 |
<tr> |
|
196 |
<td valign="middle" width="17"> </td> |
|
197 |
<td valign="middle"><a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias"));?>></a></td> |
|
198 |
</tr> |
|
199 |
</table> |
|
200 |
</td> |
|
201 |
</tr> |
|
202 |
<?php |
|
203 |
asort($a_aliases); |
|
204 |
foreach ($a_aliases as $i=> $alias){ |
|
205 |
unset ($show_alias); |
|
206 |
switch ($tab){ |
|
207 |
case "all": |
|
208 |
$show_alias= true; |
|
209 |
break; |
|
210 |
case "ip": |
|
211 |
case "host": |
|
212 |
case "network": |
|
213 |
if (preg_match("/(host|network)/",$alias["type"])) |
|
214 |
$show_alias= true; |
|
215 |
break; |
|
216 |
case "url": |
|
217 |
if (preg_match("/(url)/i",$alias["type"])) |
|
218 |
$show_alias= true; |
|
219 |
break; |
|
220 |
case "port": |
|
221 |
if($alias["type"] == "port") |
|
222 |
$show_alias= true; |
|
223 |
break; |
|
224 |
} |
|
225 |
if ($show_alias) { |
|
226 |
?> |
|
227 |
<tr> |
|
228 |
<td class="listlr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
229 |
<?=htmlspecialchars($alias['name']);?> |
|
230 |
</td> |
|
231 |
<td class="listr" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
232 |
<?php |
|
233 |
if ($alias["url"]) { |
|
234 |
echo $alias["url"] . "<br/>"; |
|
235 |
} |
|
236 |
if(is_array($alias["aliasurl"])) { |
|
237 |
$aliasurls = implode(", ", array_slice($alias["aliasurl"], 0, 10)); |
|
238 |
echo $aliasurls; |
|
239 |
if(count($aliasurls) > 10) { |
|
240 |
echo "...<br/>"; |
|
241 |
} |
|
242 |
echo "<br/>\n"; |
|
243 |
} |
|
244 |
$tmpaddr = explode(" ", $alias['address']); |
|
245 |
$addresses = implode(", ", array_slice($tmpaddr, 0, 10)); |
|
246 |
echo $addresses; |
|
247 |
if(count($tmpaddr) > 10) { |
|
248 |
echo "..."; |
|
249 |
} |
|
250 |
?> |
|
251 |
</td> |
|
252 |
<td class="listbg" ondblclick="document.location='firewall_aliases_edit.php?id=<?=$i;?>';"> |
|
253 |
<?=htmlspecialchars($alias['descr']);?> |
|
254 |
</td> |
|
255 |
<td valign="middle" nowrap class="list"> |
|
256 |
<table border="0" cellspacing="0" cellpadding="1"> |
|
257 |
<tr> |
|
258 |
<td valign="middle"><a href="firewall_aliases_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" <?=dom_title(gettext("Edit alias")." {$alias['name']}");?>></a></td> |
|
259 |
<td><a href="firewall_aliases.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this alias? All elements that still use it will become invalid (e.g. filter rules)!");?>')"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" <?=dom_title(gettext("Delete alias")." {$alias['name']}");?>></a></td> |
|
260 |
</tr> |
|
261 |
</table> |
|
262 |
</td> |
|
263 |
</tr> |
|
264 |
<?php |
|
265 |
} // if ($show_alias) |
|
266 |
} // foreach |
|
267 |
?> |
|
264 | 268 |
|
265 |
<tr> |
|
266 |
<td colspan="3"/> </td>
|
|
267 |
<td valign="middle" nowrap class="list">
|
|
268 |
<table border="0" cellspacing="0" cellpadding="1">
|
|
269 |
<tbody>
|
|
270 |
<tr>
|
|
271 |
<td valign="middle">
|
|
272 |
<a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias")); ?>></a>
|
|
273 |
</td>
|
|
274 |
<td valign="middle">
|
|
275 |
<a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" <?=dom_title(gettext("Bulk import aliases from list"));?> alt="" /></a>
|
|
276 |
</td>
|
|
277 |
</tr>
|
|
278 |
</tbody>
|
|
279 |
</table>
|
|
280 |
</td>
|
|
281 |
</tr> |
|
269 |
<tr>
|
|
270 |
<td colspan="3"/> </td>
|
|
271 |
<td valign="middle" nowrap class="list">
|
|
272 |
<table border="0" cellspacing="0" cellpadding="1">
|
|
273 |
<tbody>
|
|
274 |
<tr>
|
|
275 |
<td valign="middle">
|
|
276 |
<a href="firewall_aliases_edit.php?tab=<?=$tab?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" <?=dom_title(gettext("Add a new alias")); ?>></a>
|
|
277 |
</td>
|
|
278 |
<td valign="middle">
|
|
279 |
<a href="firewall_aliases_import.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_import_alias.gif" width="17" height="17" border="0" <?=dom_title(gettext("Bulk import aliases from list"));?> alt="" /></a>
|
|
280 |
</td>
|
|
281 |
</tr>
|
|
282 |
</tbody>
|
|
283 |
</table>
|
|
284 |
</td>
|
|
285 |
</tr>
|
|
282 | 286 |
|
283 |
<td class="tabcont" colspan="3"> |
|
284 |
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br></strong></span><div style="overflow:hidden; text-align:justify;"><?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?></div></span></p> |
|
285 |
</td> |
|
286 |
</tr> |
|
287 |
<tr> |
|
288 |
<td class="tabcont" colspan="3"> |
|
289 |
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:"); ?><br></strong></span><div style="overflow:hidden; text-align:justify;"><?=gettext("Aliases act as placeholders for real hosts, networks or ports. They can be used to minimize the number of changes that have to be made if a host, network or port changes. You can enter the name of an alias instead of the host, network or port in all fields that have a red background. The alias will be resolved according to the list above. If an alias cannot be resolved (e.g. because you deleted it), the corresponding element (e.g. filter/NAT/shaper rule) will be considered invalid and skipped."); ?></div></span></p> |
|
290 |
</td> |
|
291 |
</tr> |
|
292 |
</table> |
|
293 |
</div> |
|
294 |
</td> |
|
295 |
</tr> |
|
287 | 296 |
</table> |
288 |
</div> |
|
289 |
</td> |
|
290 |
</tr> |
|
291 |
</table> |
|
292 | 297 |
</form> |
293 | 298 |
<?php include("fend.inc"); ?> |
294 | 299 |
</body> |
Also available in: Unified diff
Fix whitespaces, indent and add a missing <tr>