Exemplo n.º 1
0
if (empty($userids)) {
    throw new Exception('Could not generate useridentifier for storing consent. Attribute [' . $userid_attributename . '] was not available.');
}
$userid = $userids[0];
// Get all SP metadata
$all_sp_metadata = $metadata->getList('saml20-sp-remote');
// Parse action, if any
$action = null;
$sp_entityid = null;
if (!empty($_GET['cv'])) {
    $sp_entityid = $_GET['cv'];
}
if (!empty($_GET['action'])) {
    $action = $_GET["action"];
}
SimpleSAML\Logger::critical('consentAdmin: sp: ' . $sp_entityid . ' action: ' . $action);
// Remove services, whitch have consent disabled
if (isset($idp_metadata['consent.disable'])) {
    foreach ($idp_metadata['consent.disable'] as $disable) {
        if (array_key_exists($disable, $all_sp_metadata)) {
            unset($all_sp_metadata[$disable]);
        }
    }
}
SimpleSAML\Logger::info('consentAdmin: ' . $idp_entityid);
// Calc correct source
$source = $idp_metadata['metadata-set'] . '|' . $idp_entityid;
// Parse consent config
$consent_storage = sspmod_consent_Store::parseStoreConfig($cA_config->getValue('consentadmin'));
// Calc correct user ID hash
$hashed_user_id = sspmod_consent_Auth_Process_Consent::getHashedUserID($userid, $source);