diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-15 14:05:47 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-15 14:06:27 -0400 |
commit | 621495e37b42fc33a155f36c78bd805b6661606f (patch) | |
tree | fb4f9f830f1f23bf8a3e714fd315b9a6740663e3 /src/usr/local/www/vpn_pppoe_edit.php | |
parent | e8bd1464281b4ee02484fca910457b852d71e704 (diff) | |
download | pfsense-621495e37b42fc33a155f36c78bd805b6661606f.zip pfsense-621495e37b42fc33a155f36c78bd805b6661606f.tar.gz |
Corrected value of r\enable checkbox tp permit Save action
Diffstat (limited to 'src/usr/local/www/vpn_pppoe_edit.php')
-rw-r--r-- | src/usr/local/www/vpn_pppoe_edit.php | 94 |
1 files changed, 61 insertions, 33 deletions
diff --git a/src/usr/local/www/vpn_pppoe_edit.php b/src/usr/local/www/vpn_pppoe_edit.php index 5971654..e6dffce 100644 --- a/src/usr/local/www/vpn_pppoe_edit.php +++ b/src/usr/local/www/vpn_pppoe_edit.php @@ -1,34 +1,58 @@ <?php /* vpn_pppoe_edit.php - part of pfSense - - Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) - Copyright (C) 2010 Ermal Luçi - Copyright (C) 2013-2015 Electric Sheep Fencing, LP - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. */ +/* ==================================================================== + * Copyright (c) 2004-2015 Electric Sheep Fencing, LLC. All rights reserved. + * Copyright (c) 2004, 2005 Scott Ullrich + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgment: + * "This product includes software developed by the pfSense Project + * for use in the pfSense software distribution. (http://www.pfsense.org/). + * + * 4. The names "pfSense" and "pfSense Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * coreteam@pfsense.org. + * + * 5. Products derived from this software may not be called "pfSense" + * nor may "pfSense" appear in their names without prior written + * permission of the Electric Sheep Fencing, LLC. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * + * "This product includes software developed by the pfSense Project + * for use in the pfSense software distribution (http://www.pfsense.org/). + * + * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * ==================================================================== + * + */ ##|+PRIV ##|*IDENT=page-services-pppoeserver-edit @@ -151,7 +175,7 @@ if ($_POST) { if (empty($_POST["password{$x}"])) { $input_errors[] = sprintf(gettext("No password specified for username %s"), $_POST["username{$x}"]); } - if ($_POST["ip{$x}"] <> "" && !is_ipaddr($_POST["ip{$x}"])) { + if ($_POST["ip{$x}"] != "" && !is_ipaddr($_POST["ip{$x}"])) { $input_errors[] = sprintf(gettext("Incorrect ip address specified for username %s"), $_POST["username{$x}"]); } } @@ -234,9 +258,11 @@ if ($_POST) { if ($_POST["ip{$x}"]) { $usernam .= ":" . $_POST["ip{$x}"]; } + $users[] = $usernam; } } + if (count($users) > 0) { $pppoecfg['username'] = implode(" ", $users); } @@ -244,6 +270,7 @@ if ($_POST) { if (!isset($id)) { $id = count($a_pppoes); } + if (file_exists("{$g['tmp_path']}/.vpn_pppoe.apply")) { $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.vpn_pppoe.apply")); } else { @@ -292,7 +319,8 @@ $section->addInput(new Form_Checkbox( 'mode', 'Enable', 'Enable PPPoE Server', - ($pconfig['mode'] == "server") + ($pconfig['mode'] == "server"), + 'server' )) ->toggles('.form-group:not(:first-child)'); $section->addInput(new Form_Select( @@ -467,7 +495,7 @@ $usernames = $pconfig['username']; //DEBUG //$usernames = 'sbeaver:TXlQYXNzd2Q=:192.168.1.1 smith:TXlQYXNzd2Q=:192.168.2.1 sjones:TXlQYXNzd2Q=:192.168.3.1 salpha:TXlQYXNzd2Q=:192.168.4.1'; -if(empty($usernames)) +if($usernames == "") $usernames = '::'; if ($usernames != ""){ @@ -485,21 +513,21 @@ if ($usernames != ""){ $group->addClass('repeatable'); $group->add(new Form_Input( - 'username' . $tracker, + 'username' . $counter, null, 'text', $user ))->setHelp($numrows == $counter ? 'User name':null); $group->add(new Form_Input( - 'password' . $tracker, + 'password' . $counter, null, 'password', $passwd ))->setHelp($numrows == $counter ? 'Password':null); $group->add(new Form_IpAddress( - 'ip' . $tracker, + 'ip' . $counter, null, $ip ))->setHelp($numrows == $counter ? 'IP Address':null); |