From b11d0cfcc37a27bfef6060245d6cf1f3b93cbae2 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Sat, 20 Jan 2018 12:07:56 +0100
Subject: [PATCH] consent: Fix for consent-statistics

As per mailinglist-discussion, consent-stats were never processed by the statistics-module due to inconsistent logging:
https://groups.google.com/forum/#!topic/simplesamlphp/Gc97OeUox2k
---
 modules/consent/lib/Auth/Process/Consent.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/consent/lib/Auth/Process/Consent.php b/modules/consent/lib/Auth/Process/Consent.php
index 2319c36c0..b0a6cd5df 100644
--- a/modules/consent/lib/Auth/Process/Consent.php
+++ b/modules/consent/lib/Auth/Process/Consent.php
@@ -288,12 +288,12 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
             try {
                 if ($this->_store->hasConsent($userId, $targetedId, $attributeSet)) {
                     // Consent already given
-                    SimpleSAML\Logger::stats('Consent: Consent found');
+                    SimpleSAML\Logger::stats('consent found');
                     SimpleSAML_Stats::log('consent:found', $statsData);
                     return;
                 }
 
-                SimpleSAML\Logger::stats('Consent: Consent notfound');
+                SimpleSAML\Logger::stats('consent notfound');
                 SimpleSAML_Stats::log('consent:notfound', $statsData);
 
                 $state['consent:store'] = $this->_store;
@@ -302,11 +302,11 @@ class sspmod_consent_Auth_Process_Consent extends SimpleSAML_Auth_ProcessingFilt
                 $state['consent:store.attributeSet'] = $attributeSet;
             } catch (Exception $e) {
                 SimpleSAML\Logger::error('Consent: Error reading from storage: '.$e->getMessage());
-                SimpleSAML\Logger::stats('Consent: Failed');
+                SimpleSAML\Logger::stats('Ccnsent failed');
                 SimpleSAML_Stats::log('consent:failed', $statsData);
             }
         } else {
-            SimpleSAML\Logger::stats('Consent: No storage');
+            SimpleSAML\Logger::stats('consent nostorage');
             SimpleSAML_Stats::log('consent:nostorage', $statsData);
         }
 
-- 
GitLab