Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SecurityInfo/Controller.php')
-rw-r--r--plugins/SecurityInfo/Controller.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/SecurityInfo/Controller.php b/plugins/SecurityInfo/Controller.php
new file mode 100644
index 0000000000..8059d88702
--- /dev/null
+++ b/plugins/SecurityInfo/Controller.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
+ * @version $Id$
+ *
+ * @category Piwik_Plugins
+ * @package Piwik_SecurityInfo
+ */
+
+/**
+ * @package Piwik_SecurityInfo
+ */
+class Piwik_SecurityInfo_Controller extends Piwik_Controller
+{
+ function index()
+ {
+ Piwik::checkUserIsSuperUser();
+
+ require_once(dirname(__FILE__) . '/PhpSecInfo/PhpSecInfo.php');
+
+ // instantiate the class
+ $psi = new PhpSecInfo();
+
+ // load and run all tests
+ $psi->loadAndRun();
+
+ // grab the results as a multidimensional array
+ $results = $psi->getResultsAsArray();
+
+ // suppress results
+ unset($results['test_results']['Core']['memory_limit']);
+ unset($results['test_results']['Core']['post_max_size']);
+ unset($results['test_results']['Core']['upload_max_filesize']);
+
+ $view = Piwik_View::factory('index');
+ $this->setGeneralVariablesView($view);
+ $view->menu = Piwik_GetAdminMenu();
+ $view->results = $results;
+ echo $view->render();
+ }
+}