From c55dfc4a9b4020533e6ec25278fc772b33ff2b93 Mon Sep 17 00:00:00 2001 From: jim-p Date: Tue, 1 Jul 2014 15:22:42 -0400 Subject: Detect if an unofficial package repository is in use and warn the user. Part of issue #484 (more to go) --- usr/local/www/pkg_mgr.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'usr/local/www/pkg_mgr.php') diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php index 4afb295..454cedd 100644 --- a/usr/local/www/pkg_mgr.php +++ b/usr/local/www/pkg_mgr.php @@ -74,6 +74,7 @@ function domTT_title($title_msg) { //get_pkg_info only if cache file has more then $g[min_pkg_cache_file_time] seconds $pkg_cache_file_time=($g['min_pkg_cache_file_time'] ? $g['min_pkg_cache_file_time'] : 120); +$xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl']; if (!file_exists("{$g['tmp_path']}/pkg_info.cache") || (time() - filemtime("{$g['tmp_path']}/pkg_info.cache")) > $pkg_cache_file_time) { $pkg_info = get_pkg_info('all', array("noembedded", "name", "category", "website", "version", "status", "descr", "maintainer", "required_version", "maximum_version", "pkginfolink", "config_file")); //create cache file after get_pkg_info @@ -84,7 +85,6 @@ if (!file_exists("{$g['tmp_path']}/pkg_info.cache") || (time() - filemtime("{$g[ //$pkg_sizes = get_pkg_sizes(); } else { $using_cache = true; - $xmlrpc_base_url = isset($config['system']['altpkgrepo']['enable']) ? $config['system']['altpkgrepo']['xmlrpcbaseurl'] : $g['xmlrpcbaseurl']; if(file_exists("{$g['tmp_path']}/pkg_info.cache")) { $savemsg = sprintf(gettext("Unable to retrieve package info from %s. Cached data will be used."), $xmlrpc_base_url); $pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache")); @@ -115,6 +115,15 @@ include("head.inc"); -- cgit v1.1