From a0275915f127d728e5088920bd8da9a944a7d6b4 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 14 Oct 2009 17:03:50 -0400 Subject: Dashboard 0.8.6: Prevent install on 2.0 (just in case) and remove snort/havp widgets so they can be in their own packages. --- config/dashboard/dashboard.inc | 31 +++++++++++++++++++------------ config/dashboard/dashboard.xml | 26 +++++++++++++------------- 2 files changed, 32 insertions(+), 25 deletions(-) (limited to 'config/dashboard') diff --git a/config/dashboard/dashboard.inc b/config/dashboard/dashboard.inc index 9f5d6e8c..61b5c501 100644 --- a/config/dashboard/dashboard.inc +++ b/config/dashboard/dashboard.inc @@ -2,19 +2,26 @@ function dashboard_install() { global $g, $config; - assign_privs(); - /* Copy files for backup. For some odd reason, mv alone does - * not always result in the proper file being used. */ - mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); - unlink("/usr/local/www/index.php"); - mwexec("cp /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard"); - mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard"); - mwexec("tar xzvpUf /usr/local/pkg/widgets.tgz -C /"); - assign_privs(); - /* Clear the APC cache so that the updates to installed files will work. */ - sleep(5); - apc_clear_cache(); + $version = file_get_contents("/etc/version"); + if ($version[0] == "2") { + echo "Skipping install on 2.0, package is redundant."; + exit(1); + } else { + assign_privs(); + + /* Copy files for backup. For some odd reason, mv alone does + * not always result in the proper file being used. */ + mwexec("cp /usr/local/www/index.php /usr/local/www/index.php.before_dashboard"); + unlink("/usr/local/www/index.php"); + mwexec("cp /usr/local/www/diag_logs_filter.php /usr/local/www/diag_logs_filter.php.before_dashboard"); + mwexec("cp /usr/local/www/diag_logs_filter_dynamic.php /usr/local/www/diag_logs_filter_dynamic.php.before_dashboard"); + mwexec("tar xzvpUf /usr/local/pkg/widgets.tgz -C /"); + assign_privs(); + /* Clear the APC cache so that the updates to installed files will work. */ + sleep(5); + apc_clear_cache(); + } } function assign_privs() { diff --git a/config/dashboard/dashboard.xml b/config/dashboard/dashboard.xml index 1707f6d4..cae0205d 100644 --- a/config/dashboard/dashboard.xml +++ b/config/dashboard/dashboard.xml @@ -2,8 +2,8 @@ - - + . All rights reserved. - */ + */ /* ========================================================================== */ /* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY @@ -38,15 +38,15 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + */ /* ========================================================================== */ - ]]> - - Dashboard package - Describe your package requirements here - Currently there are no FAQ items provided. + ]]> + + Dashboard package + Describe your package requirements here + Currently there are no FAQ items provided. dashboard - 0.8.5 + 0.8.6 Dashboard /usr/local/pkg/dashboard.inc -- cgit v1.2.3