Skip to content
Snippets Groups Projects
Commit 3c161db5 authored by Olav Morken's avatar Olav Morken
Browse files

consentSimpleAdmin: Use new selftest-function on database backend.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3309 44740490-163a-0410-bde0-09ae8108e29a
parent 59808793
No related branches found
No related tags found
No related merge requests found
......@@ -13,12 +13,18 @@ function consentSimpleAdmin_hook_sanitycheck(&$hookinfo) {
// Parse consent config
$consent_storage = sspmod_consent_Store::parseStoreConfig($consentconfig->getValue('store'));
// Get all consents for user
$stats = $consent_storage->getStatistics();
$hookinfo['info'][] = '[consentSimpleAdmin] Consent Storage connection OK.';
if (!is_callable(array($consent_storage, 'selftest'))) {
/* Doesn't support a selftest. */
return;
}
$testres = $consent_storage->selftest();
if ($testres) {
$hookinfo['info'][] = '[consentSimpleAdmin] Consent Storage selftest OK.';
} else {
$hookinfo['errors'][] = '[consentSimpleAdmin] Consent Storage selftest failed.';
}
} catch (Exception $e) {
$hookinfo['errors'][] = '[consentSimpleAdmin] Error connecting to storage: ' . $e->getMessage();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment