diff options
-rw-r--r-- | usr/local/www/interfaces_gif.php | 2 | ||||
-rw-r--r-- | usr/local/www/interfaces_mlppp_edit.php | 495 |
2 files changed, 363 insertions, 134 deletions
diff --git a/usr/local/www/interfaces_gif.php b/usr/local/www/interfaces_gif.php index 056fa84..ad33234 100644 --- a/usr/local/www/interfaces_gif.php +++ b/usr/local/www/interfaces_gif.php @@ -73,7 +73,7 @@ if ($_GET['act'] == "del") { } } -$pgtitle = array("Interfaces","gif"); +$pgtitle = array("Interfaces","GIF"); include("head.inc"); ?> diff --git a/usr/local/www/interfaces_mlppp_edit.php b/usr/local/www/interfaces_mlppp_edit.php index 1b81368..a31bde0 100644 --- a/usr/local/www/interfaces_mlppp_edit.php +++ b/usr/local/www/interfaces_mlppp_edit.php @@ -6,6 +6,8 @@ Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. All rights reserved. + Copyright (C) 2010 Gabriel B. <gnoahb@gmail.com>. + All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -41,10 +43,10 @@ require("guiconfig.inc"); -if (!is_array($config['mlppps']['mlppp'])) - $config['mlppps']['mlppp'] = array(); +if (!is_array($config['ppps']['ppp'])) + $config['ppps']['ppp'] = array(); -$a_mlppps = &$config['mlppps']['mlppp']; +$a_ppps = &$config['ppps']['ppp']; $portlist = get_interface_list(); @@ -52,115 +54,289 @@ $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; -if (isset($id) && $a_mlppps[$id]) { - $pconfig['if'] = $a_mlppps[$id]['if']; - $pconfig['mlpppif'] = $a_mlppps[$id]['mlpppif']; - $pconfig['username'] = $a_mlppps[$id]['username']; - $pconfig['password'] = $a_mlppps[$id]['password']; - $pconfig['service'] = $a_mlppps[$id]['service']; - $pconfig['ondemand'] = $a_mlppps[$id]['ondemand']; - $pconfig['timeout'] = $a_mlppps[$id]['timeout']; +if (isset($id) && $a_ppps[$id]) { + $pconfig['type'] = $a_ppps[$id]['type']; + $pconfig['username'] = $a_ppps[$id]['username']; + $pconfig['password'] = $a_ppps[$id]['password']; + if (isset($a_ppps[$id]['defaultgw'])) + $pconfig['defaultgw'] = true; + $pconfig['ondemand'] = $a_ppps[$id]['ondemand']; + $pconfig['idletimeout'] = $a_ppps[$id]['idletimeout']; + $pconfig['descr'] = $a_ppps[$id]['descr']; + if ($a_ppps[$id]['type'] == "ppp") { + $pconfig['serialports'] = $a_ppps[$id]['serialports']; + $pconfig['initstr'] = base64_decode($a_ppps[$id]['initstr']); + $pconfig['simpin'] = $a_ppps[$id]['simpin']; + $pconfig['pin-wait'] = $a_ppps[$id]['pin-wait']; + $pconfig['apn'] = $a_ppps[$id]['apn']; + $pconfig['apnum'] = $a_ppps[$id]['apnum']; + $pconfig['phone'] = $a_ppps[$id]['phone']; + $pconfig['connect-timeout'] = $a_ppps[$id]['connect-timeout']; + $pconfig['localip'] = $a_ppps[$id]['localip']; + $pconfig['gateway'] = $a_ppps[$id]['gateway']; + } + if ($a_ppps[$id]['type'] == "pptp") { + $pconfig['interfaces'] = $a_ppps[$id]['interfaces']; + $pconfig['localip'] = $a_ppps[$id]['localip']; + $pconfig['subnet'] = $a_ppps[$id]['subnet']; + $pconfig['gateway'] = $a_ppps[$id]['gateway']; + } + if ($a_ppps[$id]['type'] == "pppoe") { + $pconfig['interfaces'] = $a_ppps[$id]['interfaces']; + $pconfig['provider']; + /* ================================================ */ + /* = force a connection reset at a specific time? = */ + /* ================================================ */ + + if (isset($wancfg['pppoe']['pppoe-reset-type'])) { + $resetTime = getMPDResetTimeFromConfig(); + $pconfig['pppoe_preset'] = true; + if ($wancfg['pppoe']['pppoe-reset-type'] == "custom") { + $resetTime_a = split(" ", $resetTime); + $pconfig['pppoe_pr_custom'] = true; + $pconfig['pppoe_resetminute'] = $resetTime_a[0]; + $pconfig['pppoe_resethour'] = $resetTime_a[1]; + /* just initialize $pconfig['pppoe_resetdate'] if the + * coresponding item contains appropriate numeric values. + */ + if ($resetTime_a[2] <> "*" && $resetTime_a[3] <> "*") + $pconfig['pppoe_resetdate'] = "{$resetTime_a[3]}/{$resetTime_a[2]}/" . date("Y"); + } else if ($wancfg['pppoe']['pppoe-reset-type'] == "preset") { + $pconfig['pppoe_pr_preset'] = true; + switch ($resetTime) { + case CRON_MONTHLY_PATTERN: + $pconfig['pppoe_monthly'] = true; + break; + case CRON_WEEKLY_PATTERN: + $pconfig['pppoe_weekly'] = true; + break; + case CRON_DAILY_PATTERN: + $pconfig['pppoe_daily'] = true; + break; + case CRON_HOURLY_PATTERN: + $pconfig['pppoe_hourly'] = true; + break; + } + } + } + + } if ($_POST) { unset($input_errors); $pconfig = $_POST; + + /* filter out spaces from descriptions */ + $_POST['descr'] = remove_bad_chars($_POST['descr']); + /* okay first of all, cause we are just hiding the PPPoE HTML + * fields releated to PPPoE resets, we are going to unset $_POST + * vars, if the reset feature should not be used. Otherwise the + * data validation procedure below, may trigger a false error + * message. + */ + if (empty($_POST['pppoe_preset'])) { + unset($_POST['pppoe_pr_type']); + unset($_POST['pppoe_resethour']); + unset($_POST['pppoe_resetminute']); + unset($_POST['pppoe_resetdate']); + unset($_POST['pppoe_pr_preset_val']); + } /* input validation */ - $reqdfields = explode(" ", "if tag"); - $reqdfieldsn = explode(",", "Parent interface,mlppp tag"); - - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if ($_POST['tag'] && (!is_numericint($_POST['tag']) || ($_POST['tag'] < '1') || ($_POST['tag'] > '4094'))) { - $input_errors[] = "The mlppp tag must be an integer between 1 and 4094."; + switch($_POST['type']) { + case "PPP": + $reqdfields = explode(" ", "serialports, phone"); + $reqdfieldsn = explode(",", "Serial Port(s), Phone Number"); + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; + case "PPPoE": + if ($_POST['ondemand']) { + $reqdfields = explode(" ", "interfaces username password dialondemand idletimeout"); + $reqdfieldsn = explode(",", "Link Interface(s),PPPoE username,PPPoE password,Dial on demand,Idle timeout value"); + } else { + $reqdfields = explode(" ", "interfaces username password"); + $reqdfieldsn = explode(",", "Link Interface(s),PPPoE username,PPPoE password"); + } + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; + case "PPTP": + if ($_POST['ondemand']) { + $reqdfields = explode(" ", "interfaces username password localip subnet gateway dialondemand idletimeout"); + $reqdfieldsn = explode(",", "Link Interface(s),PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address,Dial on demand,Idle timeout value"); + } else { + $reqdfields = explode(" ", "interfaces username password localip subnet gateway"); + $reqdfieldsn = explode(",", "Link Interface(s),PPTP username,PPTP password,PPTP local IP address,PPTP subnet,PPTP remote IP address"); + } + do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + break; } - - foreach ($a_mlppps as $mlppp) { - if (isset($id) && ($a_mlppps[$id]) && ($a_mlppps[$id] === $mlppp)) + if (($_POST['provider'] && !is_domain($_POST['provider']))) + $input_errors[] = "The service name contains invalid characters."; + if (($_POST['idletimeout'] != "") && !is_numericint($_POST['idletimeout'])) + $input_errors[] = "The idle timeout value must be an integer."; + if ($_POST['pppoe_resethour'] <> "" && !is_numericint($_POST['pppoe_resethour']) && + $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <=23) + $input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23)."); + if ($_POST['pppoe_resetminute'] <> "" && !is_numericint($_POST['pppoe_resetminute']) && + $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <=59) + $input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59)."); + if ($_POST['pppoe_resetdate'] <> "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) + $input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy)."); + if (($_POST['localip'] && !is_ipaddr($_POST['localip']))) + $input_errors[] = "A valid PPTP local IP address must be specified."; + if (($_POST['subnet'] && !is_numeric($_POST['subnet']))) + $input_errors[] = "A valid PPTP subnet bit count must be specified."; + if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) + $input_errors[] = "A valid PPTP remote IP address must be specified."; + + if ($_POST['mtu'] && ($_POST['mtu'] < 576)) + $input_errors[] = "The MTU must be greater than 576 bytes."; + if ($_POST['mru'] && ($_POST['mru'] < 576)) + $input_errors[] = "The MRU must be greater than 576 bytes."; + /* + foreach ($a_ppps as $ppp) { + if (isset($id) && ($a_ppps[$id]) && ($a_ppps[$id] === $ppp)) continue; - if (($mlppp['if'] == $_POST['if']) && ($mlppp['tag'] == $_POST['tag'])) { - $input_errors[] = "A mlppp with the tag {$mlppp['tag']} is already defined on this interface."; + if ($ppp['serialport'] == $_POST['serialport']) { + $input_errors[] = "Port is in use"; break; } } - if (is_array($config['qinqs']['qinqentry'])) { - foreach ($config['qinqs']['qinqentry'] as $qinq) - if ($qinq['tag'] == $_POST['tag'] && $qinq['if'] == $_POST['if']) - $input_errors[] = "A QinQ mlppp exists with this tag please remove it to use this tag with."; - } + */ if (!$input_errors) { - $mlppp = array(); - $mlppp['if'] = $_POST['if']; - $mlppp['tag'] = $_POST['tag']; - $mlppp['descr'] = $_POST['descr']; - $mlppp['mlpppif'] = "{$_POST['if']}_mlppp{$_POST['tag']}"; - - $mlppp['mlpppif'] = interface_mlppp_configure($mlppp); - if ($mlppp['mlpppif'] == "" || !stristr($mlppp['mlpppif'], "mlppp")) - $input_errors[] = "Error occured creating interface, please retry."; - else { - if (isset($id) && $a_mlppps[$id]) - $a_mlppps[$id] = $mlppp; - else - $a_mlppps[] = $mlppp; - - write_config(); - - $confif = convert_real_interface_to_friendly_interface_name($mlppp['mlpppif']); - if ($confif <> "") - interface_configure($confif); + $ppp = array(); + $ppp['type'] = $_POST['type']; + $ppp['username'] = $_POST['username']; + $ppp['password'] = $_POST['password']; + $ppp['defaultgw'] = $_POST['defaultgw'] ? true : false; + /* if ($_POST['defaultgw'] == "on") + $ppp['defaultgw'] = true; + else + unset($ppp['defaultgw']); + */ + $ppp['ondemand'] = $_POST['ondemand'] ? true : false; + if ($_POST['ondemand']) + $ppp['idletimeout'] = $_POST['idletimeout']; + else + unset($ppp['idletimeout']); + $ppp['descr'] = $_POST['descr']; + switch($_POST['type']) { + case "ppp": + $ppp['ipaddr'] = "ppp"; + $ppp['serialports'] = implode(',', $_POST['serialports']); + if (!empty($_POST['initstr'])) + $ppp['initstr'] = base64_encode($_POST['initstr']); + else + unset($ppp['initstr']); + if (!empty($_POST['simpin'])) { + $ppp['simpin'] = $_POST['simpin']; + $ppp['pin-wait'] = $_POST['pin-wait']; + } else { + unset($ppp['simpin']); + unset($ppp['pin-wait']); + } - header("Location: interfaces_mlppp.php"); - exit; + if (!empty($_POST['apn'])){ + $ppp['apn'] = $_POST['apn']; + if (!empty($_POST['apnum'])) + $ppp['apnum'] = $_POST['apnum']; + else + $ppp['apnum'] = "1"; + } else { + unset($ppp['apn']); + unset($ppp['apnum']); + } + $ppp['phone'] = $_POST['phone']; + $ppp['localip'] = $_POST['localip']; + $ppp['gateway'] = $_POST['gateway']; + if (!empty($_POST['connect-timeout'])) + $ppp['connect-timeout'] = $_POST['connect-timeout']; + else + unset($ppp['connect-timeout']); + break; + case "pppoe": + $ppp['ipaddr'] = "pppoe"; + $ppp['interfaces'] = implode(',', $_POST['interfaces']); + $ppp['provider'] = $_POST['provider']; + break; + case "pptp": + $ppp['ipaddr'] = "pptp"; + $ppp['interfaces'] = implode(',', $_POST['interfaces']); + $ppp['localip'] = $_POST['localip']; + $ppp['subnet'] = $_POST['subnet']; + $ppp['gateway'] = $_POST['gateway']; + break; } + $iflist = get_configured_interface_list(); + foreach ($iflist as $if) { + if ($config['interfaces'][$if]['if'] == basename($a_ppps[$id]['port'])) + $config['interfaces'][$if]['if'] = basename($ppp['port']); + } + + if (isset($id) && $a_ppps[$id]) + $a_ppps[$id] = $ppp; + else + $a_ppps[] = $ppp; + + write_config(); + + header("Location: interfaces_mlppp.php"); + exit; } } + $closehead = false; $pgtitle = array("Interfaces","MLPPP","Edit"); include("head.inc"); -$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP"/*, "l2tp" => "L2TP", "tcp" => "TCP", "udp" => "UDP", "ng" => "Netgraph" */); +$types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" => "PPTP"/*, "l2tp" => "L2TP", "tcp" => "TCP", "udp" => "UDP", "ng" => "Netgraph" */ ); ?> <script type="text/javascript"> + function updateType(t){ switch(t) { - <?php - /* OK, so this is sick using php to generate javascript, but it needed to be done */ - foreach ($types as $key => $val) { - echo " case \"{$key}\": {\n"; - $t = $types; - foreach ($t as $k => $v) { - if ($k != $key) { - echo " $('{$k}').hide();\n"; - } - + case "select": { + document.getElementById("ppp").style.display = 'none'; + document.getElementById("pppoe").style.display = 'none'; + document.getElementById("pptp").style.display = 'none'; + document.getElementById("interface").style.display = 'none'; + document.getElementById("serialport").style.display = 'none'; + break; } - if ($key == "ppp"){ - echo " $('serialports').show();\n"; - echo " $('ports').hide();\n"; - } else { - if ($key == "select") { - echo " $('ports').hide();\n"; - echo " $('serialports').hide();\n"; - } - else { - echo " $('ports').show();\n"; - echo " $('serialports').hide();\n"; - } + case "ppp": { + document.getElementById("select").style.display = 'none'; + document.getElementById("pppoe").style.display = 'none'; + document.getElementById("pptp").style.display = 'none'; + document.getElementById("interface").style.display = 'none'; + document.getElementById("serialport").style.display = ''; + break; + } + case "pppoe": { + document.getElementById("select").style.display = 'none'; + document.getElementById("ppp").style.display = 'none'; + document.getElementById("pptp").style.display = 'none'; + document.getElementById("interface").style.display = 'none'; + document.getElementById("serialport").style.display = 'none'; + break; + } + case "pptp": { + document.getElementById("select").style.display = 'none'; + document.getElementById("ppp").style.display = 'none'; + document.getElementById("pppoe").style.display = 'none'; + document.getElementById("interface").style.display = 'none'; + document.getElementById("serialport").style.display = 'none'; + break; } - echo " }\n"; - } - ?> } $(t).show(); } - function show_allcfg(obj) { if (obj.checked) $('allcfg').show(); @@ -250,15 +426,15 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" </select> </td> </tr> - <tr style="display:none;" name="ports" id="ports" > + <tr style="display:none" name="interface" id="interface" > <td width="22%" valign="top" class="vncellreq">Member interface(s)</td> <td width="78%" class="vtable"> - <select name="members[]" multiple="true" class="formselect"> + <select name="interfaces[]" multiple="true" class="formselect"> <?php foreach ($portlist as $ifn => $ifinfo) if (is_jumbo_capable($ifn)) { echo "<option value=\"{$ifn}\""; - if ($ifn == $pconfig['if']) + if (stristr($pconfig['interfaces'], $ifn)) echo "selected"; echo ">"; echo htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")"); @@ -269,10 +445,10 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <br/><span class="vexpl">Interfaces participating in the multilink connection.</span> </td> </tr> - <tr style="display:none;" name="serialports" id="serialports"> + <tr style="display:none" name="serialport" id="serialport"> <td width="22%" valign="top" class="vncellreq">Member interface(s)</td> <td width="78%" class="vtable"> - <select name="serport" id="serport" multiple="true" class="formselect"> + <select name="serialports[]" multiple="true" class="formselect"> <?php $serportlist = glob("/dev/cua*"); $modems = glob("/dev/modem*"); @@ -287,19 +463,24 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" } ?> </select> + <br/><span class="vexpl">Serial Ports participating in the multilink connection.</span> + <p/> + <a href='#' onClick='javascript:prefill_att();'>ATT</A> + <a href='#' onClick='javascript:prefill_sprint();'>Sprint</A> + <a href='#' onClick='javascript:prefill_vzw();'>Verizon</A> </td> </tr> <tr> <td valign="top" class="vncell">Username</td> <td class="vtable"> - <input name="username" type="text" class="formfld unknown" id="username" size="10" value="<?=htmlspecialchars($pconfig['username']);?>"> + <input name="username" type="text" class="formfld usr" id="username" size="10" value="<?=htmlspecialchars($pconfig['username']);?>"> </td> </tr> <tr> <td valign="top" class="vncell">Password</td> <td class="vtable"> - <input name="password" type="text" class="formfld unknown" id="password" size="2" value="<?=htmlspecialchars($pconfig['password']);?>"> + <input name="password" type="text" class="formfld pwd" id="password" value="<?=htmlspecialchars($pconfig['password']);?>"> </td> </tr> <tr> @@ -319,7 +500,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <tr> <td valign="top" class="vncell">Idle Timeout</td> <td class="vtable"> - <input name="timeout" type="text" class="formfld unknown" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['timeout']);?>"> + <input name="timeout" type="text" class="formfld unknown" id="timeout" size="6" value="<?=htmlspecialchars($pconfig['idletimeout']);?>"> <br> <span class="vexpl">Idle Timeout goes with the OnDemand selection above. If OnDemand is not checked this is ignored.</span> </td> </tr> @@ -333,28 +514,20 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <tr> <td colspan="2" valign="top" height="16"></td> </tr> - - <tr style="display:none;" name="select" id="select"> + <tr style="display:none" name="select" id="select"> </tr> - <tr style="display:none;" name="ppp" id="ppp"> + <tr style="display:none" name="ppp" id="ppp"> <td colspan="2" style="padding:0px;"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td colspan="2" valign="top" class="listtopic">PPP configuration</td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Pre-fill Settings</td> - <td width="78%" class="vtable"> - <a href='#' onClick='javascript:prefill_att();'>ATT</A> - <a href='#' onClick='javascript:prefill_sprint();'>Sprint</A> - <a href='#' onClick='javascript:prefill_vzw();'>Verizon</A> - </td> - </tr> - <tr> <td width="22%" valign="top" class="vncell">Init String</td> <td width="78%" class="vtable"> - <input type="text" size="40" class="formfld unknown" id="initstr" name="initstr"><?=htmlspecialchars($pconfig['initstr']);?> - <br><span class="vexpl">Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command.</span> + <input type="text" size="40" class="formfld unknown" id="initstr" name="initstr" value="<?=htmlspecialchars($pconfig['initstr']);?>"> + <br><span class="vexpl">Note: Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command. Many modern USB 3G + modems don't need an initialization string.</span> </td> </tr> <tr> @@ -406,7 +579,6 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" </td> </tr> <tr> - <tr> <td width="22%" valign="top" class="vncell">Connection Timeout</td> <td width="78%" class="vtable"> <input name="connect-timeout" type="text" class="formfld unknown" id="connect-timeout" size="2" value="<?=htmlspecialchars($pconfig['connect-timeout']);?>"> @@ -416,7 +588,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" </table> </td> </tr> - <tr style="display:none;" name="pppoe" id="pppoe"> + <tr style="display:none" name="pppoe" id="pppoe"> <td colspan="2" style="padding:0px;"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> @@ -428,11 +600,67 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <br> <span class="vexpl">Hint: this field can usually be left empty</span> </td> </tr> + <tr> + <td width="22%" valign="top" class="vncell"><?=gettext("Periodic reset");?></td> + <td width="78%" class="vtable"> + <input name="pppoe_preset" type="checkbox" id="pppoe_preset" value="yes" <?php if ($pconfig['pppoe_preset']) echo "checked=\"checked\""; ?> onclick="show_periodic_reset(this);" /> + <?= gettext("enable periodic PPPoE resets"); ?> + <br /> + <?php if ($pconfig['pppoe_preset']): ?> + <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%"> + <?php else: ?> + <table id="presetwrap" cellspacing="0" cellpadding="0" width="100%" style="display: none;"> + <?php endif; ?> + <tr> + <td align="left" valign="top"> + <p style="margin: 4px; padding: 4px 0 4px 0; width: 94%;"> + <input name="pppoe_pr_type" type="radio" id="pppoe_pr_custom" value="custom" <?php if ($pconfig['pppoe_pr_custom']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoecustomwrap', { duration: 0.0 }); Effect.Fade('pppoepresetwrap', { duration: 0.0 }); }" /> + <?= gettext("provide a custom reset time"); ?> + <br /> + <input name="pppoe_pr_type" type="radio" id="pppoe_pr_preset" value="preset" <?php if ($pconfig['pppoe_pr_preset']) echo "checked=\"checked\""; ?> onclick="if (this.checked) { Effect.Appear('pppoepresetwrap', { duration: 0.0 }); Effect.Fade('pppoecustomwrap', { duration: 0.0 }); }" /> + <?= gettext("select reset time from a preset"); ?> + </p> + <?php if ($pconfig['pppoe_pr_custom']): ?> + <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoecustomwrap"> + <?php else: ?> + <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoecustomwrap"> + <?php endif; ?> + <input type="text" name="pppoe_resethour" class="fd_incremental_inp_range_0_23 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resethour" value="<?= $pconfig['pppoe_resethour']; ?>" size="3" /> + <?= gettext("hour (0-23)"); ?><br /> + <input type="text" name="pppoe_resetminute" class="fd_incremental_inp_range_0_59 fd_increment_1 fd_classname_dec_buttonDec fd_classname_inc_buttonInc" maxlength="2" id="pppoe_resetminute" value="<?= $pconfig['pppoe_resetminute']; ?>" size="3" /> + <?= gettext("minute (0-59)"); ?><br /> + <input name="pppoe_resetdate" type="text" class="w8em format-m-d-y highlight-days-67" id="pppoe_resetdate" maxlength="10" size="10" value="<?=htmlspecialchars($pconfig['pppoe_resetdate']);?>" /> + <?= gettext("reset at a specific date (mm/dd/yyyy)"); ?> + <br /> <br /> + <span class="red"><strong>Note: </strong></span> + If you leave the date field empty, the reset will be executed each day at the time you did specify using the minutes and hour field. + </p> + <?php if ($pconfig['pppoe_pr_preset']): ?> + <p style="margin: 2px; padding: 4px; width: 94%;" id="pppoepresetwrap"> + <?php else: ?> + <p style="margin: 2px; padding: 4px; width: 94%; display: none;" id="pppoepresetwrap"> + <?php endif; ?> + <input name="pppoe_pr_preset_val" type="radio" id="pppoe_monthly" value="monthly" <?php if ($pconfig['pppoe_monthly']) echo "checked=\"checked\""; ?> /> + <?= gettext("reset at each month ('0 0 1 * *')"); ?> + <br /> + <input name="pppoe_pr_preset_val" type="radio" id="pppoe_weekly" value="weekly" <?php if ($pconfig['pppoe_weekly']) echo "checked=\"checked\""; ?> /> + <?= gettext("reset at each week ('0 0 * * 0')"); ?> + <br /> + <input name="pppoe_pr_preset_val" type="radio" id="pppoe_daily" value="daily" <?php if ($pconfig['pppoe_daily']) echo "checked=\"checked\""; ?> /> + <?= gettext("reset at each day ('0 0 * * *')"); ?> + <br /> + <input name="pppoe_pr_preset_val" type="radio" id="pppoe_hourly" value="hourly" <?php if ($pconfig['pppoe_hourly']) echo "checked=\"checked\""; ?> /> + <?= gettext("reset at each hour ('0 * * * *')"); ?> + </p> + </td> + </tr> + </table> + </td> + </tr> </table> </td> </tr> - - <tr style="display:none;" name="pptp" id="pptp"> + <tr style="display:none" name="pptp" id="pptp"> <td colspan="2" style="padding:0px;"> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> @@ -441,9 +669,9 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <tr> <td width="22%" width="100" valign="top" class="vncellreq">Local IP address</td> <td width="78%" class="vtable"> - <input name="pptp_local" type="text" class="formfld unknown" id="pptp_local" size="20" value="<?=htmlspecialchars($pconfig['pptp_local']);?>"> + <input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>"> / - <select name="pptp_subnet" class="formselect" id="pptp_subnet"> + <select name="subnet" class="formselect" id="subnet"> <?php for ($i = 31; $i > 0; $i--): ?> <option value="<?=$i;?>" <?php if ($i == $pconfig['pptp_subnet']) echo "selected"; ?>> <?=$i;?> @@ -455,7 +683,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <tr> <td width="22%" width="100" valign="top" class="vncellreq">Remote IP address</td> <td width="78%" class="vtable"> - <input name="pptp_remote" type="text" class="formfld unknown" id="pptp_remote" size="20" value="<?=htmlspecialchars($pconfig['pptp_remote']);?>"> + <input name="gateway" type="text" class="formfld unknown" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"> </td> </tr> </table> @@ -465,42 +693,43 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp" <td colspan="2" valign="top" height="16"></td> </tr> <tr> - <td colspan="2" valign="top" class="listtopic">Advanced Options <a href="javascript:swapOptions();" class="navlnk">-</a></td> + <td colspan="2" valign="top" class="listtopic">Advanced Options</td> </tr> - <tr name="advanced" id="postMoreOptions"> - <td colspan="2" style="padding:0px;"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> - <td width="22%" width="100" valign="top" class="vncell">Bandwidth</td> - <td class="vtable"> - <input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> (bits/sec) - <br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> - </td> - </tr> - <tr> - <td width="22%" width="100" valign="top" class="vncell">Link MTU</td> - <td class="vtable"> - <input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> - <br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> - </td> - </tr> - <tr> - <td width="22%" width="100" valign="top" class="vncell">Link MRU</td> - <td class="vtable"> - <input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> - <br> <span class="vexpl">Set Bandwidth for each link if links have different bandwidths, otherwise, leave blank.</span> - </td> - </tr> - </table> + <tr> + <td width="22%" valign="top" class="vncell">Options</td> + <td width="39%" class="vtable"> + <input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>Disable vjcomp(compression). + </td> + <td width="39%" class="vtable"> + <input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>Enable tcpmssfix. </td> </tr> - + <tr> + <td width="22%" width="100" valign="top" class="vncell">Bandwidth</td> + <td width="78%" class="vtable"> + <input name="bandwidth" type="text" class="formfld unknown" id="bandwidth" size="6" value="<?=htmlspecialchars($pconfig['bandwidth']);?>"> (bits/sec) + <br> <span class="vexpl">Set Bandwidth for each link *if* links have different bandwidths, otherwise, leave blank.</span> + </td> + </tr> + <tr> + <td width="22%" width="100" valign="top" class="vncell">Link MTU/MRU</td> + <td width="39%" class="vtable"> + <input name="mtu" type="text" class="formfld unknown" id="mtu" size="6" value="<?=htmlspecialchars($pconfig['mtu']);?>"> + <br> <span class="vexpl">Set MTU for each link if links have different bandwidths, otherwise, leave blank.</span> + </td> + <? /*</tr> + <tr> + <td width="22%" width="100" valign="top" class="vncell">Link MRU</td> */?> + <td width="39%" class="vtable"> + <input name="mru" type="text" class="formfld unknown" id="mru" size="6" value="<?=htmlspecialchars($pconfig['mru']);?>"> + <br> <span class="vexpl">Set MRU for each link separated by commas, otherwise, leave blank.</span> + </td> + </tr> <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input type="hidden" name="mlpppif" value="<?=$pconfig['mlpppif']; ?>"> <input name="Submit" type="submit" class="formbtn" value="Save"> <input type="button" value="Cancel" onclick="history.back()"> - <?php if (isset($id) && $a_mlppps[$id]): ?> + <?php if (isset($id) && $a_ppps[$id]): ?> <input name="id" type="hidden" value="<?=$id;?>"> <?php endif; ?> </td> |