Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit a502401

Browse files
authored
Merge pull request #15 from GEANT/dv_log_as_debug
use debug again
2 parents f62a098 + bb531c2 commit a502401

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

lib/AccountLinker/Store/SQLStore.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function matchIdentifiableAttributes()
196196
// @todo Check if IDP gives identifiable attributes AT ALL (should be at least one!). Otherwise throw error back to IDP
197197
$count = 0;
198198
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
199-
SimpleSAML_Logger::stats('AccountLinker: Checking for attribute \''.$row['name'].'\'');
199+
SimpleSAML_Logger::debug('AccountLinker: Checking for attribute \''.$row['name'].'\'');
200200
if (isset($this->_attributes[$row['name']])) {
201201
$count++;
202202
//$stmt2 = $dbh->prepare("SELECT a.account_id, a.attributeproperty_id
@@ -213,17 +213,17 @@ public function matchIdentifiableAttributes()
213213
$stmt3 = $dbh->prepare("SELECT name FROM attributeproperties WHERE attributeproperty_id=:attribute_id");
214214
$stmt3->execute(array(':attribute_id' => $return[1]));
215215
$attribute_name = $stmt3->fetchColumn();
216-
SimpleSAML_Logger::stats('AccountLinker: Found match on attribute \''.$attribute_name .'\' for account id '. $return[0]);
216+
SimpleSAML_Logger::debug('AccountLinker: Found match on attribute \''.$attribute_name .'\' for account id '. $return[0]);
217217
$this->_accountId = $return[0];
218218
return $this->_accountId;
219219
}
220220
}
221-
SimpleSAML_Logger::stats('AccountLinker: Attribute \''.$row['name'].'\' not found in metadata/datastore');
221+
SimpleSAML_Logger::debug('AccountLinker: Attribute \''.$row['name'].'\' not found in metadata/datastore');
222222
}
223223

224224
if ($count === 0) {
225225
$error = 'Could not find any of the attributes to determine who you are';
226-
SimpleSAML_Logger::stats('AccountLinker: EXCEPTION '.$error);
226+
SimpleSAML_Logger::debug('AccountLinker: EXCEPTION '.$error);
227227
#throw new Exception('AccountLinking '.$error );
228228
$this->_handleException();
229229
}
@@ -333,14 +333,14 @@ public function saveAttributes()
333333
$accountId = $this->_getAccountId();
334334
foreach ($insertValues as $attributePropertyId => $value) {
335335
if (count($value) === 1) {
336-
SimpleSAML_Logger::stats('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$value[0] . '\'');
336+
SimpleSAML_Logger::debug('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$value[0] . '\'');
337337
$query .= "(".$accountId.","
338338
.$attributePropertyId.","
339339
.$dbh->quote($value[0])."),";
340340
} else {
341341
// multivalue attribute
342342
foreach ($value as $val) {
343-
SimpleSAML_Logger::stats('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$val.'\'');
343+
SimpleSAML_Logger::debug('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$val.'\'');
344344
$query .= "(".$accountId.","
345345
.$attributePropertyId.","
346346
.$dbh->quote($val)."),";
@@ -412,7 +412,7 @@ public function saveSpEntityId()
412412
':user_agent' => $_SERVER['HTTP_USER_AGENT'] ?? ''
413413
));
414414

415-
SimpleSAML_Logger::stats('AccountLinker: Returning user_id '.$userId);
415+
SimpleSAML_Logger::debug('AccountLinker: Returning user_id '.$userId);
416416
return $userId;
417417
}
418418

@@ -424,7 +424,7 @@ public function saveSpEntityId()
424424
*/
425425
public function addIdentifiableAttributes()
426426
{
427-
SimpleSAML_Logger::stats('AccountLinker: adding default id attributes for entityid_id: '. $this->_getEntityidId());
427+
SimpleSAML_Logger::debug('AccountLinker: adding default id attributes for entityid_id: '. $this->_getEntityidId());
428428
$dbh = $this->_getStore();
429429
$stmt = $dbh->prepare("INSERT INTO idattributes (attribute_id, entity_id, aorder) VALUES (:attribute_id,:entity_id, :aorder)");
430430
$stmt->execute(array(
@@ -457,7 +457,7 @@ private function _handleException()
457457
'idp_entityID' => $this->getEntityId()
458458
);
459459
$queryString = $this->_ehsURL.'?'.http_build_query($data);
460-
SimpleSAML_Logger::stats('TAL EHS:'.$queryString);
460+
SimpleSAML_Logger::debug('TAL EHS:'.$queryString);
461461
SimpleSAML_Utilities::redirect($queryString);
462462
}
463463

lib/Auth/Process/AccountLinker.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -74,32 +74,32 @@ public function process(&$request)
7474

7575
$this->_store->setRequest($request);
7676

77-
SimpleSAML_Logger::stats('AccountLinker: === BEGIN === ');
77+
SimpleSAML_Logger::debug('AccountLinker: === BEGIN === ');
7878

7979
if ($this->_store->hasEntityId()) {
80-
SimpleSAML_Logger::stats('AccountLinker: entityid '.$this->_store->getEntityId().' is already known here');
81-
SimpleSAML_Logger::stats('AccountLinker: SP entityid '.$this->_store->getSpEntityId() );
80+
SimpleSAML_Logger::debug('AccountLinker: entityid '.$this->_store->getEntityId().' is already known here');
81+
SimpleSAML_Logger::debug('AccountLinker: SP entityid '.$this->_store->getSpEntityId() );
8282
if (!$this->_store->matchIdentifiableAttributes()) {
83-
SimpleSAML_Logger::stats('AccountLinker: no account match found, adding account');
83+
SimpleSAML_Logger::debug('AccountLinker: no account match found, adding account');
8484
$this->_store->addAccount();
8585
$newAccount = true;
8686
}
8787
} else {
88-
SimpleSAML_Logger::stats('AccountLinker: entityid does not exist, adding it');
88+
SimpleSAML_Logger::debug('AccountLinker: entityid does not exist, adding it');
8989
$this->_store->addEntityId();
9090
$this->_store->addIdentifiableAttributes();
91-
SimpleSAML_Logger::stats('AccountLinker: entityid does not exist, adding account');
91+
SimpleSAML_Logger::debug('AccountLinker: entityid does not exist, adding account');
9292
$this->_store->addAccount();
9393
}
9494

95-
SimpleSAML_Logger::stats('AccountLinker: Inserting attributes');
95+
SimpleSAML_Logger::debug('AccountLinker: Inserting attributes');
9696

9797
if ($this->_store->saveAttributes()) {
9898
$request['Attributes'][$this->_accountIdPrefix.':user_id'] = array(
9999
$this->_store->saveSpEntityId()
100100
);
101101

102-
SimpleSAML_Logger::stats('AccountLinker: === END === ');
102+
SimpleSAML_Logger::debug('AccountLinker: === END === ');
103103
}
104104

105105
}

0 commit comments

Comments
 (0)