summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-05-03 10:09:06 +0200
committerSeth Mos <seth.mos@dds.nl>2011-05-03 10:09:06 +0200
commitdcb846e3cd1604ec9c0a024b6bd721d306bbce46 (patch)
tree49624a702780f2714c9141ead186bfe113043550 /usr/local
parent03f824a5e540cb32a025b79ddc29baba4d1ea959 (diff)
parent8c218e1d0190a218686cf2b65913be3198791206 (diff)
downloadpfsense-dcb846e3cd1604ec9c0a024b6bd721d306bbce46.zip
pfsense-dcb846e3cd1604ec9c0a024b6bd721d306bbce46.tar.gz
Merge remote branch 'upstream/master'
Conflicts: usr/local/www/status_rrd_graph_img.php
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/sbin/ppp-linkdown8
-rwxr-xr-xusr/local/sbin/ppp-linkup23
-rwxr-xr-xusr/local/www/interfaces_assign.php2
-rwxr-xr-xusr/local/www/interfaces_qinq.php1
-rwxr-xr-xusr/local/www/interfaces_qinq_edit.php7
-rw-r--r--usr/local/www/status_rrd_graph_img.php44
-rw-r--r--usr/local/www/system_usermanager.php2
7 files changed, 50 insertions, 37 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index 4d4db42..f6a78b9 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -9,7 +9,13 @@ fi
/sbin/pfctl -b $3 -b $4
# delete the node just in case mpd cannot do that
/usr/sbin/ngctl shutdown $1:
-/bin/rm -f /var/etc/nameserver_$1
+if [ -f "/var/etc/nameserver_$1" ]; then
+ # Remove old entries
+ for nameserver in `cat /var/etc/nameserver_$1`; do
+ /sbin/route delete $nameserver >/dev/null 2>&1
+ done
+ /bin/rm -f /var/etc/nameserver_$1
+fi
# Do not remove gateway used during filter reload.
/bin/rm -f /tmp/$1_router
/bin/rm -f /tmp/$1up
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index a9c0f32..94d9b16 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -1,16 +1,19 @@
#!/bin/sh
-# write nameservers to file
-if [ $6 = "dns1" ]; then
- echo $7 > /var/etc/nameserver_$1
- /sbin/route delete $7
- /sbin/route add $7 $4
-fi
+ALLOWOVERRIDE=`/usr/bin/grep dnsallowoverride /conf/config.xml | /usr/bin/wc -l`
+if [ $ALLOWOVERRIDE -gt 0 ]; then
+ # write nameservers to file
+ if [ $6 = "dns1" ]; then
+ echo $7 > /var/etc/nameserver_$1
+ /sbin/route delete $7
+ /sbin/route add $7 $4
+ fi
-if [ $8 = "dns2" ]; then
- echo $9 >> /var/etc/nameserver_$1
- /sbin/route delete $9
- /sbin/route add $9 $4
+ if [ $8 = "dns2" ]; then
+ echo $9 >> /var/etc/nameserver_$1
+ /sbin/route delete $9
+ /sbin/route add $9 $4
+ fi
fi
# let the configuration system know that the ip has changed.
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 5dca193..714feb4 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -441,7 +441,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
} elseif ($portinfo['isgif']) {
- $descr = "GRE {$portinfo['remote-addr']}";
+ $descr = "GIF {$portinfo['remote-addr']}";
if ($portinfo['descr'])
$descr .= " (" . $portinfo['descr'] . ")";
echo htmlspecialchars($descr);
diff --git a/usr/local/www/interfaces_qinq.php b/usr/local/www/interfaces_qinq.php
index 04ac908..5a234a5 100755
--- a/usr/local/www/interfaces_qinq.php
+++ b/usr/local/www/interfaces_qinq.php
@@ -73,6 +73,7 @@ if ($_GET['act'] == "del") {
}
mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}qinq:");
mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}:");
+ mwexec("/sbin/ifconfig {$qinq['vlanif']} destroy");
unset($a_qinqs[$id]);
write_config();
diff --git a/usr/local/www/interfaces_qinq_edit.php b/usr/local/www/interfaces_qinq_edit.php
index 2ffbac9..f47b055 100755
--- a/usr/local/www/interfaces_qinq_edit.php
+++ b/usr/local/www/interfaces_qinq_edit.php
@@ -223,7 +223,7 @@ var newrow = new Array(9999);
var rowsize = new Array(9999);
for (i = 0; i < 9999; i++) {
- rowname[i] = '';
+ rowname[i] = 'members';
rowtype[i] = 'select';
newrow[i] = '';
rowsize[i] = '30';
@@ -362,12 +362,11 @@ function removeRow(el) {
if ($members <> "") {
$item = explode(" ", $members);
foreach($item as $ww) {
- $members = $item[$counter];
- $tracker = $counter;
+ $member = $item[$counter];
?>
<tr>
<td class="vtable">
- <input name="members<?php echo $tracker; ?>" class="formselect" id="members<?php echo $tracker; ?>" value="<? echo $members;?>">
+ <input name="members<?php echo $counter; ?>" class="formselect" id="members<?php echo $counter; ?>" value="<? echo $member;?>">
</td>
<td>
<a onclick="removeRow(this); return false;" href="#"><img border="0" src="/themes/<?echo $g['theme'];?>/images/icons/icon_x.gif" /></a>
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 553a629..d7e828e 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -186,31 +186,34 @@ if ($altq_list_queues[$curif]) {
$speedlimit = ($upstream + $downstream);
+/* Set default colors explicity, the theme can then override them below.
+ This prevents missing colors in themes from crashing the graphs. */
+$colortrafficup = array("666666", "CCCCCC", "b36666", "bd9090");
+$colortrafficdown = array("990000", "CC0000", "b36666", "bd9090");
+$colorpacketsup = array("666666", "CCCCCC", "b36666", "bd9090");
+$colorpacketsdown = array("990000", "CC0000", "b36666", "bd9090");
+$colortraffic95 = array("660000", "FF0000");
+$colorstates = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+$colorprocessor = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+$colormemory = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+$colorqueuesup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
+$colorqueuesdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
+$colorqueuesdropup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
+$colorqueuesdropdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
+$colorqualityrtt = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
+$colorqualityloss = "ee0000";
+$colorwireless = array('333333','a83c3c','999999');
+$colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
+$colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
+$colorvpnusers = array('990000');
+$colorcaptiveportalusers = array('990000');
+
/* select theme colors if the inclusion file exists */
$rrdcolors = "{$g['www_path']}/themes/{$g['theme']}/rrdcolors.inc.php";
if(file_exists($rrdcolors)) {
include($rrdcolors);
} else {
log_error(sprintf(gettext("rrdcolors.inc.php for theme %s does not exist, using defaults!"),$g['theme']));
- $colortrafficup = array("666666", "CCCCCC", "b36666", "bd9090");
- $colortrafficdown = array("990000", "CC0000", "b36666", "bd9090");
- $colorpacketsup = array("666666", "CCCCCC", "b36666", "bd9090");
- $colorpacketsdown = array("990000", "CC0000", "b36666", "bd9090");
- $colortraffic95 = array("660000", "FF0000");
- $colorstates = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
- $colorprocessor = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
- $colormemory = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
- $colorqueuesup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
- $colorqueuesdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
- $colorqueuesdropup = array('000000','7B0000','990000','BB0000','CC0000','D90000','EE0000','FF0000','CC0000');
- $colorqueuesdropdown = array('000000','7B7B7B','999999','BBBBBB','CCCCCC','D9D9D9','EEEEEE','FFFFFF','CCCCCC');
- $colorqualityrtt = array('990000','a83c3c','b36666','bd9090','cccccc','000000');
- $colorqualityloss = "ee0000";
- $colorwireless = array('333333','a83c3c','999999');
- $colorspamdtime = array('DDDDFF', 'AAAAFF', 'DDDDFF', '000066');
- $colorspamdconn = array('00AA00BB', 'FFFFFFFF', '00660088', 'FFFFFF88', '006600');
- $colorvpnusers = array('990000');
- $colorcaptiveportalusers = array('990000');
}
switch ($curstyle) {
@@ -351,7 +354,8 @@ if((strstr($curdatabase, "-traffic.rrd")) && (file_exists("$rrddbpath$curdatabas
$graphcmd .= "CDEF:\"$curif-bytes_t6=$curif-bytes_in6_t_pass,$curif-bytes_out6_t_block,+\" ";
$graphcmd .= "VDEF:\"$curif-in_bits_95=$curif-in_bits,95,PERCENT\" ";
$graphcmd .= "CDEF:\"$curif-out_bits_mul=$curif-out_bits,$multiplier,*\" ";
- $graphcmd .= "VDEF:\"$curif-out_bits_95=$curif-out_bits_mul,95,PERCENT\" ";
+ $perc = $multiplier > 0 ? "95" : "5";
+ $graphcmd .= "VDEF:\"$curif-out_bits_95=$curif-out_bits_mul,{$perc},PERCENT\" ";
$graphcmd .= "AREA:\"$curif-in_bits_block#{$colortrafficdown[1]}:$curif-in-block\" ";
$graphcmd .= "AREA:\"$curif-in_bits_pass#{$colortrafficdown[0]}:$curif-in-pass:STACK\" ";
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php
index cdc4078..d810cb9 100644
--- a/usr/local/www/system_usermanager.php
+++ b/usr/local/www/system_usermanager.php
@@ -897,7 +897,7 @@ function sshkeyClicked(obj) {
if (!$input_errors) {
// all values are okay --> saving changes
$config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]['password'] = crypt(trim($_POST['passwordfld1']));
-
+ local_user_set($config['system']['user'][$userindex[$HTTP_SERVER_VARS['AUTH_USER']]]);
write_config();
$savemsg = gettext("Password successfully changed") . "<br />";
}
OpenPOWER on IntegriCloud