Add a new (unlinked) page which allows entering a custom pkg repo URL

This commit is contained in:
jim-p 2009-10-06 18:01:39 -04:00
parent a3c770648f
commit ffba49766d
3 changed files with 5 additions and 3 deletions

View File

@ -792,7 +792,7 @@ function call_pfsense_method($method, $params, $timeout = 0) {
if($ip == $g['product_website'])
return false;
$xmlrpc_base_url = $g['xmlrpcbaseurl'];
$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
$xmlrpc_path = $g['xmlrpcpath'];
$msg = new XML_RPC_Message($method, array(XML_RPC_Encode($params)));
$cli = new XML_RPC_Client($xmlrpc_path, $xmlrpc_base_url);

View File

@ -152,7 +152,8 @@ function get_pkg_sizes($pkgs = 'all') {
global $g;
$params = array("pkg" => $pkgs);
$msg = new XML_RPC_Message('pfsense.get_pkg_sizes', array(php_value_to_xmlrpc($params)));
$cli = new XML_RPC_Client($g['xmlrpcpath'], $g['xmlrpcbaseurl']);
$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
$cli = new XML_RPC_Client($g['xmlrpcpath'], $xmlrpc_base_url);
$resp = $cli->send($msg, 10);
if($resp and !$resp->faultCode()) {
$raw_versions = $resp->value();

View File

@ -51,7 +51,8 @@ if($pkg_info) {
} else {
$using_cache = true;
if(file_exists("{$g['tmp_path']}/pkg_info.cache")) {
$savemsg = "Unable to retrieve package info from {$g['xmlrpcbaseurl']}. Cached data will be used.";
$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl'];
$savemsg = "Unable to retrieve package info from {$xmlrpc_base_url}. Cached data will be used.";
$pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache"));
} else {
$savemsg = "Unable to communicate to {$g['product_website']}. Please check DNS, default gateway, etc.";