diff --git a/lib/AccountLinker/Store/SQLStore.php b/lib/AccountLinker/Store/SQLStore.php index 0e24457..b4d5181 100644 --- a/lib/AccountLinker/Store/SQLStore.php +++ b/lib/AccountLinker/Store/SQLStore.php @@ -196,7 +196,7 @@ public function matchIdentifiableAttributes() // @todo Check if IDP gives identifiable attributes AT ALL (should be at least one!). Otherwise throw error back to IDP $count = 0; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { - SimpleSAML_Logger::debug('AccountLinker: Checking for attribute \''.$row['name'].'\''); + SimpleSAML_Logger::stats('AccountLinker: Checking for attribute \''.$row['name'].'\''); if (isset($this->_attributes[$row['name']])) { $count++; //$stmt2 = $dbh->prepare("SELECT a.account_id, a.attributeproperty_id @@ -213,17 +213,17 @@ public function matchIdentifiableAttributes() $stmt3 = $dbh->prepare("SELECT name FROM attributeproperties WHERE attributeproperty_id=:attribute_id"); $stmt3->execute(array(':attribute_id' => $return[1])); $attribute_name = $stmt3->fetchColumn(); - SimpleSAML_Logger::debug('AccountLinker: Found match on attribute \''.$attribute_name .'\' for account id '. $return[0]); + SimpleSAML_Logger::stats('AccountLinker: Found match on attribute \''.$attribute_name .'\' for account id '. $return[0]); $this->_accountId = $return[0]; return $this->_accountId; } } - SimpleSAML_Logger::debug('AccountLinker: Attribute \''.$row['name'].'\' not found in metadata/datastore'); + SimpleSAML_Logger::stats('AccountLinker: Attribute \''.$row['name'].'\' not found in metadata/datastore'); } if ($count === 0) { $error = 'Could not find any of the attributes to determine who you are'; - SimpleSAML_Logger::debug('AccountLinker: EXCEPTION '.$error); + SimpleSAML_Logger::stats('AccountLinker: EXCEPTION '.$error); #throw new Exception('AccountLinking '.$error ); $this->_handleException(); } @@ -333,14 +333,14 @@ public function saveAttributes() $accountId = $this->_getAccountId(); foreach ($insertValues as $attributePropertyId => $value) { if (count($value) === 1) { - SimpleSAML_Logger::debug('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$value[0] . '\''); + SimpleSAML_Logger::stats('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$value[0] . '\''); $query .= "(".$accountId."," .$attributePropertyId."," .$dbh->quote($value[0])."),"; } else { // multivalue attribute foreach ($value as $val) { - SimpleSAML_Logger::debug('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$val.'\''); + SimpleSAML_Logger::stats('AccountLinker: Inserting '.$attributeMapping[$attributePropertyId].' => \''.$val.'\''); $query .= "(".$accountId."," .$attributePropertyId."," .$dbh->quote($val)."),"; @@ -406,7 +406,7 @@ public function saveSpEntityId() ':spentityid' => $this->_spEntityId )); - SimpleSAML_Logger::debug('AccountLinker: Returning user_id '.$userId); + SimpleSAML_Logger::stats('AccountLinker: Returning user_id '.$userId); return $userId; } @@ -418,7 +418,7 @@ public function saveSpEntityId() */ public function addIdentifiableAttributes() { - SimpleSAML_Logger::debug('AccountLinker: adding default id attributes for entityid_id: '. $this->_getEntityidId()); + SimpleSAML_Logger::stats('AccountLinker: adding default id attributes for entityid_id: '. $this->_getEntityidId()); $dbh = $this->_getStore(); $stmt = $dbh->prepare("INSERT INTO idattributes (attribute_id, entity_id, aorder) VALUES (:attribute_id,:entity_id, :aorder)"); $stmt->execute(array( @@ -451,7 +451,7 @@ private function _handleException() 'idp_entityID' => $this->getEntityId() ); $queryString = $this->_ehsURL.'?'.http_build_query($data); - SimpleSAML_Logger::debug('TAL EHS:'.$queryString); + SimpleSAML_Logger::stats('TAL EHS:'.$queryString); SimpleSAML_Utilities::redirect($queryString); } diff --git a/lib/Auth/Process/AccountLinker.php b/lib/Auth/Process/AccountLinker.php index 5e2666b..91caf68 100644 --- a/lib/Auth/Process/AccountLinker.php +++ b/lib/Auth/Process/AccountLinker.php @@ -74,32 +74,32 @@ public function process(&$request) $this->_store->setRequest($request); - SimpleSAML_Logger::debug('AccountLinker: === BEGIN === '); + SimpleSAML_Logger::stats('AccountLinker: === BEGIN === '); if ($this->_store->hasEntityId()) { - SimpleSAML_Logger::debug('AccountLinker: entityid '.$this->_store->getEntityId().' is already known here'); - SimpleSAML_Logger::debug('AccountLinker: SP entityid '.$this->_store->getSpEntityId() ); + SimpleSAML_Logger::stats('AccountLinker: entityid '.$this->_store->getEntityId().' is already known here'); + SimpleSAML_Logger::stats('AccountLinker: SP entityid '.$this->_store->getSpEntityId() ); if (!$this->_store->matchIdentifiableAttributes()) { - SimpleSAML_Logger::debug('AccountLinker: no account match found, adding account'); + SimpleSAML_Logger::stats('AccountLinker: no account match found, adding account'); $this->_store->addAccount(); $newAccount = true; } } else { - SimpleSAML_Logger::debug('AccountLinker: entityid does not exist, adding it'); + SimpleSAML_Logger::stats('AccountLinker: entityid does not exist, adding it'); $this->_store->addEntityId(); $this->_store->addIdentifiableAttributes(); - SimpleSAML_Logger::debug('AccountLinker: entityid does not exist, adding account'); + SimpleSAML_Logger::stats('AccountLinker: entityid does not exist, adding account'); $this->_store->addAccount(); } - SimpleSAML_Logger::debug('AccountLinker: Inserting attributes'); + SimpleSAML_Logger::stats('AccountLinker: Inserting attributes'); if ($this->_store->saveAttributes()) { $request['Attributes'][$this->_accountIdPrefix.':user_id'] = array( $this->_store->saveSpEntityId() ); - SimpleSAML_Logger::debug('AccountLinker: === END === '); + SimpleSAML_Logger::stats('AccountLinker: === END === '); } }