summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/system_gateways_edit.php8
-rwxr-xr-xusr/local/www/xmlrpc.php58
2 files changed, 46 insertions, 20 deletions
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 8303664..810def7 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -445,7 +445,7 @@ function monitor_change() {
<?=gettext("To");?>
<input name="latencyhigh" type="text" class="formfld unknown" id="latencyhigh" size="2"
value="<?=htmlspecialchars($pconfig['latencyhigh']);?>">
- <br> <span class="vexpl"><?=gettext("These define the low and high water marks for latency in milliseconds.");?></span></td>
+ <br> <span class="vexpl"><?=gettext("These define the low and high water marks for latency in milliseconds. Default is 100/200.");?></span></td>
</td>
</tr>
<tr>
@@ -457,7 +457,7 @@ function monitor_change() {
<?=gettext("To");?>
<input name="losshigh" type="text" class="formfld unknown" id="losshigh" size="2"
value="<?=htmlspecialchars($pconfig['losshigh']);?>">
- <br> <span class="vexpl"><?=gettext("These define the low and high water marks for packet loss in %.");?></span></td>
+ <br> <span class="vexpl"><?=gettext("These define the low and high water marks for packet loss in %. Default is 10/20.");?></span></td>
</td>
</tr>
<tr>
@@ -465,7 +465,7 @@ function monitor_change() {
<td width="78%" class="vtable">
<input name="down" type="text" class="formfld unknown" id="down" size="2"
value="<?=htmlspecialchars($pconfig['down']);?>">
- <br> <span class="vexpl"><?=gettext("This defines the down time for the alarm to fire, in seconds.");?></span></td>
+ <br> <span class="vexpl"><?=gettext("This defines the down time for the alarm to fire in seconds. Default is 10.");?></span></td>
</td>
</tr>
<tr>
@@ -473,7 +473,7 @@ function monitor_change() {
<td width="78%" class="vtable">
<input name="interval" type="text" class="formfld unknown" id="interval" size="2"
value="<?=htmlspecialchars($pconfig['interval']);?>">
- <br> <span class="vexpl"><?=gettext("This defines the frequency in seconds that an icmp probe will be sent. Default is 1 second.");?></span></td>
+ <br> <span class="vexpl"><?=gettext("This defines the frequency that an icmp probe will be sent in seconds. Default is 1.");?></span></td>
</td>
</tr>
</table>
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 2fbf5e3..de0d206 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -84,12 +84,18 @@ $exec_php_sig = array(
)
);
+function xmlrpc_authfail() {
+ log_auth("webConfigurator authentication error for 'admin' from {$_SERVER['REMOTE_ADDR']}");
+}
+
function exec_php_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
$exec_php = $params[0];
eval($exec_php);
if($toreturn) {
@@ -113,8 +119,10 @@ function exec_shell_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
$shell_cmd = $params[0];
mwexec($shell_cmd);
@@ -135,8 +143,10 @@ function backup_config_section_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
$val = array_intersect_key($config, array_flip($params[0]));
return new XML_RPC_Response(XML_RPC_encode($val));
@@ -156,9 +166,10 @@ function restore_config_section_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
-
+ }
$vipbackup = array();
$oldvips = array();
if (isset($params[0]['virtualip'])) {
@@ -262,8 +273,10 @@ function merge_installedpackages_section_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
$config['installedpackages'] = array_merge($config['installedpackages'], $params[0]);
$mergedkeys = implode(",", array_keys($params[0]));
write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
@@ -284,8 +297,10 @@ $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))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
$config_new = array_overlay($config, $params[0]);
$config = $config_new;
$mergedkeys = implode(",", array_keys($params[0]));
@@ -306,8 +321,10 @@ function filter_configure_xmlrpc($raw_params) {
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
filter_configure();
system_routing_configure();
setup_gateways_monitor();
@@ -334,8 +351,10 @@ function interfaces_carp_configure_xmlrpc($raw_params) {
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
interfaces_vips_configure();
return $xmlrpc_g['return']['true'];
@@ -355,9 +374,10 @@ function check_firmware_version_xmlrpc($raw_params) {
global $xmlrpc_g, $XML_RPC_String;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
-
+ }
return new XML_RPC_Response(new XML_RPC_Value(check_firmware_version(false), $XML_RPC_String));
}
@@ -375,9 +395,10 @@ function pfsense_firmware_version_xmlrpc($raw_params) {
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
- return $xmlrpc_g['return']['authfail'];
-
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
+ return $xmlrpc_g['return']['authfail'];
+ }
return new XML_RPC_Response(XML_RPC_encode(host_firmware_version()));
}
@@ -388,8 +409,10 @@ function reboot_xmlrpc($raw_params) {
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params))
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
+ }
mwexec_bg("/etc/rc.reboot");
return $xmlrpc_g['return']['true'];
@@ -410,7 +433,10 @@ function get_notices_xmlrpc($raw_params) {
global $g, $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+ if(!xmlrpc_auth($params)) {
+ xmlrpc_authfail();
+ return $xmlrpc_g['return']['authfail'];
+ }
require("notices.inc");
if(!$params) {
$toreturn = get_notices();
OpenPOWER on IntegriCloud