diff options
author | Phil Davis <phil.davis@inf.org> | 2015-05-13 13:06:17 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-05-13 13:06:17 +0545 |
commit | 2af86dda298716d3e0b3f62fbc8a5ccc3e4fa840 (patch) | |
tree | da8ebcd1d169f898d88c1d7dfe166caedb812a72 /usr/local/www/interfaces_groups.php | |
parent | c8f7068d1aaccf4ca1d1f782704289e9519233dc (diff) | |
download | pfsense-2af86dda298716d3e0b3f62fbc8a5ccc3e4fa840.zip pfsense-2af86dda298716d3e0b3f62fbc8a5ccc3e4fa840.tar.gz |
Code style interfaces miscellaneous files
Diffstat (limited to 'usr/local/www/interfaces_groups.php')
-rw-r--r-- | usr/local/www/interfaces_groups.php | 151 |
1 files changed, 80 insertions, 71 deletions
diff --git a/usr/local/www/interfaces_groups.php b/usr/local/www/interfaces_groups.php index cdc99bf..defb01f 100644 --- a/usr/local/www/interfaces_groups.php +++ b/usr/local/www/interfaces_groups.php @@ -43,8 +43,9 @@ require("guiconfig.inc"); require_once("functions.inc"); -if (!is_array($config['ifgroups']['ifgroupentry'])) +if (!is_array($config['ifgroups']['ifgroupentry'])) { $config['ifgroups']['ifgroupentry'] = array(); +} $a_ifgroups = &$config['ifgroups']['ifgroupentry']; @@ -53,8 +54,9 @@ if ($_GET['act'] == "del") { $members = explode(" ", $a_ifgroups[$_GET['id']]['members']); foreach ($members as $ifs) { $realif = get_real_interface($ifs); - if ($realif) + if ($realif) { mwexec("/sbin/ifconfig {$realif} -group " . $a_ifgroups[$_GET['id']]['ifname']); + } } unset($a_ifgroups[$_GET['id']]); write_config(); @@ -73,7 +75,7 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0" summary="interfaces groups"> - <tr><td> + <tr><td> <?php $tab_array = array(); $tab_array[0] = array(gettext("Interface assignments"), false, "interfaces_assign.php"); @@ -88,74 +90,81 @@ include("head.inc"); $tab_array[9] = array(gettext("LAGG"), false, "interfaces_lagg.php"); display_top_tabs($tab_array); ?> - </td></tr> -<tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> - -<tr> - <td width="15%" class="listhdrr"><?=gettext("Name");?></td> - <td width="35%" class="listhdrr"><?=gettext("Members");?></td> - <td width="25%" class="listhdr"><?=gettext("Description");?></td> - <td width="5%" class="list"></td> -</tr> - <?php if (count ($a_ifgroups)): - $i = 0; foreach ($a_ifgroups as $ifgroupentry): ?> -<tr> - <td class="listlr" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> - <a href="/firewall_rules.php?if=<?=htmlspecialchars($ifgroupentry['ifname']);?>"><?=htmlspecialchars($ifgroupentry['ifname']);?></a> - </td> - <td class="listr" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> - <?php - $members_arr = explode(" ", $ifgroupentry['members']); - $iflist = get_configured_interface_with_descr(false, true); - $memberses_arr = array(); - foreach ($members_arr as $memb) - $memberses_arr[] = $iflist[$memb] ? $iflist[$memb] : $memb; - unset($iflist); - $memberses = implode(", ", $memberses_arr); - echo $memberses; - if(count($members_arr) < 10) { - echo " "; - } else { - echo "..."; - } - ?> - </td> - <td class="listbg" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> - <?=htmlspecialchars($ifgroupentry['descr']);?> - </td> - <td valign="middle" class="list nowrap"> - <table border="0" cellspacing="0" cellpadding="1" summary="icons"> - <tr> - <td valign="middle"><a href="interfaces_groups_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit group");?>" alt="edit" /></a></td> - <td><a href="interfaces_groups.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this group? 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" title="<?=gettext("delete ifgroupentry");?>" alt="delete" /></a></td> - </tr> - </table> - </td> -</tr> - <?php $i++; endforeach; endif;?> -<tr> - <td class="list" colspan="3"></td> - <td class="list"> - <table border="0" cellspacing="0" cellpadding="1" summary="add"> - <tr> - <td valign="middle" width="17"> </td> - <td valign="middle"><a href="interfaces_groups_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new group");?>" alt="add" /></a></td> - </tr> - </table> - </td> -</tr> -<tr> - <td class="tabcont" colspan="3"> - <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br /></strong></span><?=gettext("Interface Groups allow you to create rules that apply to multiple interfaces without duplicating the rules. If you remove members from an interface group, the group rules no longer apply to that interface.");?></span></p> - </td> -</tr> - </table> - </div> - </td> -</tr> + </td></tr> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> + <tr> + <td width="15%" class="listhdrr"><?=gettext("Name");?></td> + <td width="35%" class="listhdrr"><?=gettext("Members");?></td> + <td width="25%" class="listhdr"><?=gettext("Description");?></td> + <td width="5%" class="list"></td> + </tr> +<?php + if (count ($a_ifgroups)): + $i = 0; + foreach ($a_ifgroups as $ifgroupentry): +?> + <tr> + <td class="listlr" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> + <a href="/firewall_rules.php?if=<?=htmlspecialchars($ifgroupentry['ifname']);?>"><?=htmlspecialchars($ifgroupentry['ifname']);?></a> + </td> + <td class="listr" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> +<?php + $members_arr = explode(" ", $ifgroupentry['members']); + $iflist = get_configured_interface_with_descr(false, true); + $memberses_arr = array(); + foreach ($members_arr as $memb) { + $memberses_arr[] = $iflist[$memb] ? $iflist[$memb] : $memb; + } + unset($iflist); + $memberses = implode(", ", $memberses_arr); + echo $memberses; + if (count($members_arr) < 10) { + echo " "; + } else { + echo "..."; + } +?> + </td> + <td class="listbg" ondblclick="document.location='interfaces_groups_edit.php?id=<?=$i;?>';"> + <?=htmlspecialchars($ifgroupentry['descr']);?> + </td> + <td valign="middle" class="list nowrap"> + <table border="0" cellspacing="0" cellpadding="1" summary="icons"> + <tr> + <td valign="middle"><a href="interfaces_groups_edit.php?id=<?=$i;?>"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit group");?>" alt="edit" /></a></td> + <td><a href="interfaces_groups.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this group? 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" title="<?=gettext("delete ifgroupentry");?>" alt="delete" /></a></td> + </tr> + </table> + </td> + </tr> +<?php + $i++; + endforeach; + endif; +?> + <tr> + <td class="list" colspan="3"></td> + <td class="list"> + <table border="0" cellspacing="0" cellpadding="1" summary="add"> + <tr> + <td valign="middle" width="17"> </td> + <td valign="middle"><a href="interfaces_groups_edit.php"><img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" title="<?=gettext("add a new group");?>" alt="add" /></a></td> + </tr> + </table> + </td> + </tr> + <tr> + <td class="tabcont" colspan="3"> + <p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br /></strong></span><?=gettext("Interface Groups allow you to create rules that apply to multiple interfaces without duplicating the rules. If you remove members from an interface group, the group rules no longer apply to that interface.");?></span></p> + </td> + </tr> + </table> + </div> + </td> + </tr> </table> <?php include("fend.inc"); ?> </body> |