-
Notifications
You must be signed in to change notification settings - Fork 17
/
Controller.php
45 lines (35 loc) · 1.08 KB
/
Controller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
namespace Piwik\Plugins\SecurityInfo;
use PhpSecInfo;
use Piwik\Piwik;
use Piwik\View;
/**
*/
class Controller extends \Piwik\Plugin\ControllerAdmin
{
public function index()
{
Piwik::checkUserHasSuperUserAccess();
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 = new View('@SecurityInfo/index');
$this->setBasicVariablesView($view);
$view->results = $results;
return $view->render();
}
}