blob: c9b307bba4455bebda576ae2197a05eb01287572 (
plain)
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
|
<?php
/**
* Piwik - Open source web analytics
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
* @category Piwik_Plugins
* @package Piwik_SecurityInfo
*/
use Piwik\Piwik;
/**
* @package Piwik_SecurityInfo
*/
class Piwik_SecurityInfo_Controller extends Piwik_Controller_Admin
{
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 = new Piwik_View('@SecurityInfo/index');
$this->setBasicVariablesView($view);
$view->results = $results;
echo $view->render();
}
}
|