summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-05-19 08:50:48 -0400
committerjim-p <jimp@pfsense.org>2011-05-19 08:50:48 -0400
commit27d0722d13f41c3a569d05588e08dd2b1c18fd43 (patch)
tree3362f1f378d5d64de1446774fcb0b1b06b81c0b4 /usr/local/www
parent62a29fe39e7d579788e97ca05c6266f46fe1f957 (diff)
parent2f6532d55221f86cbc717350eafb8e4404181cbd (diff)
downloadpfsense-27d0722d13f41c3a569d05588e08dd2b1c18fd43.zip
pfsense-27d0722d13f41c3a569d05588e08dd2b1c18fd43.tar.gz
Merge remote branch 'upstream/master'
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/diag_arp.php4
-rwxr-xr-xusr/local/www/interfaces.php2
-rwxr-xr-xusr/local/www/services_captiveportal.php2
-rwxr-xr-xusr/local/www/status_dhcp_leases.php4
-rw-r--r--usr/local/www/status_rrd_graph_img.php42
-rw-r--r--usr/local/www/system_crlmanager.php2
-rwxr-xr-xusr/local/www/xmlrpc.php102
7 files changed, 88 insertions, 70 deletions
diff --git a/usr/local/www/diag_arp.php b/usr/local/www/diag_arp.php
index 3adc2a8..4665a44 100755
--- a/usr/local/www/diag_arp.php
+++ b/usr/local/www/diag_arp.php
@@ -309,8 +309,8 @@ $mac_man = load_mac_manufacturer_table();
<?php
$mac=$entry['mac'];
$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if(isset($mac_man[$mac_hi])){ print "<span title=\"$mac\">{$mac_man[$mac_hi]}</span>"; }
- else{ print $mac; }
+ print $mac;
+ if(isset($mac_man[$mac_hi])){ print "<br/><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>"; }
?>
<td class="listr">
<?php
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 119334e..e001903 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -346,7 +346,7 @@ if ($_POST['apply']) {
log_error("removing old v6 address {$values['ipaddrv6']} on {$realif}");
mwexec("/sbin/ifconfig {$realif} inet6 {$values['ipaddrv6']} -alias");
}
- interface_configure($ifapply, true);
+ interface_reconfigure($ifapply);
} else {
interface_bring_down($ifapply);
}
diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php
index 24595da..23e6cd9 100755
--- a/usr/local/www/services_captiveportal.php
+++ b/usr/local/www/services_captiveportal.php
@@ -263,6 +263,7 @@ function enable_change(enable_change) {
document.iform.freelogins_resettimeout.disabled = endis;
document.iform.freelogins_updatetimeouts.disabled = endis;
document.iform.timeout.disabled = endis;
+ document.iform.preauthurl.disabled = endis;
document.iform.redirurl.disabled = endis;
document.iform.radiusip.disabled = radius_endis;
document.iform.radiusip2.disabled = radius_endis;
@@ -283,6 +284,7 @@ function enable_change(enable_change) {
document.iform.radmac_format.disabled = radius_endis;
document.iform.httpsname.disabled = endis;
document.iform.cert.disabled = endis;
+ document.iform.cacert.disabled = endis;
document.iform.key.disabled = endis;
document.iform.logoutwin_enable.disabled = endis;
document.iform.nomacfilter.disabled = endis;
diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php
index 007c1a8..ba18b72 100755
--- a/usr/local/www/status_dhcp_leases.php
+++ b/usr/local/www/status_dhcp_leases.php
@@ -363,13 +363,13 @@ foreach ($leases as $data) {
$mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
if ($data['online'] != "online") {
if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac - send Wake on LAN packet to this MAC address") ."\">{$mac_man[$mac_hi]}</a>{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac - send Wake on LAN packet to this MAC address") ."\">{$mac}</a><br/><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}&nbsp;</td>\n";
}else{
echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
}
}else{
if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- echo "<td class=\"listr\">{$fspans}<span title=\"$mac\">{$mac_man[$mac_hi]}</span>{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}{$mac}<br/><font size=\"-2\"><i>{$mac_man[$mac_hi]}</i></font>{$fspane}&nbsp;</td>\n";
}else{
echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
}
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index d7e828e..2e2d81d 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -1054,16 +1054,15 @@ elseif((strstr($curdatabase, "-loggedin.rrd")) && (file_exists("$rrddbpath$curda
$graphcmd .= "--start $start --end $end ";
$graphcmd .= "--vertical-label \"Captive Portal Users\" ";
$graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
+ $graphcmd .= "--base=1000 ";
+ $graphcmd .= "--lower-limit=0 ";
+ $graphcmd .= "--slope-mode ";
$graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
$graphcmd .= "--height 200 --width 620 ";
$graphcmd .= "DEF:\"$curif-loggedinusers=$rrddbpath$curdatabase:loggedinusers:AVERAGE\" ";
- $graphcmd .= "LINE2:\"$curif-loggedinusers#{$colorcaptiveportalusers[0]}:$curif-loggedinusers\" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
- $graphcmd .= "COMMENT:\"Users Online\t\" ";
- $graphcmd .= "GPRINT:\"$curif-loggedinusers:LAST:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-loggedinusers:AVERAGE:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-loggedinusers:MAX:%7.2lf \" ";
+ $graphcmd .= "CDEF:\"$curif-totalusers_t=PREV,UN,0,PREV,IF,$curif-loggedinusers,+\" ";
+ $graphcmd .= "AREA:\"$curif-totalusers_t#{$colorcaptiveportalusers[0]}:Total logged in users\" ";
+ $graphcmd .= "GPRINT:\"$curif-totalusers_t:MAX:%8.0lf \\n\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
}
@@ -1074,37 +1073,18 @@ elseif((strstr($curdatabase, "-concurrent.rrd")) && (file_exists("$rrddbpath$cur
$graphcmd .= "--vertical-label \"Captive Portal Users\" ";
$graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
$graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
- $graphcmd .= "--height 200 --width 620 ";
- $graphcmd .= "DEF:\"$curif-concurrentusers=$rrddbpath$curdatabase:concurrentusers:AVERAGE\" ";
- $graphcmd .= "LINE2:\"$curif-concurrentusers#{$colorcaptiveportalusers[0]}:$curif-concurrentusers\" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
- $graphcmd .= "COMMENT:\"Users Online\t\" ";
- $graphcmd .= "GPRINT:\"$curif-concurrentusers:LAST:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-concurrentusers:AVERAGE:%7.2lf \" ";
- $graphcmd .= "GPRINT:\"$curif-concurrentusers:MAX:%7.2lf \" ";
- $graphcmd .= "COMMENT:\"\\n\" ";
- $graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
-}
-elseif((strstr($curdatabase, "-totalusers.rrd")) && (file_exists("$rrddbpath$curdatabase"))) {
- /* define graphcmd for online Captive Portal users stats */
- $graphcmd = "$rrdtool graph $rrdtmppath$curdatabase-$curgraph.png ";
- $graphcmd .= "--start $start --end $end ";
- $graphcmd .= "--vertical-label \"Total Captive Portal Users\" ";
- $graphcmd .= "--color SHADEA#eeeeee --color SHADEB#eeeeee ";
$graphcmd .= "--base=1000 ";
$graphcmd .= "--lower-limit=0 ";
$graphcmd .= "--slope-mode ";
- $graphcmd .= "--title \"`hostname` - {$prettydb} - {$hperiod} - {$havg} average\" ";
$graphcmd .= "--height 200 --width 620 ";
- $graphcmd .= "DEF:\"$curif-totalusers=$rrddbpath$curdatabase:totalusers:AVERAGE\" ";
- $graphcmd .= "AREA:\"$curif-totalusers#{$colorcaptiveportalusers[0]}:$curif-totalusers\" ";
+ $graphcmd .= "DEF:\"$curif-concurrentusers=$rrddbpath$curdatabase:concurrentusers:AVERAGE\" ";
+ $graphcmd .= "AREA:\"$curif-concurrentusers#{$colorcaptiveportalusers[0]}:Concurrent Users\" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t current\t\t average\t maximum\\n\" ";
$graphcmd .= "COMMENT:\"Users Online\t\" ";
- $graphcmd .= "GPRINT:\"$curif-totalusers:LAST:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-totalusers:AVERAGE:%8.0lf \" ";
- $graphcmd .= "GPRINT:\"$curif-totalusers:MAX:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:LAST:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:AVERAGE:%8.0lf \" ";
+ $graphcmd .= "GPRINT:\"$curif-concurrentusers:MAX:%8.0lf \" ";
$graphcmd .= "COMMENT:\"\\n\" ";
$graphcmd .= "COMMENT:\"\t\t\t\t\t\t\t\t\t\t\t\t\t`date +\"%b %d %H\:%M\:%S %Y\"`\" ";
}
diff --git a/usr/local/www/system_crlmanager.php b/usr/local/www/system_crlmanager.php
index 72e795b..1beb75b 100644
--- a/usr/local/www/system_crlmanager.php
+++ b/usr/local/www/system_crlmanager.php
@@ -494,6 +494,7 @@ function method_change() {
</thead>
<tbody>
<?php
+ $caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
// Map CRLs to CAs in one pass
$ca_crl_map = array();
foreach($a_crl as $crl)
@@ -504,7 +505,6 @@ function method_change() {
$name = htmlspecialchars($ca['descr']);
if($ca['prv']) {
- $caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png";
$cainternal = "YES";
} else
$cainternal = "NO";
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index ebb3a24..a732b95 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -158,26 +158,80 @@ function restore_config_section_xmlrpc($raw_params) {
$params = xmlrpc_params_to_php($raw_params);
if(!xmlrpc_auth($params))
return $xmlrpc_g['return']['authfail'];
+
$vipbackup = array();
+ $oldvips = array();
if (isset($params[0]['virtualip'])) {
if(is_array($config['virtualip']['vip'])) {
- foreach ($config['virtualip']['vip'] as $vip)
- interface_vip_bring_down($vip);
+ foreach ($config['virtualip']['vip'] as $vipindex => $vip) {
+ if ($vip['mode'] == "carp")
+ $oldvips[$vip['vhid']] = "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}";
+ else if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip")
+ $vipbackup[] = $vip;
+ }
}
- $vipbackup = $config['virtualip']['vip'];
}
+
// For vip section, first keep items sent from the master
$config = array_merge($config, $params[0]);
- // Then add ipalias and proxyarp types already defined on the backup
- if (is_array($vipbackup)) {
- foreach ($vipbackup as $vip) {
- if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip")
- array_unshift($config['virtualip']['vip'], $vip);
- }
+
+ /* Then add ipalias and proxyarp types already defined on the backup */
+ if (is_array($vipbackup) && !empty($vipbackup)) {
+ if (!is_array($config['virtualip']))
+ $config['virtualip'] = array();
+ if (!is_array($config['virtualip']['vip']))
+ $config['virtualip']['vip'] = array();
+ foreach ($vipbackup as $vip)
+ array_unshift($config['virtualip']['vip'], $vip);
}
+
+ /* Log what happened */
$mergedkeys = implode(",", array_keys($params[0]));
write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
- interfaces_vips_configure();
+
+ /*
+ * The real work on handling the vips specially
+ * This is a copy of intefaces_vips_configure with addition of not reloading existing/not changed carps
+ */
+ if (is_array($config['virtualip']) && is_array($config['virtualip']['vip'])) {
+ $carp_setuped = false;
+ $anyproxyarp = false;
+ foreach ($config['virtualip']['vip'] as $vip) {
+ if (isset($oldvips[$vip['vhid']])) {
+ if ($oldvips[$vip['vhid']] == "{$vip['password']}{$vip['advskew']}{$vip['subnet']}{$vip['subnet_bits']}{$vip['advbase']}") {
+ if (does_interface_exist("vip{$vip['vhid']}"))
+ continue; // Skip reconfiguring this vips since nothing has changed.
+ } else
+ unset($oldvips['vhid']);
+ }
+
+ switch ($vip['mode']) {
+ case "proxyarp":
+ $anyproxyarp = true;
+ break;
+ case "ipalias":
+ interface_ipalias_configure(&$vip);
+ break;
+ case "carp":
+ if ($carp_setuped == false)
+ $carp_setuped = true;
+ interface_carp_configure($vip);
+ break;
+ case "carpdev-dhcp":
+ interface_carpdev_configure($vip);
+ break;
+ }
+ }
+ /* Cleanup remaining old carps */
+ foreach ($oldvips as $oldvipif => $oldvippar) {
+ if (does_interface_exist("vip{$oldvipif}"))
+ pfSense_interface_destroy("vip{$oldvipif}");
+ }
+ if ($carp_setuped == true)
+ interfaces_carp_setup();
+ if ($anyproxyarp == true)
+ interface_proxyarp_configure();
+ }
return $xmlrpc_g['return']['true'];
}
@@ -218,29 +272,7 @@ $merge_config_section_sig = array(
function merge_config_section_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
- $params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
- return $xmlrpc_g['return']['authfail'];
- if (isset($params[0]['virtualip'])) {
- if(is_array($config['virtualip']['vip'])) {
- foreach ($config['virtualip']['vip'] as $vip)
- interface_vip_bring_down($vip);
- }
- $vipbackup = $config['virtualip']['vip'];
- }
- $config = array_merge_recursive_unique($config, $params[0]);
- // Then add ipalias and proxyarp types already defined on the backup
- if (is_array($vipbackup)) {
- foreach ($vipbackup as $vip) {
- if ((($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp')) && substr($vip['interface'], 0, 3) != "vip")
- array_unshift($config['virtualip']['vip'], $vip);
- }
- }
- $mergedkeys = implode(",", array_keys($params[0]));
- write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
- interfaces_vips_configure();
-
- return $xmlrpc_g['return']['true'];
+ return restore_config_section_xmlrpc($raw_params);
}
/*****************************/
@@ -372,6 +404,8 @@ function get_notices_xmlrpc($raw_params) {
return $response;
}
+$xmlrpclockkey = lock('xmlrpc', LOCK_EX);
+
/*****************************/
$server = new XML_RPC_Server(
array(
@@ -412,4 +446,6 @@ $server = new XML_RPC_Server(
)
);
+unlock($xmlrpclockkey);
+
?>
OpenPOWER on IntegriCloud