summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-05-08 11:12:52 +0700
committergnhb <gnoahb@gmail.com>2010-05-08 11:12:52 +0700
commita986f97f900b54b509776d366cd2834aca73f489 (patch)
tree8d52d863ecc643e4b9c6b65f5a7a0e048f458166 /usr/local
parent64d124c5682718bbc6c4abd1a658d290cce53cc1 (diff)
downloadpfsense-a986f97f900b54b509776d366cd2834aca73f489.zip
pfsense-a986f97f900b54b509776d366cd2834aca73f489.tar.gz
Working on PPPoE periodic reset. Writing out pppoe_restart_XXX file still needs work.
Diffstat (limited to 'usr/local')
-rw-r--r--usr/local/www/interfaces_ppps_edit.php277
-rw-r--r--usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js13
2 files changed, 150 insertions, 140 deletions
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
index 9bfa2c4..47c2901 100644
--- a/usr/local/www/interfaces_ppps_edit.php
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -43,7 +43,7 @@
require("guiconfig.inc");
-define("CRON_PPPOE_CMD_FILE", "/conf/pppoe{$if}restart");
+define("CRON_PPPOE_CMD_FILE", "{$g['varetc_path']}/ppp_restart_");
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
define("CRON_DAILY_PATTERN", "0 0 * * *");
@@ -61,7 +61,7 @@ function getMPDCRONSettings() {
if (is_array($config['cron']['item'])) {
for ($i = 0; $i < count($config['cron']['item']); $i++) {
$item = $config['cron']['item'][$i];
- if (strpos($item['command'], CRON_PPPOE_CMD_FILE) !== false) {
+ if (strpos($item['command'], CRON_PPPOE_CMD_FILE.$_POST['ptpid']) !== false) {
return array("ID" => $i, "ITEM" => $item);
}
}
@@ -133,8 +133,9 @@ if (isset($id) && $a_ppps[$id]) {
/* ================================================ */
if (isset($a_ppps[$id]['pppoe-reset-type'])) {
+ $pconfig['pppoe-reset-type'] = $a_ppps[$id]['pppoe-reset-type'];
+
$resetTime = getMPDResetTimeFromConfig();
- $pconfig['pppoe_preset'] = true;
if ($a_ppps[$id]['pppoe-reset-type'] == "custom") {
$resetTime_a = split(" ", $resetTime);
$pconfig['pppoe_pr_custom'] = true;
@@ -178,8 +179,8 @@ if ($_POST) {
* data validation procedure below, may trigger a false error
* message.
*/
- if (empty($_POST['pppoe_preset'])) {
- unset($_POST['pppoe_pr_type']);
+ if (empty($_POST['pppoe-reset-type'])) {
+ //unset($_POST['pppoe-reset-type']);
unset($_POST['pppoe_resethour']);
unset($_POST['pppoe_resetminute']);
unset($_POST['pppoe_resetdate']);
@@ -225,14 +226,23 @@ if ($_POST) {
$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']) &&
+ if ($_POST['pppoe-reset-type'] == "custom" && $_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']) &&
+ if ($_POST['pppoe-reset-type'] == "custom" && $_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'])))
+ if ($_POST['pppoe-reset-type'] == "custom" && $_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['pppoe-reset-type'] == "custom" && $_POST['pppoe_resetdate'] <> "" && is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))){
+ $date_nums = explode("/",$_POST['pppoe_resetdate']);
+ if ($date_nums[0] < 1 || $date_nums[0] > 12)
+ $input_errors[] = gettext("A valid PPPoE reset month must be specified (1-12) in the Custom PPPoE Periodic reset fields.");
+ if ($date_nums[1] < 1 || $date_nums[1] > 31)
+ $input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
+ if ($date_nums[2] < date("Y"))
+ $input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
+ }
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'])))
@@ -320,6 +330,10 @@ if ($_POST) {
$ppp['provider'] = $_POST['provider'];
else
unset($ppp['provider']);
+ if (!empty($_POST['pppoe-reset-type']))
+ $ppp['pppoe-reset-type'] = $_POST['pppoe-reset-type'];
+ else
+ unset($ppp['pppoe-reset-type']);
handle_pppoe_reset();
break;
case "pptp":
@@ -332,7 +346,7 @@ if ($_POST) {
}
/* reset cron items if necessary */
- if (empty($_POST['pppoe_preset'])) {
+ if (empty($_POST['pppoe-reset-type'])) {
/* test whether a cron item exists and unset() it if necessary */
$itemhash = getMPDCRONSettings();
$item = $itemhash['ITEM'];
@@ -380,24 +394,23 @@ if ($_POST) {
} // end if($_POST)
function handle_pppoe_reset() {
- global $_POST, $config, $g, $ppp, $if;
+ global $_POST, $config, $g;
/* perform a periodic reset? */
- if(!isset($_POST['pppoe_preset'])) {
- setup_pppoe_reset_file($if, false);
+ if(empty($_POST['pppoe-reset-type'])) {
+ setup_pppoe_reset_file($_POST['ptpid'], false);
return;
}
+
if (!is_array($config['cron']['item']))
$config['cron']['item'] = array();
$itemhash = getMPDCRONSettings();
$item = $itemhash['ITEM'];
if (empty($item))
$item = array();
- if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] == "custom") {
- $ppp['pppoe-reset-type'] = "custom";
- $pconfig['pppoe_pr_custom'] = true;
+ if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "custom") {
$item['minute'] = $_POST['pppoe_resetminute'];
$item['hour'] = $_POST['pppoe_resethour'];
- if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "" && strlen($_POST['pppoe_resetdate']) == 10) {
+ if (isset($_POST['pppoe_resetdate']) && $_POST['pppoe_resetdate'] <> "") {
$date = explode("/", $_POST['pppoe_resetdate']);
$item['mday'] = $date[1];
$item['month'] = $date[0];
@@ -407,10 +420,8 @@ function handle_pppoe_reset() {
}
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
- } else if (isset($_POST['pppoe_pr_type']) && $_POST['pppoe_pr_type'] = "preset") {
- $ppp['pppoe-reset-type'] = "preset";
- $pconfig['pppoe_pr_preset'] = true;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
+ } else if (isset($_POST['pppoe-reset-type']) && $_POST['pppoe-reset-type'] == "preset") {
switch ($_POST['pppoe_pr_preset_val']) {
case "monthly":
$item['minute'] = "0";
@@ -419,7 +430,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "weekly":
$item['minute'] = "0";
@@ -428,7 +439,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "0";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "daily":
$item['minute'] = "0";
@@ -437,7 +448,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "hourly":
$item['minute'] = "0";
@@ -446,32 +457,28 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
} // end switch
- } // end if
+ }// end if
if (isset($itemhash['ID']))
$config['cron']['item'][$itemhash['ID']] = $item;
else
$config['cron']['item'][] = $item;
- /* finally install the pppoerestart file */
- if (isset($_POST['pppoe_preset'])) {
- setup_pppoe_reset_file($if, true);
- //$ppp['pppoe_reset'] = true;
- $ppp['pppoe_preset'] = true;
+
+ // finally install the pppoerestart file
+ if (isset($_POST['pppoe-reset-type'])) {
+ setup_pppoe_reset_file($_POST['ptpid'], true);
sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
- } else {
- //unset($ppp['pppoe_reset']);
- unset($ppp['pppoe_preset']);
- setup_pppoe_reset_file($if, false);
- }
+ } else
+ setup_pppoe_reset_file($_POST['ptpid'], false);
}
$closehead = false;
$pgtitle = array("Interfaces","PPPs","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"*/ );
?>
<script type="text/javascript" >
@@ -484,10 +491,10 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<form action="interfaces_ppps_edit.php" method="post" name="iform" id="iform">
<table id="interfacetable" width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">PPPs configuration</td>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPPs configuration"); ?></td>
</tr>
<tr>
- <td valign="middle" class="vncell"><strong>Link Type</strong></td>
+ <td valign="middle" class="vncell"><strong><?= gettext("Link Type"); ?></strong></td>
<td class="vtable">
<select name="type" onChange="updateType(this.value);" class="formselect" id="type">
<?php
@@ -502,15 +509,15 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
</td>
</tr>
<tr name="interface" id="interface" >
- <td width="22%" valign="top" class="vncellreq">Link interface(s)</td>
+ <td width="22%" valign="top" class="vncellreq"><?= gettext("Link interface(s)"); ?></td>
<td width="78%" class="vtable">
<select valign="top" name="interfaces[]" multiple="true" class="formselect" size="4" onChange="show_hide_linkfields();">
<option></option>
</select>
- <a href='#' onClick='javascript:clear_selected("interfaces[]");'>Click here</a> to clear selection(s).
- <br/><span class="vexpl">Interfaces or ports participating in the multilink connection.</span>
+ <a href='#' onClick='javascript:clear_selected("interfaces[]");'><?= gettext("Click here"); ?></a> <?= gettext("to clear selection(s)."); ?>
+ <br/><span class="vexpl"><?= gettext("Interfaces or ports participating in the multilink connection."); ?></span>
<span style="display:none" id="prefil_ppp">
- <p/>Click a link to fill in defaults for these carriers:&nbsp;
+ <p/><?= gettext("Click a link to fill in defaults for these carriers:"); ?>&nbsp;
<a href='#' onClick='javascript:prefill_att();'>ATT</A>
<a href='#' onClick='javascript:prefill_sprint();'>Sprint</A>
<a href='#' onClick='javascript:prefill_vzw();'>Verizon</A>
@@ -547,56 +554,55 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
echo ",|";
}
echo $port_count;
- if ($serport_count > $port_count)
- $port_count=$serport_count;
?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Username</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Username"); ?></td>
<td width="78%" class="vtable">
<input name="username" type="text" class="formfld usr" id="username" size="20" value="<?=htmlspecialchars($pconfig['username']);?>">
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Password</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Password"); ?></td>
<td width="78%" class="vtable">
<input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>">
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Gateway</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Gateway"); ?></td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>>This link will be used as the default gateway.
+ <input type="checkbox" value="on" id="defaultgw" name="defaultgw" <?php if (isset($pconfig['defaultgw'])) echo "checked"; ?>><?= gettext("This link will be used as the default gateway."); ?>
+ <br/><span class="vexpl"><?= gettext("\"Allow DNS Server list to be overridden\" must also be checked in the System -> General Setup menu."); ?>
</td>
</tr>
<tr>
- <td valign="top" class="vncell">Dial On Demand</td>
+ <td valign="top" class="vncell"><?= gettext("Dial On Demand"); ?></td>
<td class="vtable">
- <input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked"; ?>> Enable Dial-on-Demand mode
- <br/> <span class="vexpl">This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection.
- The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected. </span>
+ <input type="checkbox" value="on" id="ondemand" name="ondemand" <?php if (isset($pconfig['ondemand'])) echo "checked"; ?>> <?= gettext("Enable Dial-on-Demand mode"); ?>
+ <br/> <span class="vexpl"><?= gettext("This option causes the interface to operate in dial-on-demand mode, allowing you to have a virtual full time connection.
+ The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected."); ?> </span>
</td>
</tr>
<tr>
- <td valign="top" class="vncell">Idle Timeout</td>
+ <td valign="top" class="vncell"><?= gettext("Idle Timeout"); ?></td>
<td class="vtable">
- <input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>"> (seconds) <bold>Default is 0, which disables the timeout feature.</bold>
- <br/> <span class="vexpl">If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.
- <br/>When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed.</span>
+ <input name="idletimeout" type="text" class="formfld unknown" id="idletimeout" size="12" value="<?=htmlspecialchars($pconfig['idletimeout']);?>"> <?= gettext("(seconds) Default is 0, which disables the timeout feature."); ?>
+ <br/> <span class="vexpl"><?= gettext("If no incoming or outgoing packets are transmitted for the entered number of seconds the connection is brought down.
+ <br/>When the idle timeout occurs, if the dial-on-demand option is enabled, mpd goes back into dial-on-demand mode. Otherwise, the interface is brought down and all associated routes removed."); ?></span>
</td>
</tr>
<tr>
- <td valign="top" class="vncell">Uptime Logging</td>
+ <td valign="top" class="vncell"><?= gettext("Uptime Logging"); ?></td>
<td class="vtable">
- <input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked"; ?>> Enable persistent logging of connection uptime.
- <br/> <span class="vexpl">This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page.</span>
+ <input type="checkbox" value="on" id="uptime" name="uptime" <?php if (isset($pconfig['uptime'])) echo "checked"; ?>> <?= gettext("Enable persistent logging of connection uptime."); ?>
+ <br/> <span class="vexpl"><?= gettext("This option causes cumulative uptime to be recorded and displayed on the Status Interfaces page."); ?></span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Description</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
- <br/> <span class="vexpl">You may enter a description here for your reference (not parsed).</span>
+ <br/> <span class="vexpl"><?= gettext("You may enter a description here for your reference. Description will appear in the \"Interfaces Assign\" select lists."); ?></span>
</td>
</tr>
<tr>
@@ -608,54 +614,54 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<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>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPP configuration"); ?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Init String</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Init String"); ?></td>
<td width="78%" class="vtable">
<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>
+ <br/><span class="vexpl"><?= gettext("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>
- <td width="22%" valign="top" class="vncell">Sim PIN</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN"); ?></td>
<td width="78%" class="vtable">
<input name="simpin" type="text" class="formfld unknown" id="simpin" size="12" value="<?=htmlspecialchars($pconfig['simpin']);?>">
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Sim PIN wait</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Sim PIN wait"); ?></td>
<td width="78%" class="vtable">
<input name="pin-wait" type="text" class="formfld unknown" id="pin-wait" size="2" value="<?=htmlspecialchars($pconfig['pin-wait']);?>">
- <br/><span class="vexpl">Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds).</span>
+ <br/><span class="vexpl"><?= gettext("Note: Time to wait for SIM to discover network after PIN is sent to SIM (seconds)."); ?></span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Access Point Name (APN)</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Access Point Name (APN)"); ?></td>
<td width="78%" class="vtable">
<input name="apn" type="text" class="formfld unknown" id="apn" size="40" value="<?=htmlspecialchars($pconfig['apn']);?>">
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">APN number (optional)</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("APN number (optional)"); ?></td>
<td width="78%" class="vtable">
<input name="apnum" type="text" class="formfld unknown" id="apnum" size="2" value="<?=htmlspecialchars($pconfig['apnum']);?>">
- <br/><span class="vexpl">Note: Defaults to 1 if you set APN above. Ignored if you set no APN above.</span>
+ <br/><span class="vexpl"><?= gettext("Note: Defaults to 1 if you set APN above. Ignored if you set no APN above."); ?></span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Phone Number</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Phone Number"); ?></td>
<td width="78%" class="vtable">
<input name="phone" type="text" class="formfld unknown" id="phone" size="40" value="<?=htmlspecialchars($pconfig['phone']);?>">
- <br/><span class="vexpl">Note: Typically (*99# or *99***# or *99***1#) for GSM networks and *777 for CDMA networks</span>
+ <br/><span class="vexpl"><?= gettext("Note: Typically (*99# or *99***# or *99***1#) for GSM networks and *777 for CDMA networks"); ?></span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Connection Timeout</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("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']);?>">
- <br/><span class="vexpl">Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec.</span>
+ <br/><span class="vexpl"><?= gettext("Note: Enter timeout in seconds for connection to be established (sec.) Default is 45 sec."); ?></span>
</td>
</tr>
</table>
@@ -665,66 +671,57 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">PPPoE configuration</td>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPPoE configuration"); ?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Service name</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Service name"); ?></td>
<td width="78%" class="vtable"><input name="provider" type="text" class="formfld unknown" id="provider" size="20" value="<?=htmlspecialchars($pconfig['provider']);?>">
- <br/> <span class="vexpl">Hint: this field can usually be left empty</span>
+ <br/> <span class="vexpl"><?= gettext("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"; ?> onclick="show_more_settings(this,presetwrap);" />
- <?= 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 />&nbsp;<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>
+ <select valign="top" id="reset_type" name="pppoe-reset-type" class="formselect" onChange="show_reset_settings(this.value);">
+ <option value = ""><?= gettext("Disabled"); ?></option><option value="custom" <?php if ($pconfig['pppoe-reset-type'] == "custom") echo "selected"; ?>><?= gettext("Custom"); ?></option><option value="preset" <?php if ($pconfig['pppoe-reset-type'] == "preset") echo "selected"; ?>><?= gettext("Pre-set"); ?></option>
+ </select> <?= gettext("Select a reset timing type"); ?>
+ </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 />&nbsp;<br />
+ <span class="red"><strong>Note: </strong></span>
+ <?= gettext("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>
@@ -737,7 +734,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td colspan="2" valign="top" class="listtopic">PPTP configuration</td>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("PPTP configuration"); ?></td>
</tr>
</table>
</td>
@@ -746,7 +743,7 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<td colspan="2" style="padding:0px;">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
- <td width="22%" valign="top" class="vncell">Local IP address</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Local IP address"); ?></td>
<td width="78%" class="vtable">
<input name="localip" type="text" class="formfld unknown" id="localip" size="20" value="<?=htmlspecialchars($pconfig['localip']);?>">
/
@@ -755,14 +752,14 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<option value="<?=$i;?>"<?php if ($i == $pconfig['subnet']) echo "selected"; ?>><?=$i;?></option>
<?php endfor; ?>
</select>
- <br><span class="vexpl">Note: Local IP/subnet is required for PPTP connections. LocalIP is automatically assigned for PPP links if this field is empty.</span>
+ <br><span class="vexpl"><?= gettext("Note: Local IP/subnet is required for PPTP connections. LocalIP is automatically assigned for PPP links if this field is empty."); ?></span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Remote IP (Gateway)</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Remote IP (Gateway)"); ?></td>
<td width="78%" class="vtable">
<input name="gateway" type="text" class="formfld unknown" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>">
- <br><span class="vexpl">Note: This is where the packets will be routed. Remote IP is required for PPTP connections. Remote IP is automatically assigned for PPP links if this field is empty.</span>
+ <br><span class="vexpl"><?= gettext("Note: This is where the packets will be routed. Remote IP is required for PPTP connections. Remote IP is automatically assigned for PPP links if this field is empty."); ?></span>
</td>
</tr>
</table>
@@ -771,21 +768,21 @@ $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</td>
+ <td colspan="2" valign="top" class="listtopic"><?= gettext("Advanced Options"); ?></td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">Compression</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("Compression"); ?></td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked"; ?>>&nbsp;Disable vjcomp(compression) (enabled by default).
+ <input type="checkbox" value="on" id="vjcomp" name="vjcomp" <?php if (isset($pconfig['vjcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable vjcomp(compression) (enabled by default)."); ?>
<br/> <span class="vexpl">This option enables Van Jacobson TCP header compression, which saves several bytes per TCP data packet.
You almost always want this option. This compression ineffective for TCP connections with enabled modern extensions like time
stamping or SACK, which modify TCP options between sequential packets.</span>
</td>
</tr>
<tr>
- <td width="22%" valign="top" class="vncell">TCPmssFix</td>
+ <td width="22%" valign="top" class="vncell"><?= gettext("TCPmssFix"); ?></td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked"; ?>>&nbsp;Enable tcpmssfix (disabled by default).
+ <input type="checkbox" value="on" id="tcpmssfix" name="tcpmssfix" <?php if (isset($pconfig['tcpmssfix'])) echo "checked"; ?>>&nbsp;<?= gettext("Enable tcpmssfix (disabled by default)."); ?>
<br/> <span class="vexpl">This option causes mpd to adjust incoming and outgoing TCP SYN segments so that the requested maximum segment size is not greater than the amount
allowed by the interface MTU. This is necessary in many setups to avoid problems caused by routers that drop ICMP Datagram Too Big messages. Without these messages,
the originating machine sends data, it passes the rogue router then hits a machine that has an MTU that is not big enough for the data. Because the IP Don't Fragment option is set,
@@ -796,23 +793,23 @@ $types = array("select" => "Select", "ppp" => "PPP", "pppoe" => "PPPoE", "pptp"
<tr>
<td width="22%" valign="top" class="vncell">ShortSeq</td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked"; ?>>&nbsp;Disable shortseq (enabled by default).
- <br/> <span class="vexpl">This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame.
- It is not necessary to disable this for connections that are not multi-link.</span>
+ <input type="checkbox" value="on" id="shortseq" name="shortseq" <?php if (isset($pconfig['shortseq'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable shortseq (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("This option is only meaningful if multi-link PPP is negotiated. It proscribes shorter multi-link fragment headers, saving two bytes on every frame.
+ It is not necessary to disable this for connections that are not multi-link."); ?></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">ACFComp</td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked"; ?>>&nbsp;Disable acfcomp(compression) (enabled by default).
- <br/> <span class="vexpl">Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame.</span>
+ <input type="checkbox" value="on" id="acfcomp" name="acfcomp" <?php if (isset($pconfig['acfcomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable acfcomp(compression) (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("Address and control field compression. This option only applies to asynchronous link types. It saves two bytes per frame."); ?></span>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">ProtoComp</td>
<td width="78%" class="vtable">
- <input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked"; ?>>&nbsp;Disable protocomp(compression) (enabled by default).
- <br/> <span class="vexpl">Protocol field compression. This option saves one byte per frame for most frames.</span>
+ <input type="checkbox" value="on" id="protocomp" name="protocomp" <?php if (isset($pconfig['protocomp'])) echo "checked"; ?>>&nbsp;<?= gettext("Disable protocomp(compression) (enabled by default)."); ?>
+ <br/> <span class="vexpl"><?= gettext("Protocol field compression. This option saves one byte per frame for most frames."); ?></span>
</td>
</tr>
diff --git a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
index a63bde0..52bff7d 100644
--- a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
+++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js
@@ -79,6 +79,19 @@ function show_more_settings(checkbox_obj,element_id) {
$(element_id).hide();
}
+function show_reset_settings(reset_type) {
+ if (reset_type == 'preset') {
+ Effect.Appear('pppoepresetwrap', { duration: 0.0 });
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ }
+ else if (reset_type == 'custom') {
+ Effect.Appear('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ } else {
+ Effect.Fade('pppoecustomwrap', { duration: 0.0 });
+ Effect.Fade('pppoepresetwrap', { duration: 0.0 });
+ }
+}
function prefill_att() {
$('initstr').value = "Q0V1E1S0=0&C1&D2+FCLASS=0";
$('apn').value = "ISP.CINGULAR";
OpenPOWER on IntegriCloud