Revision: 3309
Author:   olavmrk
Date:     Tue Dec  3 13:22:13 2013 UTC
Log:      consentSimpleAdmin: Use new selftest-function on database backend.
http://code.google.com/p/simplesamlphp/source/detail?r=3309

Modified:
 /trunk/modules/consentSimpleAdmin/hooks/hook_sanitycheck.php

=======================================
--- /trunk/modules/consentSimpleAdmin/hooks/hook_sanitycheck.php Thu Feb 26 07:19:00 2009 UTC +++ /trunk/modules/consentSimpleAdmin/hooks/hook_sanitycheck.php Tue Dec 3 13:22:13 2013 UTC
@@ -13,12 +13,18 @@

                // 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();
        }

--
You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to simplesamlphp-commits+unsubscr...@googlegroups.com.
To post to this group, send email to simplesamlphp-commits@googlegroups.com.
Visit this group at http://groups.google.com/group/simplesamlphp-commits.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to