summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorVinicius Coque <vinicius.coque@bluepex.com>2010-12-14 10:03:36 -0200
committerVinicius Coque <vinicius.coque@bluepex.com>2010-12-14 10:03:36 -0200
commitd299e102a700a88fb3e370d9dfcda295574ade06 (patch)
treebb00b71175bd156dfeb9f5939d845df7dc0e5277 /usr/local/www
parentca98b042b87cd3780900c2a5a937afecdf3c523d (diff)
parentc9b08a50f0ba328ac0569247eb2063d34f7e6279 (diff)
downloadpfsense-d299e102a700a88fb3e370d9dfcda295574ade06.zip
pfsense-d299e102a700a88fb3e370d9dfcda295574ade06.tar.gz
Merge remote branch 'mainline/master'
Conflicts: usr/local/www/fbegin.inc
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/carp_status.php1
-rwxr-xr-xusr/local/www/fbegin.inc4
-rwxr-xr-xusr/local/www/firewall_nat_1to1.php24
-rwxr-xr-xusr/local/www/firewall_rules_edit.php4
-rwxr-xr-xusr/local/www/firewall_virtual_ip_edit.php60
-rwxr-xr-xusr/local/www/interfaces.php16
-rw-r--r--usr/local/www/interfaces_gif_edit.php3
-rw-r--r--usr/local/www/interfaces_gre_edit.php3
-rw-r--r--usr/local/www/interfaces_lagg_edit.php2
-rwxr-xr-xusr/local/www/pkg_edit.php13
-rwxr-xr-xusr/local/www/status_lb_vs.php2
-rwxr-xr-xusr/local/www/system_usermanager_settings.php11
-rwxr-xr-xusr/local/www/vpn_ipsec.php5
-rw-r--r--usr/local/www/vpn_ipsec_phase1.php5
-rw-r--r--usr/local/www/vpn_openvpn_client.php4
-rw-r--r--usr/local/www/vpn_openvpn_server.php4
-rw-r--r--usr/local/www/widgets/widgets/traffic_graphs.widget.php2
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard.inc9
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard.xml12
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_dedicated.inc10
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_dedicated.xml12
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.inc10
-rwxr-xr-xusr/local/www/wizards/traffic_shaper_wizard_multi_all.xml12
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc14
-rw-r--r--usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml12
-rwxr-xr-xusr/local/www/xmlrpc.php288
26 files changed, 282 insertions, 260 deletions
diff --git a/usr/local/www/carp_status.php b/usr/local/www/carp_status.php
index 139358d..187736b 100755
--- a/usr/local/www/carp_status.php
+++ b/usr/local/www/carp_status.php
@@ -154,6 +154,7 @@ include("head.inc");
$netmask = $carp['subnet_bits'];
$vhid = $carp['vhid'];
$advskew = $carp['advskew'];
+ $advbase = $carp['advbase'];
$carp_int = "vip{$vhid}";
$status = get_carp_interface_status($carp_int);
echo "<tr>";
diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc
index c124cdb..45a14a2 100755
--- a/usr/local/www/fbegin.inc
+++ b/usr/local/www/fbegin.inc
@@ -170,9 +170,9 @@ $ifentries = get_configured_interface_with_descr();
foreach ($ifentries as $ent => $entdesc) {
if (is_array($config['interfaces'][$ent]['wireless']) &&
preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
- $ifdescrs[$ent] = $entdesc;
+ $wifdescrs[$ent] = $entdesc;
}
-if (count($ifdescrs) > 0)
+if (count($wifdescrs) > 0)
$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0);
diff --git a/usr/local/www/firewall_nat_1to1.php b/usr/local/www/firewall_nat_1to1.php
index 94132f2..306c811 100755
--- a/usr/local/www/firewall_nat_1to1.php
+++ b/usr/local/www/firewall_nat_1to1.php
@@ -114,27 +114,43 @@ include("head.inc");
</table>
</td>
</tr>
- <?php $i = 0; foreach ($a_1to1 as $natent): ?>
+ <?php
+ $textse = "</span>";
+
+ $i = 0; foreach ($a_1to1 as $natent):
+
+ if (isset($natent['disabled']))
+ $textss = "<span class=\"gray\">";
+ else
+ $textss = "<span>"; ?>
<tr>
<td class="listlr" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
<?php
+ echo $textss;
if (!$natent['interface'])
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr("wan"));
else
echo htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface']));
+ echo $textse;
?>
</td>
<td class="listr" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
- <?php echo $natent['external']; ?>
+ <?php
+ $source_net = pprint_address($natent['source']);
+ $source_cidr = strstr($source_net, '/');
+ echo $textss . $natent['external'] . $source_cidr . $textse;
+ ?>
</td>
<td class="listr" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
- <?php echo pprint_address($natent['source']); ?>
+ <?php echo $textss . $source_net . $textse; ?>
</td>
<td class="listr" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
- <?php echo pprint_address($natent['destination']); ?>
+ <?php echo $textss . pprint_address($natent['destination']) . $textse; ?>
</td>
<td class="listbg" ondblclick="document.location='firewall_nat_1to1_edit.php?id=<?=$i;?>';">
+ <?=$textss;?>
<?=htmlspecialchars($natent['descr']);?>&nbsp;
+ <?=$textse;?>
</td>
<td class="list" nowrap>
<table border="0" cellspacing="0" cellpadding="1">
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index 8ef211b..1c6c3f0 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -362,8 +362,10 @@ if ($_POST) {
else if ($_POST['ackqueue'] == $_POST['defaultqueue'])
$input_errors[] = gettext("Acknowledge queue and Queue cannot be the same.");
}
- if (isset($_POST['floating']) && $_POST['pdnpipe'] && (empty($_POST['direction']) || $_POST['direction'] == "any"))
+ if (isset($_POST['floating']) && $_POST['pdnpipe'] != "none" && (empty($_POST['direction']) || $_POST['direction'] == "any"))
$input_errors[] = gettext("You can not use limiters in Floating rules without choosing a direction.");
+ if (isset($_POST['floating']) && $_POST['gateway'] != "default" && (empty($_POST['direction']) || $_POST['direction'] == "any"))
+ $input_errors[] = gettext("You can not use gateways in Floating rules without choosing a direction.");
if ($_POST['pdnpipe'] && $_POST['pdnpipe'] != "none") {
if ($_POST['dnpipe'] == "none" )
$input_errors[] = gettext("You must select a queue for the In direction before selecting one for Out too.");
diff --git a/usr/local/www/firewall_virtual_ip_edit.php b/usr/local/www/firewall_virtual_ip_edit.php
index 20da793..edcde6c 100755
--- a/usr/local/www/firewall_virtual_ip_edit.php
+++ b/usr/local/www/firewall_virtual_ip_edit.php
@@ -82,6 +82,7 @@ if (isset($id) && $a_vip[$id]) {
$pconfig['mode'] = $a_vip[$id]['mode'];
$pconfig['vhid'] = $a_vip[$id]['vhid'];
$pconfig['advskew'] = $a_vip[$id]['advskew'];
+ $pconfig['advbase'] = $a_vip[$id]['advbase'];
$pconfig['password'] = $a_vip[$id]['password'];
$pconfig['range'] = $a_vip[$id]['range'];
$pconfig['subnet'] = $a_vip[$id]['subnet'];
@@ -185,6 +186,7 @@ if ($_POST) {
if ($_POST['mode'] === "carp" or $_POST['mode'] == "carpdev-dhcp") {
$vipent['vhid'] = $_POST['vhid'];
$vipent['advskew'] = $_POST['advskew'];
+ $vipent['advbase'] = $_POST['advbase'];
$vipent['password'] = $_POST['password'];
}
@@ -262,28 +264,30 @@ function enable_change(enable_over) {
document.iform.vhid.disabled = 0;
document.iform.password.disabled = 0;
document.iform.advskew.disabled = 0;
+ document.iform.advbase.disabled = 0;
document.iform.type.disabled = 1;
document.iform.subnet_bits.disabled = 0;
- document.iform.subnet.disabled = 0;
- if (note.firstChild == null) {
- note.appendChild(carpnote);
- } else {
- note.removeChild(note.firstChild);
- note.appendChild(carpnote);
- }
+ document.iform.subnet.disabled = 0;
+ if (note.firstChild == null) {
+ note.appendChild(carpnote);
+ } else {
+ note.removeChild(note.firstChild);
+ note.appendChild(carpnote);
+ }
} else {
document.iform.vhid.disabled = 1;
document.iform.password.disabled = 1;
document.iform.advskew.disabled = 1;
+ document.iform.advbase.disabled = 1;
document.iform.type.disabled = 0;
document.iform.subnet_bits.disabled = 1;
- document.iform.subnet.disabled = 0;
- if (note.firstChild == null) {
- note.appendChild(proxyarpnote);
- } else {
- note.removeChild(note.firstChild);
- note.appendChild(proxyarpnote);
- }
+ document.iform.subnet.disabled = 0;
+ if (note.firstChild == null) {
+ note.appendChild(proxyarpnote);
+ } else {
+ note.removeChild(note.firstChild);
+ note.appendChild(proxyarpnote);
+ }
}
if (get_radio_value(document.iform.mode) == "other") {
document.iform.type.disabled = 1;
@@ -307,9 +311,10 @@ function enable_change(enable_over) {
document.iform.subnet.disabled = 1;
document.iform.subnet.value = '';
document.iform.subnet_bits.value = '';
- document.iform.vhid.disabled = 0;
- document.iform.password.disabled = 0;
- document.iform.advskew.disabled = 0;
+ document.iform.vhid.disabled = 0;
+ document.iform.password.disabled = 0;
+ document.iform.advskew.disabled = 0;
+ document.iform.advbase.disabled = 0;
}
}
function typesel_change() {
@@ -431,7 +436,7 @@ function typesel_change() {
<tr valign="top">
<td width="22%" class="vncellreq"><?=gettext("VHID Group");?></td>
<td class="vtable"><select id='vhid' name='vhid'>
- <?php for ($i = 1; $i <= 65535; $i++): ?>
+ <?php for ($i = 1; $i <= 65536; $i++): ?>
<option value="<?=$i;?>" <?php if ($i == $pconfig['vhid']) echo "selected"; ?>>
<?=$i;?>
</option>
@@ -442,14 +447,23 @@ function typesel_change() {
</tr>
<tr valign="top">
<td width="22%" class="vncellreq"><?=gettext("Advertising Frequency");?></td>
- <td class="vtable"><select id='advskew' name='advskew'>
+ <td class="vtable">
+ Base: <select id='advbase' name='advbase'>
+ <?php for ($i = 1; $i <= 254; $i++): ?>
+ <option value="<?=$i;?>" <?php if ($i == $pconfig['advbase']) echo "selected"; ?>>
+ <?=$i;?>
+ </option>
+ <?php endfor; ?>
+ </select>
+ Skew: <select id='advskew' name='advskew'>
<?php for ($i = 0; $i <= 254; $i++): ?>
- <option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected"; ?>>
+ <option value="<?=$i;?>" <?php if ($i == $pconfig['advskew']) echo "selected"; ?>>
<?=$i;?>
- </option>
+ </option>
<?php endfor; ?>
- </select>
- <br><?=gettext("The frequency that this machine will advertise. 0 = master. Anything above 0 designates a backup.");?>
+ </select>
+ <br/><br/>
+ <?=gettext("The frequency that this machine will advertise. 0 means usually master. Otherwise the lowest combination of both values in the cluster detrmines the master.");?>
</td>
</tr>
<tr>
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index bd02087..2d821ab 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -159,7 +159,7 @@ if ($wancfg['if'] == $a_ppps[$pppid]['if']) {
}
}// End force pppoe reset at specific time
}// End if type == pppoe
- if ($a_ppps[$pppid]['type'] == "pptp"){
+ else if ($a_ppps[$pppid]['type'] == "pptp"){
$pconfig['pptp_username'] = $a_ppps[$pppid]['username'];
$pconfig['pptp_password'] = base64_decode($a_ppps[$pppid]['password']);
$pconfig['pptp_local'] = explode(",",$a_ppps[$pppid]['localip']);
@@ -375,7 +375,7 @@ if ($_POST['apply']) {
if (isset($config['dhcpd']) && isset($config['dhcpd'][$if]['enable']) && $_POST['type'] != "static")
$input_errors[] = gettext("The DHCP Server is active on this interface and it can be used only with a static IP configuration. Please disable the DHCP Server service on this interface first, then change the interface configuration.");
- switch($_POST['type']) {
+ switch(strtolower($_POST['type'])) {
case "static":
$reqdfields = explode(" ", "ipaddr subnet gateway");
$reqdfieldsn = array(gettext("IP address"),gettext("Subnet bit count"),gettext("Gateway"));
@@ -389,15 +389,13 @@ if ($_POST['apply']) {
}
}
case "dhcp":
- if (in_array($wancfg['ipaddr'], array("ppp", "pppoe", "pptp", "l2tp")))
- $input_errors[] = gettext("You have to reassign the interface to be able to configure as {$_POST['type']}.");
break;
case "ppp":
$reqdfields = explode(" ", "port phone");
$reqdfieldsn = array(gettext("Modem Port"),gettext("Phone Number"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
- case "PPPoE":
+ case "pppoe":
if ($_POST['pppoe_dialondemand']) {
$reqdfields = explode(" ", "pppoe_username pppoe_password pppoe_dialondemand pppoe_idletimeout");
$reqdfieldsn = array(gettext("PPPoE username"),gettext("PPPoE password"),gettext("Dial on demand"),gettext("Idle timeout value"));
@@ -407,7 +405,7 @@ if ($_POST['apply']) {
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
break;
- case "PPTP":
+ case "pptp":
if ($_POST['pptp_dialondemand']) {
$reqdfields = explode(" ", "pptp_username pptp_password pptp_local pptp_subnet pptp_remote pptp_dialondemand pptp_idletimeout");
$reqdfieldsn = array(gettext("PPTP username"),gettext("PPTP password"),gettext("PPTP local IP address"),gettext("PPTP subnet"),gettext("PPTP remote IP address"),gettext("Dial on demand"),gettext("Idle timeout value"));
@@ -515,6 +513,12 @@ if ($_POST['apply']) {
}
}
if (!$input_errors) {
+ if ($wancfg['type'] != $_POST['type']) {
+ if (in_array($wancfg['ipaddr'], array("ppp", "pppoe", "pptp", "l2tp"))) {
+ $wancfg['if'] = $a_ppps[$pppid]['ports'];
+ unset($a_ppps[$pppid]);
+ }
+ }
$ppp = array();
if ($wancfg['ipaddr'] != "ppp")
unset($wancfg['ipaddr']);
diff --git a/usr/local/www/interfaces_gif_edit.php b/usr/local/www/interfaces_gif_edit.php
index efbf036..59bad8f 100644
--- a/usr/local/www/interfaces_gif_edit.php
+++ b/usr/local/www/interfaces_gif_edit.php
@@ -136,6 +136,9 @@ include("head.inc");
<select name="if" class="formselect">
<?php
$portlist = get_configured_interface_with_descr();
+ $carplist = get_configured_carp_interface_list();
+ foreach ($carplist as $cif => $carpip)
+ $portlist[$cif] = $carpip." (".get_vip_descr($carpip).")";
foreach ($portlist as $ifn => $ifinfo) {
echo "<option value=\"{$ifn}\"";
if ($ifn == $pconfig['if'])
diff --git a/usr/local/www/interfaces_gre_edit.php b/usr/local/www/interfaces_gre_edit.php
index f0f0a84..ce9f324 100644
--- a/usr/local/www/interfaces_gre_edit.php
+++ b/usr/local/www/interfaces_gre_edit.php
@@ -139,6 +139,9 @@ include("head.inc");
<select name="if" class="formselect">
<?php
$portlist = get_configured_interface_with_descr();
+ $carplist = get_configured_carp_interface_list();
+ foreach ($carplist as $cif => $carpip)
+ $portlist[$cif] = $carpip." (".get_vip_descr($carpip).")";
foreach ($portlist as $ifn => $ifinfo) {
echo "<option value=\"{$ifn}\"";
if ($ifn == $pconfig['if'])
diff --git a/usr/local/www/interfaces_lagg_edit.php b/usr/local/www/interfaces_lagg_edit.php
index 367b604..b30853b 100644
--- a/usr/local/www/interfaces_lagg_edit.php
+++ b/usr/local/www/interfaces_lagg_edit.php
@@ -80,7 +80,7 @@ if ($_POST) {
/* input validation */
$reqdfields = explode(" ", "members proto");
- $reqdfieldsn = array(",", gettext("Member interfaces"), gettext("Lagg protocol"));
+ $reqdfieldsn = array(gettext("Member interfaces"), gettext("Lagg protocol"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index 52bc31a..8b71837 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -84,17 +84,16 @@ $id = $_GET['id'];
if (isset($_POST['id']))
$id = htmlspecialchars($_POST['id']);
-if(!is_numeric($id)) {
- Header("Location: /");
- exit;
-}
-
-
// Not posting? Then user is editing a record. There must be a valid id
// when editing a record.
if(!$id && !$_POST)
$id = "0";
-
+
+if(!is_numeric($id)) {
+ Header("Location: /");
+ exit;
+}
+
if($pkg['custom_php_global_functions'] <> "")
eval($pkg['custom_php_global_functions']);
diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php
index bab9976..43510c8 100755
--- a/usr/local/www/status_lb_vs.php
+++ b/usr/local/www/status_lb_vs.php
@@ -94,7 +94,7 @@ function parse_redirects($rdr_a) {
$line = $rdr_a[$i];
if (preg_match("/^[0-9]+/", $line)) {
$regs = array();
- if($x = preg_match("/^[0-9]+\s+redirect\s+([0-9a-zA-Z\s]+)\s+([a-z]+)/", $line, $regs)) {
+ if($x = preg_match("/^[0-9]+\s+redirect\s+([0-9a-zA-Z\.]+)\s+([a-z]+)/", $line, $regs)) {
$vs[trim($regs[1])] = array();
$vs[trim($regs[1])]['status'] = trim($regs[2]);
}
diff --git a/usr/local/www/system_usermanager_settings.php b/usr/local/www/system_usermanager_settings.php
index d7e3e1a..d9017c4 100755
--- a/usr/local/www/system_usermanager_settings.php
+++ b/usr/local/www/system_usermanager_settings.php
@@ -62,10 +62,13 @@ if ($_POST) {
}
if (!$input_errors) {
- if ($_POST['savetest'] && $_POST['authmode'] == "ldap")
- $save_and_test = true;
- else
- $savemsg = gettext("The test was not performed becuase it is supported only for ldap based backends.");
+ if ($_POST['authmode'] != "local") {
+ $authsrv = auth_get_authserver($_POST['authmode']);
+ if ($_POST['savetest'] && $authsrv['type'] == "ldap")
+ $save_and_test = true;
+ else
+ $savemsg = gettext("The test was not performed becuase it is supported only for ldap based backends.");
+ }
if(isset($_POST['session_timeout']) && $_POST['session_timeout'] != "")
diff --git a/usr/local/www/vpn_ipsec.php b/usr/local/www/vpn_ipsec.php
index f9d374d..40879f6 100755
--- a/usr/local/www/vpn_ipsec.php
+++ b/usr/local/www/vpn_ipsec.php
@@ -191,7 +191,10 @@ include("head.inc");
$iflabels = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
- $iflabels[$cif] = strtoupper($cif) . " ({$carpip})";
+ $iflabels[$cif] = $carpip." (".get_vip_descr($carpip).")";
+ $aliaslist = get_configured_ip_aliases_list();
+ foreach ($aliaslist as $aliasip => $aliasif)
+ $iflabels[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
$if = htmlspecialchars($iflabels[$ph1ent['interface']]);
}
else
diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php
index c498858..6240a63 100644
--- a/usr/local/www/vpn_ipsec_phase1.php
+++ b/usr/local/www/vpn_ipsec_phase1.php
@@ -509,7 +509,10 @@ function dpdchkbox_change() {
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
- $interfaces[$cif] = strtoupper($cif) . " ({$carpip})";
+ $interfaces[$cif] = $carpip." (".get_vip_descr($carpip).")";
+ $aliaslist = get_configured_ip_aliases_list();
+ foreach ($aliaslist as $aliasip => $aliasif)
+ $interfaces[$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
foreach ($interfaces as $iface => $ifacename):
?>
<option value="<?=$iface;?>" <?php if ($iface == $pconfig['interface']) echo "selected"; ?>>
diff --git a/usr/local/www/vpn_openvpn_client.php b/usr/local/www/vpn_openvpn_client.php
index e92d82e..96f67bf 100644
--- a/usr/local/www/vpn_openvpn_client.php
+++ b/usr/local/www/vpn_openvpn_client.php
@@ -457,10 +457,10 @@ if ($savemsg)
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
- $interfaces[$cif.'|'.$carpip] = strtoupper($cif) . " ({$carpip})";
+ $interfaces[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")";
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
- $interfaces[$aliasif.'|'.$aliasip] = strtoupper($aliasif) . " ({$aliasip})";
+ $interfaces[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
$interfaces['any'] = "any";
foreach ($interfaces as $iface => $ifacename):
$selected = "";
diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php
index bfb2076..9d7c00d 100644
--- a/usr/local/www/vpn_openvpn_server.php
+++ b/usr/local/www/vpn_openvpn_server.php
@@ -663,10 +663,10 @@ if ($savemsg)
$interfaces = get_configured_interface_with_descr();
$carplist = get_configured_carp_interface_list();
foreach ($carplist as $cif => $carpip)
- $interfaces[$cif.'|'.$carpip] = strtoupper($cif) . " ({$carpip})";
+ $interfaces[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")";
$aliaslist = get_configured_ip_aliases_list();
foreach ($aliaslist as $aliasip => $aliasif)
- $interfaces[$aliasif.'|'.$aliasip] = strtoupper($aliasif) . " ({$aliasip})";
+ $interfaces[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")";
$interfaces['any'] = "any";
foreach ($interfaces as $iface => $ifacename):
$selected = "";
diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
index bcc2298..9d1e76c 100644
--- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php
+++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php
@@ -68,7 +68,7 @@ Refresh Interval:
<option value="8" <?php if ($refreshInterval == "8") echo "SELECTED";?>>8</option>
<option value="9" <?php if ($refreshInterval == "9") echo "SELECTED";?>>9</option>
<option value="10" <?php if ($refreshInterval == "10") echo "SELECTED";?>>10</option>
- </select>&nbsp; Seconds<br>&nbsp; &nbsp; &nbsp; <b>Note:</b> changing this settings can affect CPU Performance on the pfSense Box<br><br>
+ </select>&nbsp; Seconds<br>&nbsp; &nbsp; &nbsp; <b>Note:</b> changing this setting will increase CPU utilization<br><br>
<input id="submit" name="submit" type="submit" onclick="return updatePref();" class="formbtn" value="Save Settings" />
</div>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.inc b/usr/local/www/wizards/traffic_shaper_wizard.inc
index 5a39e90..05c3671 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard.inc
@@ -555,10 +555,7 @@ function step8_stepsubmitphpaction() {
clear_subsystem_dirty('shaper');
update_filter_reload_status("Initializing");
-}
-function step9_stepsubmitphpaction() {
- global $g, $config;
- header("status_filter_reload.php");
+ header("Location: status_filter_reload.php");
exit;
}
@@ -686,7 +683,7 @@ function apply_all_choosen_items() {
if ($remainbw > 0 && $remainbw > 30) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
@@ -1038,7 +1035,7 @@ function apply_all_choosen_items() {
if ($remainbw > 0 && $remainbw > 30) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard.xml b/usr/local/www/wizards/traffic_shaper_wizard.xml
index ce2b04c..4c2f2a3 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard.xml
+++ b/usr/local/www/wizards/traffic_shaper_wizard.xml
@@ -1215,16 +1215,4 @@
<stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile>
</step>
- <step>
- <id>9</id>
- <title>pfSense Traffic Shaper Wizard</title>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard.inc</includefile>
- <stepsubmitphpaction>step9_stepsubmitphpaction();</stepsubmitphpaction>
- </step>
</pfsensewizard>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
index 4811181..50fa627 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc
@@ -582,11 +582,7 @@ function step8_stepsubmitphpaction() {
clear_subsystem_dirty('shaper');
update_filter_reload_status("Initializing");
-}
-
-function step9_stepsubmitphpaction() {
- global $g, $config;
- header("status_filter_reload.php");
+ header("Location: status_filter_reload.php");
exit;
}
@@ -713,7 +709,7 @@ function apply_all_choosen_items() {
if (intval($remainbw) > 0 && intval($remainbw) > 30) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_dedicated.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_dedicated.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
@@ -1098,7 +1094,7 @@ function apply_all_choosen_items() {
$remainbw = round($remainbw / $downbw * 100, 2);
if (intval($remainbw) > 0 && intval($remainbw) > 40) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_dedicated.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_dedicated.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
index 5d83553..ecdb508 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
+++ b/usr/local/www/wizards/traffic_shaper_wizard_dedicated.xml
@@ -1220,16 +1220,4 @@
<stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc</includefile>
</step>
- <step>
- <id>9</id>
- <title>pfSense Traffic Shaper Wizard</title>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_dedicated.inc</includefile>
- <stepsubmitphpaction>step9_stepsubmitphpaction();</stepsubmitphpaction>
- </step>
</pfsensewizard>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
index d1a1122..83c3e49 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc
@@ -615,11 +615,7 @@ function step8_stepsubmitphpaction() {
clear_subsystem_dirty('shaper');
update_filter_reload_status("Initializing");
-}
-
-function step9_stepsubmitphpaction() {
- global $g, $config;
- header("status_filter_reload.php");
+ header("Location: status_filter_reload.php");
exit;
}
@@ -746,7 +742,7 @@ function apply_all_choosen_items() {
if (intval($remainbw) > 0 && intval($remainbw) > 30) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
@@ -1144,7 +1140,7 @@ function apply_all_choosen_items() {
if (intval($remainbw) > 0 && intval($remainbw) > 40) {
$savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$message}");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_multi_all.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
index 9fca078..050f493 100755
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_all.xml
@@ -1228,16 +1228,4 @@
<stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc</includefile>
</step>
- <step>
- <id>9</id>
- <title>pfSense Traffic Shaper Wizard</title>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_all.inc</includefile>
- <stepsubmitphpaction>step9_stepsubmitphpaction();</stepsubmitphpaction>
- </step>
</pfsensewizard>
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
index 5186aa3..b5f8d63 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc
@@ -397,11 +397,7 @@ function step8_stepsubmitphpaction() {
clear_subsystem_dirty('shaper');
update_filter_reload_status("Initializing");
-}
-
-function step9_stepsubmitphpaction() {
- global $g, $config;
- header("status_filter_reload.php");
+ header("Location: status_filter_reload.php");
exit;
}
@@ -521,8 +517,8 @@ function apply_all_choosen_items() {
$remainbw = round($remainbw / $upbw * 100, 2);
if ($remainbw > 0 && $remainbw > 30) {
- $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}");
+ $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
@@ -911,8 +907,8 @@ function apply_all_choosen_items() {
}
$remainbw = round($remainbw / $lanbw * 100, 2);
if ($remainbw > 0 && $remainbw > 30) {
- $message=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
- header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$message}");
+ $savemsg=gettext("Custom Bandwidths are greater than 30%. Please lower them for the wizard to continue.");
+ header("Location: wizard.php?xml=traffic_shaper_wizard_multi_lan.xml&stepid=2&message={$savemsg}");
exit;
} else {
$remainbw = 100 - $remainbw;
diff --git a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml
index 9ed7c44..ae5a139 100644
--- a/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml
+++ b/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.xml
@@ -1277,16 +1277,4 @@
<stepsubmitphpaction>step8_stepsubmitphpaction();</stepsubmitphpaction>
<includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile>
</step>
- <step>
- <id>9</id>
- <title>pfSense Traffic Shaper Wizard</title>
- <fields>
- <field>
- <name>Finish</name>
- <type>submit</type>
- </field>
- </fields>
- <includefile>/usr/local/www/wizards/traffic_shaper_wizard_multi_lan.inc</includefile>
- <stepsubmitphpaction>step9_stepsubmitphpaction();</stepsubmitphpaction>
- </step>
</pfsensewizard>
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 375ad46..ea0166b 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -61,12 +61,12 @@ if($synchronizetoip) {
}
$xmlrpc_g = array(
- "return" => array(
- "true" => new XML_RPC_Response(new XML_RPC_Value(true, $XML_RPC_Boolean)),
- "false" => new XML_RPC_Response(new XML_RPC_Value(false, $XML_RPC_Boolean)),
- "authfail" => new XML_RPC_Response(new XML_RPC_Value(gettext("Authentication failed"), $XML_RPC_String))
- )
- );
+ "return" => array(
+ "true" => new XML_RPC_Response(new XML_RPC_Value(true, $XML_RPC_Boolean)),
+ "false" => new XML_RPC_Response(new XML_RPC_Value(false, $XML_RPC_Boolean)),
+ "authfail" => new XML_RPC_Response(new XML_RPC_Value(gettext("Authentication failed"), $XML_RPC_String))
+ )
+);
/*
* pfSense XMLRPC errors
@@ -75,20 +75,21 @@ $xmlrpc_g = array(
$XML_RPC_erruser = 200;
/* EXPOSED FUNCTIONS */
-
$exec_php_doc = gettext("XMLRPC wrapper for eval(). This method must be called with two parameters: a string containing the local system\'s password followed by the PHP code to evaluate.");
$exec_php_sig = array(
- array(
- $XML_RPC_Boolean, // First signature element is return value.
- $XML_RPC_String, // password
- $XML_RPC_String, // shell code to exec
- )
- );
+ array(
+ $XML_RPC_Boolean, // First signature element is return value.
+ $XML_RPC_String, // password
+ $XML_RPC_String, // shell code to exec
+ )
+);
function exec_php_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
+
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+ if(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
$exec_php = $params[0];
eval($exec_php);
if($toreturn) {
@@ -99,61 +100,61 @@ function exec_php_xmlrpc($raw_params) {
}
/*****************************/
-
$exec_shell_doc = gettext("XMLRPC wrapper for mwexec(). This method must be called with two parameters: a string containing the local system\'s password followed by an shell command to execute.");
$exec_shell_sig = array(
- array(
- $XML_RPC_Boolean, // First signature element is return value.
- $XML_RPC_String, // password
- $XML_RPC_String, // shell code to exec
- )
- );
-
+ array(
+ $XML_RPC_Boolean, // First signature element is return value.
+ $XML_RPC_String, // password
+ $XML_RPC_String, // shell code to exec
+ )
+);
function exec_shell_xmlrpc($raw_params) {
global $config, $xmlrpc_g;
+
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+ if(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
$shell_cmd = $params[0];
mwexec($shell_cmd);
+
return $xmlrpc_g['return']['true'];
}
-
-
/*****************************/
-
-
$backup_config_section_doc = gettext("XMLRPC wrapper for backup_config_section. This method must be called with two parameters: a string containing the local system\'s password followed by an array containing the keys to be backed up.");
$backup_config_section_sig = array(
- array(
- $XML_RPC_Struct, // First signature element is return value.
- $XML_RPC_String,
- $XML_RPC_Array
- )
- );
+ array(
+ $XML_RPC_Struct, // First signature element is return value.
+ $XML_RPC_String,
+ $XML_RPC_Array
+ )
+);
function backup_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(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
$val = array_intersect_key($config, array_flip($params[0]));
+
return new XML_RPC_Response(XML_RPC_encode($val));
}
/*****************************/
-
$restore_config_section_doc = gettext("XMLRPC wrapper for restore_config_section. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.");
$restore_config_section_sig = array(
- array(
- $XML_RPC_Boolean,
- $XML_RPC_String,
- $XML_RPC_Struct
- )
- );
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String,
+ $XML_RPC_Struct
+ )
+);
function restore_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'];
@@ -168,54 +169,55 @@ function restore_config_section_xmlrpc($raw_params) {
// 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
- foreach ($vipbackup as $vip) {
- if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp'))
- $config['virtualip']['vip'][]=$vip ;
+ if (is_array($vipbackup)) {
+ foreach ($vipbackup as $vip) {
+ if (($vip['mode'] == 'ipalias') || ($vip['mode'] == 'proxyarp'))
+ array_unshift($config['virtualip']['vip'], $vip);
+ }
}
$mergedkeys = implode(",", array_keys($params[0]));
write_config(sprintf(gettext("Merged in config (%s sections) from XMLRPC client."),$mergedkeys));
interfaces_vips_configure();
+
return $xmlrpc_g['return']['true'];
}
-
/*****************************/
-
-
$merge_config_section_doc = gettext("XMLRPC wrapper for merging package sections. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.");
$merge_config_section_sig = array(
- array(
- $XML_RPC_Boolean,
- $XML_RPC_String,
- $XML_RPC_Struct
- )
- );
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String,
+ $XML_RPC_Struct
+ )
+);
function merge_installedpackages_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(!xmlrpc_auth($params))
+ 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));
+
return $xmlrpc_g['return']['true'];
}
-
/*****************************/
-
-
$merge_config_section_doc = gettext("XMLRPC wrapper for merge_config_section. This method must be called with two parameters: a string containing the local system\'s password and an array to merge into the system\'s config. This function returns true upon completion.");
$merge_config_section_sig = array(
- array(
- $XML_RPC_Boolean,
- $XML_RPC_String,
- $XML_RPC_Struct
- )
- );
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String,
+ $XML_RPC_Struct
+ )
+);
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'];
@@ -229,23 +231,25 @@ function merge_config_section_xmlrpc($raw_params) {
$mergedkeys = implode(",", array_keys($params[0]));
write_config("Merged in config ({$mergedkeys} sections) from XMLRPC client.");
interfaces_vips_configure();
+
return $xmlrpc_g['return']['true'];
}
/*****************************/
-
$filter_configure_doc = gettext("Basic XMLRPC wrapper for filter_configure. This method must be called with one paramater: a string containing the local system\'s password. This function returns true upon completion.");
$filter_configure_sig = array(
- array(
- $XML_RPC_Boolean,
- $XML_RPC_String
- )
- );
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String
+ )
+);
function filter_configure_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))
+ return $xmlrpc_g['return']['authfail'];
filter_configure();
system_routing_configure();
setup_gateways_monitor();
@@ -255,71 +259,98 @@ function filter_configure_xmlrpc($raw_params) {
services_dhcpd_configure();
services_dnsmasq_configure();
local_sync_accounts();
+
return $xmlrpc_g['return']['true'];
}
/*****************************/
-
$carp_configure_doc = gettext("Basic XMLRPC wrapper for configuring CARP interfaces.");
$carp_configure_sig = array(
- array(
- $XML_RPC_Boolean,
- $XML_RPC_String
- )
- );
+ array(
+ $XML_RPC_Boolean,
+ $XML_RPC_String
+ )
+);
function interfaces_carp_configure_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))
+ return $xmlrpc_g['return']['authfail'];
interfaces_vips_configure();
+
return $xmlrpc_g['return']['true'];
}
/*****************************/
-
$check_firmware_version_doc = gettext("Basic XMLRPC wrapper for check_firmware_version. This function will return the output of check_firmware_version upon completion.");
+
$check_firmware_version_sig = array(
- array(
- $XML_RPC_String,
- $XML_RPC_String
- )
- );
+ array(
+ $XML_RPC_String,
+ $XML_RPC_String
+ )
+);
function check_firmware_version_xmlrpc($raw_params) {
global $xmlrpc_g, $XML_RPC_String;
+
$params = xmlrpc_params_to_php($raw_params);
- if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
+ if(!xmlrpc_auth($params))
+ return $xmlrpc_g['return']['authfail'];
+
return new XML_RPC_Response(new XML_RPC_Value(check_firmware_version(false), $XML_RPC_String));
}
/*****************************/
+$pfsense_firmware_version_doc = gettext("Basic XMLRPC wrapper for check_firmware_version. This function will return the output of check_firmware_version upon completion.");
+
+$pfsense_firmware_version_sig = array (
+ array (
+ $XML_RPC_Struct,
+ $XML_RPC_String
+ )
+);
+
+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'];
+
+ return new XML_RPC_Response(XML_RPC_encode(host_firmware_version()));
+}
+
+/*****************************/
$reboot_doc = gettext("Basic XMLRPC wrapper for rc.reboot.");
$reboot_sig = array(array($XML_RPC_Boolean, $XML_RPC_String));
-
function reboot_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))
+ return $xmlrpc_g['return']['authfail'];
mwexec_bg("/etc/rc.reboot");
+
return $xmlrpc_g['return']['true'];
}
/*****************************/
-
$get_notices_sig = array(
- array(
- $XML_RPC_Array,
- $XML_RPC_String
- ),
- array(
- $XML_RPC_Array
- )
- );
+ array(
+ $XML_RPC_Array,
+ $XML_RPC_String
+ ),
+ array(
+ $XML_RPC_Array
+ )
+);
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'];
require("notices.inc");
@@ -329,44 +360,47 @@ function get_notices_xmlrpc($raw_params) {
$toreturn = get_notices($params);
}
$response = new XML_RPC_Response(XML_RPC_encode($toreturn));
+
return $response;
}
/*****************************/
-
$server = new XML_RPC_Server(
array(
- 'pfsense.exec_shell' => array('function' => 'exec_shell_xmlrpc',
- 'signature' => $exec_shell_sig,
- 'docstring' => $exec_shell_doc),
- 'pfsense.exec_php' => array('function' => 'exec_php_xmlrpc',
- 'signature' => $exec_php_sig,
- 'docstring' => $exec_php_doc),
- 'pfsense.filter_configure' => array('function' => 'filter_configure_xmlrpc',
- 'signature' => $filter_configure_sig,
- 'docstring' => $filter_configure_doc),
- 'pfsense.interfaces_carp_configure' => array('function' => 'interfaces_carp_configure_xmlrpc',
- 'docstring' => $carp_configure_sig),
- 'pfsense.backup_config_section' => array('function' => 'backup_config_section_xmlrpc',
- 'signature' => $backup_config_section_sig,
- 'docstring' => $backup_config_section_doc),
- 'pfsense.restore_config_section' => array('function' => 'restore_config_section_xmlrpc',
- 'signature' => $restore_config_section_sig,
- 'docstring' => $restore_config_section_doc),
- 'pfsense.merge_config_section' => array('function' => 'merge_config_section_xmlrpc',
- 'signature' => $merge_config_section_sig,
- 'docstring' => $merge_config_section_doc),
- 'pfsense.merge_installedpackages_section_xmlrpc' => array('function' => 'merge_installedpackages_section_xmlrpc',
- 'signature' => $merge_config_section_sig,
- 'docstring' => $merge_config_section_doc),
- 'pfsense.check_firmware_version' => array('function' => 'check_firmware_version_xmlrpc',
- 'signature' => $check_firmware_version_sig,
- 'docstring' => $check_firmware_version_doc),
- 'pfsense.reboot' => array('function' => 'reboot_xmlrpc',
- 'signature' => $reboot_sig,
- 'docstring' => $reboot_doc),
- 'pfsense.get_notices' => array('function' => 'get_notices_xmlrpc',
- 'signature' => $get_notices_sig)
+ 'pfsense.exec_shell' => array('function' => 'exec_shell_xmlrpc',
+ 'signature' => $exec_shell_sig,
+ 'docstring' => $exec_shell_doc),
+ 'pfsense.exec_php' => array('function' => 'exec_php_xmlrpc',
+ 'signature' => $exec_php_sig,
+ 'docstring' => $exec_php_doc),
+ 'pfsense.filter_configure' => array('function' => 'filter_configure_xmlrpc',
+ 'signature' => $filter_configure_sig,
+ 'docstring' => $filter_configure_doc),
+ 'pfsense.interfaces_carp_configure' => array('function' => 'interfaces_carp_configure_xmlrpc',
+ 'docstring' => $carp_configure_sig),
+ 'pfsense.backup_config_section' => array('function' => 'backup_config_section_xmlrpc',
+ 'signature' => $backup_config_section_sig,
+ 'docstring' => $backup_config_section_doc),
+ 'pfsense.restore_config_section' => array('function' => 'restore_config_section_xmlrpc',
+ 'signature' => $restore_config_section_sig,
+ 'docstring' => $restore_config_section_doc),
+ 'pfsense.merge_config_section' => array('function' => 'merge_config_section_xmlrpc',
+ 'signature' => $merge_config_section_sig,
+ 'docstring' => $merge_config_section_doc),
+ 'pfsense.merge_installedpackages_section_xmlrpc' => array('function' => 'merge_installedpackages_section_xmlrpc',
+ 'signature' => $merge_config_section_sig,
+ 'docstring' => $merge_config_section_doc),
+ 'pfsense.check_firmware_version' => array('function' => 'check_firmware_version_xmlrpc',
+ 'signature' => $check_firmware_version_sig,
+ 'docstring' => $check_firmware_version_doc),
+ 'pfsense.host_firmware_version' => array('function' => 'pfsense_firmware_version_xmlrpc',
+ 'signature' => $pfsense_firmware_version_sig,
+ 'docstring' => $host_firmware_version_doc),
+ 'pfsense.reboot' => array('function' => 'reboot_xmlrpc',
+ 'signature' => $reboot_sig,
+ 'docstring' => $reboot_doc),
+ 'pfsense.get_notices' => array('function' => 'get_notices_xmlrpc',
+ 'signature' => $get_notices_sig)
)
);
OpenPOWER on IntegriCloud