diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-02-14 13:11:02 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-02-14 13:11:48 -0500 |
commit | c946d7217bff529d246084f9b83212ad0ab730a3 (patch) | |
tree | 6b0a616af17fe627985fb86237f1e55d68dca317 /src/usr/local/www/services_dhcp.php | |
parent | abdb35477d82643f3e091c3b6c4a321bff942eb4 (diff) | |
download | pfsense-c946d7217bff529d246084f9b83212ad0ab730a3.zip pfsense-c946d7217bff529d246084f9b83212ad0ab730a3.tar.gz |
GET/POST conversion - services part 1
Diffstat (limited to 'src/usr/local/www/services_dhcp.php')
-rw-r--r-- | src/usr/local/www/services_dhcp.php | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/usr/local/www/services_dhcp.php b/src/usr/local/www/services_dhcp.php index 9707292..bed5cfb 100644 --- a/src/usr/local/www/services_dhcp.php +++ b/src/usr/local/www/services_dhcp.php @@ -40,10 +40,7 @@ if (!$g['services_dhcp_server_enable']) { exit; } -$if = $_GET['if']; -if (!empty($_POST['if'])) { - $if = $_POST['if']; -} +$if = $_REQUEST['if']; /* if OLSRD is enabled, allow WAN to house DHCP. */ if ($config['installedpackages']['olsrd']) { @@ -105,15 +102,12 @@ if (!$if || !isset($iflist[$if])) { } } -$act = $_GET['act']; -if (!empty($_POST['act'])) { - $act = $_POST['act']; -} +$act = $_REQUEST['act']; $a_pools = array(); if (is_array($config['dhcpd'][$if])) { - $pool = $_GET['pool']; + $pool = $_REQUEST['pool']; if (is_numeric($_POST['pool'])) { $pool = $_POST['pool']; } @@ -144,6 +138,7 @@ if (is_array($config['dhcpd'][$if])) { $a_maps = &$config['dhcpd'][$if]['staticmap']; } + if (is_array($dhcpdconf)) { // Global Options if (!is_numeric($pool) && !($act == "newpool")) { @@ -645,8 +640,8 @@ if ((isset($_POST['save']) || isset($_POST['apply'])) && (!$input_errors)) { } if ($act == "delpool") { - if ($a_pools[$_GET['id']]) { - unset($a_pools[$_GET['id']]); + if ($a_pools[$_POST['id']]) { + unset($a_pools[$_POST['id']]); write_config(); header("Location: services_dhcp.php?if={$if}"); exit; @@ -654,12 +649,12 @@ if ($act == "delpool") { } if ($act == "del") { - if (isset($a_maps[$_GET['id']])) { + if (isset($a_maps[$_POST['id']])) { /* Remove static ARP entry, if necessary */ - if (isset($a_maps[$_GET['id']]['arp_table_static_entry'])) { - mwexec("/usr/sbin/arp -d " . escapeshellarg($a_maps[$_GET['id']]['ipaddr'])); + if (isset($a_maps[$_POST['id']]['arp_table_static_entry'])) { + mwexec("/usr/sbin/arp -d " . escapeshellarg($a_maps[$_POST['id']]['ipaddr'])); } - unset($a_maps[$_GET['id']]); + unset($a_maps[$_POST['id']]); write_config(); if (isset($config['dhcpd'][$if]['enable'])) { mark_subsystem_dirty('staticmaps'); @@ -705,7 +700,7 @@ function build_pooltable() { $pooltbl .= '<td><a class="fa fa-pencil" title="'. gettext("Edit pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&pool=' . $i . '"></a>'; - $pooltbl .= ' <a class="fa fa-trash" title="'. gettext("Delete pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '"></a></td>'; + $pooltbl .= ' <a class="fa fa-trash" title="'. gettext("Delete pool") . '" href="services_dhcp.php?if=' . htmlspecialchars($if) . '&act=delpool&id=' . $i . '" usepost></a></td>'; $pooltbl .= '</tr>'; } $i++; @@ -1442,7 +1437,7 @@ if (!is_numeric($pool) && !($act == "newpool")) { </td> <td> <a class="fa fa-pencil" title="<?=gettext('Edit static mapping')?>" href="services_dhcp_edit.php?if=<?=htmlspecialchars($if)?>&id=<?=$i?>"></a> - <a class="fa fa-trash" title="<?=gettext('Delete static mapping')?>" href="services_dhcp.php?if=<?=htmlspecialchars($if)?>&act=del&id=<?=$i?>"></a> + <a class="fa fa-trash" title="<?=gettext('Delete static mapping')?>" href="services_dhcp.php?if=<?=htmlspecialchars($if)?>&act=del&id=<?=$i?>" usepost></a> </td> </tr> <?php |