diff options
author | Colin Smith <colin@pfsense.org> | 2005-07-13 02:03:51 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-07-13 02:03:51 +0000 |
commit | 9471afe1d7213c708ee81eac3e590735801887cb (patch) | |
tree | d4ee07c2e58a34cb750b88807569cbca71753a32 /usr/local | |
parent | c6e2b163e03bca00b81bf66f0ce169bff7c0a6ed (diff) | |
download | pfsense-9471afe1d7213c708ee81eac3e590735801887cb.zip pfsense-9471afe1d7213c708ee81eac3e590735801887cb.tar.gz |
Add option to use an alternate XMLRPC server.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/system_firmware_settings.php | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/usr/local/www/system_firmware_settings.php b/usr/local/www/system_firmware_settings.php index bd4020e..99e01a3 100755 --- a/usr/local/www/system_firmware_settings.php +++ b/usr/local/www/system_firmware_settings.php @@ -35,8 +35,24 @@ require("guiconfig.inc"); if ($_POST) { - $config['system']['firmware']['branch'] = $_POST['branch']; - write_config(); + /* input validation */ + if($_POST['firmwareurl'] && !is_string($_POST['firmwareurl'])) { + $input_errors[] = "The base XMLRPC URL must be a string."; + } + if($_POST['firmwarepath'] && !is_string($_POST['firmwarepath'])) { + $input_errors[] = "The XMLRPC path must be a string."; + } + if (!$input_errors) { + $config['system']['firmware']['branch'] = $_POST['branch']; + if($_POST['alturlenable'] == "yes") { + $config['system']['firmware']['alturl']['enable'] = ""; + $config['system']['firmware']['alturl']['firmwareurl'] = $_POST['firmwareurl']; + $config['system']['firmware']['alturl']['firmwarepath'] = $_POST['firmwarepath']; + } else { + unset($config['system']['firmware']['alturl']['enable']); + } + write_config(); + } } $curcfg = $config['system']['firmware']; @@ -62,12 +78,23 @@ function update_description(itemnum) { document.forms[0].branchinfo.value=branchinfo[itemnum]; } +function enable_altfirmwareurl(enable_over) { + if (document.iform.alturlenable.checked || enable_over) { + document.iform.firmwareurl.disabled = 0; + document.iform.firmwarepath.disabled = 0; + } else { + document.iform.firmwareurl.disabled = 1; + document.iform.firmwarepath.disabled = 1; + } +} + // --> </script> <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc");?> <p class="pgtitle"><?=$pgtitle?></p> +<?php if ($input_errors) print_input_errors($input_errors); ?> <form action="system_firmware_settings.php" method="post" name="iform" id="iform"> <?php if ($savemsg) print_info_box($savemsg); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> @@ -88,8 +115,8 @@ function update_description(itemnum) { <td colspan="2" valign="top" class="listtopic">Firmware Branch</td> </tr> <tr> - <td width="22%" valign="top" class="vncell">Firmware Branch</td> - <td width="78%" class="vtable"> + <td valign="top" class="vncell">Firmware Branch</td> + <td class="vtable"> <select onChange="update_description(this.selectedIndex);" name="branch" id="branch"> <option value="stable"<?php if($curcfg['branch']=="stable") echo " SELECTED"; ?>>Stable</option> <option value="beta"<?php if($curcfg['branch']=="beta") echo " SELECTED"; ?>>Beta</option> @@ -100,8 +127,19 @@ function update_description(itemnum) { <script language="javascript"> update_description(document.forms[0].branch.selectedIndex); </script> - <br><span class="vexpl"><b>Select the update branch you would like this system to track</b></td> - </tr> + <span class="vexpl">Select the update branch you would like this system to track.</td> + </tr> + <tr> + <td valign="top" class="vncell">Firmware XMLRPC URL</td> + <td class="vtable"> + <input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onClick="enable_altfirmwareurl()" <?php if(isset($curcfg['alturl']['enable'])) echo "checked"; ?>> Use a different XMLRPC server for firmware upgrades<br> + <table> + <tr><td>Base URL:</td><td><input name="firmwareurl" type="input" id="firmwareurl" size="64" value="<?php if($curcfg['alturl']['firmwareurl']) echo $curcfg['alturl']['firmwareurl']; else echo $g['xmlrpcbaseurl']; ?>"></td></tr> + <tr><td>Path:</td><td><input name="firmwarepath" type="input" id="firmwarepath" size="64" value="<?php if($curcfg['alturl']['firmwarepath']) echo $curcfg['alturl']['firmwarepath']; else echo $g['xmlrpcpath']; ?>"></td></tr> + </table> + <span class="vexpl">This is where pfSense will check for newer firmware versions when the <a href="system_firmware_check.php">System: Firmware: Auto Update</a> page is viewed.</span></td> + </tr> + <script>enable_altfirmwareurl();</script> <!-- <tr> <td width="22%" valign="top" class="vncell">Update Preference</td> |