diff options
author | jim-p <jimp@pfsense.org> | 2014-07-02 12:07:33 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2014-07-02 12:07:33 -0400 |
commit | 7c8f3711075d9671eda430b86ac59d6013d12cae (patch) | |
tree | 7a4f6c4e9c01728a68a7bed6bfe7890823d0b40a /etc/inc/pkg-utils.inc | |
parent | 38c7d42e4b47e9c8d968ebf2c7a5b75806d87203 (diff) | |
download | pfsense-7c8f3711075d9671eda430b86ac59d6013d12cae.zip pfsense-7c8f3711075d9671eda430b86ac59d6013d12cae.tar.gz |
More refinements to the unofficial package repository warning ( Issue #484 ) -- Now also shows on Dashboard and installed package list. Cleaned up some code and shuffled things around to avoid unnecessary repetition.
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-rw-r--r-- | etc/inc/pkg-utils.inc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 016f027..96bdf5f 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -196,7 +196,7 @@ function get_pkg_sizes($pkgs = 'all') { "freebsd_machine" => $freebsd_machine ); $msg = new XML_RPC_Message('pfsense.get_pkg_sizes', array(php_value_to_xmlrpc($params))); - $xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl']; + $xmlrpc_base_url = get_active_xml_rpc_base_url(); $cli = new XML_RPC_Client($g['xmlrpcpath'], $xmlrpc_base_url); $resp = $cli->send($msg, 10); if(!is_object($resp)) @@ -1282,7 +1282,7 @@ function pkg_reinstall_all() { if ($pkg_info) { echo " Done.\n"; } else { - $xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl']; + $xmlrpc_base_url = get_active_xml_rpc_base_url(); $error = sprintf(gettext(' >>> Unable to communicate with %1$s. Please verify DNS and interface configuration, and that %2$s has functional Internet connectivity.'), $xmlrpc_base_url, $g['product_name']); echo "\n{$error}\n"; log_error(gettext("Cannot reinstall packages: ") . $error); @@ -1413,14 +1413,7 @@ function get_pkg_interfaces_select_source($include_localhost=false) { } function verify_all_package_servers() { - global $config, $g; - /* If an alternate package repository is defined, check it before - checking the default. */ - if (isset($config['system']['altpkgrepo']['enable']) && !empty($config['system']['altpkgrepo']['xmlrpcbaseurl'])) { - return verify_package_server($config['system']['altpkgrepo']['xmlrpcbaseurl']); - } else { - return verify_package_server($g['xmlrpcbaseurl']); - } + return verify_package_server(get_active_xml_rpc_base_url()); } /* Check if the active package server is a valid default or if it has been @@ -1441,4 +1434,16 @@ function verify_package_server($server) { return false; } +/* Keep this message centrally since it will be used several times on pages + in the GUI. */ +function package_server_mismatch_message() { + return sprintf(gettext("The package server currently configured on " + . "this firewall (%s) is NOT an official package server. The contents " + . "of such servers cannot be verified and may contain malicious files. " + . "Return the package server settings to their default values to " + . "ensure that verifiable and trusted packages are received."), + htmlspecialchars(get_active_xml_rpc_base_url())) . '<br/><br/>' + . '<a href="/pkg_mgr_settings.php">' . gettext("Package Manager Settings") . '</a>'; +} + ?> |