fsf changes, meant to be rebased on upstream
[squirrelmail.git] / plugins / bug_report / show_system_specs.php
index 83e22b039b478c319ad534277746c2a853eb5e72..6567639e2f3c35654ba31123d18596b81e07a53a 100644 (file)
@@ -1,33 +1,48 @@
 <?php
-
 /**
- * This shows system specification details.
- *
- * Copyright (c) 1999-2004 The SquirrelMail development team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
- * This is a standard Squirrelmail-1.2 API for plugins.
+ * This script shows system specification details.
  *
- * $Id$
+ * @copyright 1999-2022 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package plugins
+ * @subpackage bug_report
  */
 
 
-define('SM_PATH','../../');
-include_once(SM_PATH . 'include/validate.php');
+// This is the bug_report show system specs page
+//
+define('PAGE_NAME', 'bug_report_show_system_specs');
 
 
-?>
-<html>
-<body>
-<pre>
+// Include the SquirrelMail initialization file.
+//
+require('../../include/init.php');
 
-<?php
 
-include_once(SM_PATH . 'plugins/bug_report/system_specs.php');
-global $body;
-echo $body;
+// load plugin functions
+//
+require_once(SM_PATH . 'plugins/bug_report/functions.php');
+
+
+// error out when bug_report plugin is disabled
+// or is called by the wrong user
+//
+if (! is_plugin_enabled('bug_report') || ! bug_report_check_user()) {
+    error_box(_("Plugin is disabled."));
+    $oTemplate->display('footer.tpl');
+    exit();
+}
+
+
+// get system specs
+//
+require_once(SM_PATH . 'plugins/bug_report/system_specs.php');
+list($body, $warnings, $corrections) = get_system_specs();
+
+global $oTemplate;
+$oTemplate->assign('body', $body);
+$oTemplate->display('plugins/bug_report/system_specs.tpl');
+$oTemplate->display('footer.tpl');
+
 
-?>
-</pre>
-</body>
-</html>