Skip to content
Snippets Groups Projects
Commit 4341b6b1 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Adding a getList() function to the consentstorage

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@375 44740490-163a-0410-bde0-09ae8108e29a
parent 4c96d47c
No related branches found
No related tags found
No related merge requests found
...@@ -122,6 +122,8 @@ class SimpleSAML_Consent_Consent { ...@@ -122,6 +122,8 @@ class SimpleSAML_Consent_Consent {
$targeted_id = $this->getTargetedID($hashed_user_id); $targeted_id = $this->getTargetedID($hashed_user_id);
$attribute_hash = $this->getAttributeHash(); $attribute_hash = $this->getAttributeHash();
try { try {
// Create a consent storage. // Create a consent storage.
$consent_storage = new SimpleSAML_Consent_Storage($this->config); $consent_storage = new SimpleSAML_Consent_Storage($this->config);
...@@ -131,6 +133,7 @@ class SimpleSAML_Consent_Consent { ...@@ -131,6 +133,7 @@ class SimpleSAML_Consent_Consent {
$this->storageerror = true; $this->storageerror = true;
return false; return false;
} }
/** /**
* User has given cosent and asked for storing it for later. * User has given cosent and asked for storing it for later.
*/ */
......
...@@ -65,6 +65,22 @@ class SimpleSAML_Consent_Storage { ...@@ -65,6 +65,22 @@ class SimpleSAML_Consent_Storage {
} }
/**
* Lookup consent database for an entry, and update the timestamp.
*
* @return Will return true if consent is stored, and false if consent is not stored.
*/
public function getList($user_id) {
$stmt = $this->dbh->prepare("SELECT * FROM consent WHERE federation_id = ?");
$stmt->execute(array($user_id));
SimpleSAML_Logger::debug('Library - ConsentStorage getList(): Getting list of all consent entries for a user');
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
/** /**
* Store user consent in database * Store user consent in database
*/ */
......
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