Example #1
0
 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();
 }
Example #2
0
<?php

require_once '../PhpSecInfo/PhpSecInfo.php';
$opts['format'] = 'Csv';
// the name of the main view file, minus .php
// instantiate the class
$psi = new PhpSecInfo($opts);
// load and run all tests
$psi->loadAndRun();
// grab the standard results output as a string
$output = $psi->getOutput();
// send it to the browser
echo $output;
Example #3
0
/**
 * A globally-available function that runs the tests and creates the result page
 *
 */
function phpsecinfo()
{
    // modded this to not throw a PHP5 STRICT notice, although I don't like passing by value here
    $psi = new PhpSecInfo();
    $psi->loadAndRun();
    $psi->renderOutput();
}
Example #4
0
/**
 * A globally-available function that runs the tests and creates the result page
 *
 */
function phpsecinfo()
{
    ini_set('display_errors', 'On');
    error_reporting(E_ALL);
    $psi = new PhpSecInfo();
    $psi->loadAndRun();
    $psi->renderOutput();
}
Example #5
0
<?php

/**
 * Tests security of eZ Publish install. Based on phpsecinfo tests
 *
 * @author G. Giunta
 * @copyright (C) G. Giunta 2008-2016
 * @license Licensed under GNU General Public License v2.0. See file license.txt
*/
$psi = new PhpSecInfo();
$psi->loadAndRun();
$results = $psi->getResultsAsArray();
// suppress unwanted results
unset($results['test_results']['Suhosin']);
unset($results['test_results']['Core']['file_uploads']);
$tpl->setVariable('results', $results);