diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-13 14:43:25 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-08-13 14:43:25 -0300 |
commit | 0ac1dafd6f10171941ec1c5d9ac33268d655aef2 (patch) | |
tree | d7880cc1f6e173a4be104dafe4de02c43c0595a1 | |
parent | 6c83f226396e6d95caf5265c715497e6652666e9 (diff) | |
parent | 7d04e4ac60bb6844971e45116a9f4ec936006290 (diff) | |
download | pfsense-0ac1dafd6f10171941ec1c5d9ac33268d655aef2.zip pfsense-0ac1dafd6f10171941ec1c5d9ac33268d655aef2.tar.gz |
Merge remote branch 'mainline/master' into js
-rw-r--r-- | etc/inc/interfaces.inc | 30 | ||||
-rw-r--r-- | etc/phpshellsessions/gitsync | 2 | ||||
-rwxr-xr-x | usr/local/www/interfaces.php | 2 | ||||
-rw-r--r-- | usr/local/www/interfaces_ppps_edit.php | 14 | ||||
-rw-r--r-- | usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js | 5 |
5 files changed, 37 insertions, 16 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index afb8495..97503b8 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -1107,13 +1107,6 @@ function interface_ppps_configure($interface) { break; } } - - /* generate mpd.conf */ - $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); - if (!$fd) { - log_error("Error: cannot open mpd_{$interface}.conf in interface_ppps_configure().\n"); - return 0; - } if (is_array($ports) && count($ports) > 1) $multilink = "enable"; @@ -1295,6 +1288,12 @@ EOD; EOD; + if (!empty($mrrus[$pid])) + $mpdconf .= <<<EOD + set link mrru {$mrrus[$pid]} + +EOD; + $mpdconf .= <<<EOD set auth authname "{$ppp['username']}" set auth password {$passwd} @@ -1362,9 +1361,20 @@ EOD; $mpdconf .= "\topen\r\n"; } //end foreach($port) - // Write out mpd_ppp.conf - fwrite($fd, $mpdconf); - fclose($fd); + + /* Generate mpd.conf. If mpd_[interface].conf exists in the conf path, then link to it instead of generating a fresh conf file. */ + if (file_exists("{$g['conf_path']}/mpd_{$interface}.conf")) + mwexec("/bin/ln -s {$g['conf_path']}/mpd_{$interface}.conf {$g['varetc_path']}/."); + else { + $fd = fopen("{$g['varetc_path']}/mpd_{$interface}.conf", "w"); + if (!$fd) { + log_error("Error: cannot open mpd_{$interface}.conf in interface_ppps_configure().\n"); + return 0; + } + // Write out mpd_ppp.conf + fwrite($fd, $mpdconf); + fclose($fd); + } // Create the uptime log if requested and if it doesn't exist already, or delete it if it is no longer requested. if (isset($ppp['uptime'])) { diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 5e2aead..09cb670 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -21,7 +21,7 @@ global $command_split; unlink_if_exists("/tmp/config.cache"); if(!file_exists("/usr/local/bin/git")) { - echo "Cannot find git, fetching static git..."; + echo "Cannot find git, fetching..."; system("pkg_add -r git"); } diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php index 46ab370..d76d5b4 100755 --- a/usr/local/www/interfaces.php +++ b/usr/local/www/interfaces.php @@ -996,7 +996,7 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp" $('username').setValue(''); $('password').setValue(''); if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") { - $('phone').setValue('*777'); + $('phone').setValue('#777'); $('apn').setValue(''); } else { $('phone').setValue('*99#'); diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index 54c5cb5..d19a377 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -76,7 +76,7 @@ if (isset($id) && $a_ppps[$id]) { $pconfig['bandwidth'] = explode(",",$a_ppps[$id]['bandwidth']); $pconfig['mtu'] = explode(",",$a_ppps[$id]['mtu']); $pconfig['mru'] = explode(",",$a_ppps[$id]['mru']); - $pconfig['mrru'] = $a_ppps[$id]['mrru']; + $pconfig['mrru'] = explode(",",$a_ppps[$id]['mrru']); if (isset($a_ppps[$id]['shortseq'])) $pconfig['shortseq'] = true; if (isset($a_ppps[$id]['acfcomp'])) @@ -340,6 +340,7 @@ if ($_POST) { $ppp['bandwidth'] = implode(',', $port_data['bandwidth']); $ppp['mtu'] = implode(',', $port_data['mtu']); $ppp['mru'] = implode(',', $port_data['mru']); + $ppp['mrru'] = implode(',', $port_data['mrru']); /* handle_pppoe_reset is called here because if user changes Link Type from PPPoE to another type we must be able to clear the config data in the <cron> section of config.xml if it exists @@ -518,7 +519,7 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" <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"><?= gettext("Note: Typically (*99# for GSM networks and *777 for CDMA networks"); ?></span> + <br/><span class="vexpl"><?= gettext("Note: Typically *99# for GSM networks and #777 for CDMA networks"); ?></span> </td> </tr> <tr style="display:none" name="apn_" id="apn_"> @@ -758,7 +759,14 @@ $types = array("select" => gettext("Select"), "ppp" => "PPP", "pppoe" => "PPPoE" <td width="22%" id="mrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRU"); ?></td> <td width="78%" class="vtable"> <input name="mru[]" id="mru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mru'][$i]);?>"> - <br> <span class="vexpl"><?=gettext("MRU will default to 1492.");?></span> + <br> <span class="vexpl"><?=gettext("MRU will be auto-negotiated by default.");?></span> + </td> + </tr> + <tr> + <td width="22%" id="mrrulabel<?=$i;?>" valign="top" class="vncell"> <?=gettext("MRRU"); ?></td> + <td width="78%" class="vtable"> + <input name="mrru[]" id="mrru<?=$i;?>" type="text" class="formfld unknown" size="6" value="<?=htmlspecialchars($pconfig['mrru'][$i]);?>"> + <br> <span class="vexpl"><?=gettext("MRRU will be auto-negotiated by default.");?></span> </td> </tr> </table 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 fe435fb..3072a05 100644 --- a/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js +++ b/usr/local/www/javascript/interfaces_ppps_edit/ppps_edit.js @@ -51,6 +51,7 @@ function show_hide_linkfields(options){ var bwlabel = "bwlabel" + count; var mtu = "mtu" + count; var mru = "mru" + count; + var mrru = "mrru" + count; var ipfields = "ip_fields" + count; var gwfields = "gw_fields" + count; var localip = "localip" + count; @@ -65,6 +66,7 @@ function show_hide_linkfields(options){ $(bw).name = "bandwidth[]"; $(mtu).name = "mtu[]"; $(mru).name = "mru[]"; + $(mrru).name = "mrru[]"; $(localip).name = "localip[]"; $(subnet).name = "subnet[]"; $(gateway).name = "gateway[]"; @@ -76,6 +78,7 @@ function show_hide_linkfields(options){ $(bw).name = "bandwidth[" + options[i].value + "]"; $(mtu).name = "mtu[" + options[i].value + "]"; $(mru).name = "mru[" + options[i].value + "]"; + $(mrru).name = "mrru[" + options[i].value + "]"; $(localiplabel).innerHTML = "Local IP (" + options[i].value + ")"; $(gatewaylabel).innerHTML = "Gateway (" + options[i].value + ")"; $(localip).name = "localip[" + options[i].value + "]"; @@ -227,7 +230,7 @@ function prefill_provider() { $('username').setValue(''); $('password').setValue(''); if(provider.getElementsByTagName('apn')[0].firstChild.data == "CDMA") { - $('phone').setValue('*777'); + $('phone').setValue('#777'); $('apn').setValue(''); } else { $('phone').setValue('*99#'); |