Exemple #1
0
    $results = array();
} elseif (array_key_exists('reset', $_GET) && $_GET['reset'] === '1') {
    $results = array();
}
#echo('<pre>'); print_r($results); exit;
$start = microtime(TRUE);
$previous = microtime(TRUE);
$maxtime = $ldapStatusConfig->getValue('maxExecutionTime', 15);
if (array_key_exists('orgtest', $_REQUEST)) {
    #$old_error_handler = set_error_handler("myErrorHandler");
    $cli = array();
    $locindex = 0;
    if (array_key_exists('locindex', $_REQUEST)) {
        $locindex = $_REQUEST['locindex'];
    }
    SimpleSAML_Logger::setCaptureLog();
    $orgconfig = SimpleSAML_Configuration::loadFromArray($orgs[$_REQUEST['orgtest']], 'org:[' . $_REQUEST['orgtest'] . ']');
    $orgloc = $orgs[$_REQUEST['orgtest']]['locations'][$locindex];
    $orgloc = mergeWithTemplate($orgloc, $locationTemplate);
    $classname = SimpleSAML_Module::resolveClass($orgloc['testType'], 'Auth_Backend_Test');
    $tester = new $classname(SimpleSAML_Configuration::loadFromArray($orgloc, 'Location@[' . $_REQUEST['orgtest'] . ']'), $orgconfig);
    $res = $tester->test();
    // Machine readable output
    if (array_key_exists('output', $_REQUEST) && $_REQUEST['output'] === 'text') {
        $ignores = array();
        if (array_key_exists('ignore', $_REQUEST)) {
            $ignores = explode(',', $_REQUEST['ignore']);
        }
        $ok = TRUE;
        foreach ($res as $tag => $resEntry) {
            if (in_array($tag, $ignores)) {
Exemple #2
0
<?php

$config = SimpleSAML_Configuration::getInstance();
$mconfig = SimpleSAML_Configuration::getOptionalConfig('config-metarefresh.php');
SimpleSAML\Utils\Auth::requireAdmin();
SimpleSAML_Logger::setCaptureLog(TRUE);
$sets = $mconfig->getConfigList('sets', array());
foreach ($sets as $setkey => $set) {
    SimpleSAML_Logger::info('[metarefresh]: Executing set [' . $setkey . ']');
    try {
        $expireAfter = $set->getInteger('expireAfter', NULL);
        if ($expireAfter !== NULL) {
            $expire = time() + $expireAfter;
        } else {
            $expire = NULL;
        }
        $metaloader = new sspmod_metarefresh_MetaLoader($expire);
        # Get global black/whitelists
        $blacklist = $mconfig->getArray('blacklist', array());
        $whitelist = $mconfig->getArray('whitelist', array());
        // get global type filters
        $available_types = array('saml20-idp-remote', 'saml20-sp-remote', 'shib13-idp-remote', 'shib13-sp-remote', 'attributeauthority-remote');
        $set_types = $set->getArrayize('types', $available_types);
        foreach ($set->getArray('sources') as $source) {
            // filter metadata by type of entity
            if (isset($source['types'])) {
                $metaloader->setTypes($source['types']);
            } else {
                $metaloader->setTypes($set_types);
            }
            # Merge global and src specific blacklists