Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Perun
Perun ProxyIdP
v1
simplesamlphp
Commits
86aa37ba
Unverified
Commit
86aa37ba
authored
7 years ago
by
Tim van Dijen
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
consent: remove unused method
parent
da70f973
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/consent/lib/Consent/Store/Database.php
+5
-37
5 additions, 37 deletions
modules/consent/lib/Consent/Store/Database.php
with
5 additions
and
37 deletions
modules/consent/lib/Consent/Store/Database.php
+
5
−
37
View file @
86aa37ba
...
...
@@ -45,9 +45,9 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
/**
* The timeout of the database connection.
*
* @var int|
NULL
* @var int|
null
*/
private
$_timeout
=
NULL
;
private
$_timeout
=
null
;
/**
* Database handle.
...
...
@@ -70,7 +70,6 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
{
parent
::
__construct
(
$config
);
if
(
!
array_key_exists
(
'dsn'
,
$config
))
{
throw
new
Exception
(
'consent:Database - Missing required option \'dsn\'.'
);
}
...
...
@@ -374,14 +373,13 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
* ' services: Total number of services that has been given consent to
*
* @return array Array containing the statistics
* @TODO Change fixed table name to config option
*/
public
function
getStatistics
()
{
$ret
=
array
();
// Get total number of consents
$st
=
$this
->
_execute
(
'SELECT COUNT(*) AS no FROM
consent'
,
array
());
$st
=
$this
->
_execute
(
'SELECT COUNT(*) AS no FROM
'
.
$this
->
_table
,
array
());
if
(
$st
===
false
)
{
return
array
();
...
...
@@ -394,7 +392,7 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
// Get total number of users that has given consent
$st
=
$this
->
_execute
(
'SELECT COUNT(*) AS no '
.
'FROM (SELECT DISTINCT hashed_user_id FROM
consent
) AS foo'
,
'FROM (SELECT DISTINCT hashed_user_id FROM
'
.
$this
->
_table
.
'
) AS foo'
,
array
()
);
...
...
@@ -408,7 +406,7 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
// Get total number of services that has been given consent to
$st
=
$this
->
_execute
(
'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM
consent
) AS foo'
,
'SELECT COUNT(*) AS no FROM (SELECT DISTINCT service_id FROM
'
.
$this
->
_table
.
'
) AS foo'
,
array
()
);
...
...
@@ -424,36 +422,6 @@ class sspmod_consent_Consent_Store_Database extends sspmod_consent_Store
}
/**
* Create consent table.
*
* This function creates the table with consent data.
*
* @return True if successful, false if not.
*
* @TODO Remove this function since it is not used
*/
private
function
_createTable
()
{
$db
=
$this
->
_getDB
();
if
(
$db
===
false
)
{
return
false
;
}
$res
=
$this
->
db
->
exec
(
'CREATE TABLE '
.
$this
->
_table
.
' (consent_date TIMESTAMP NOT null, usage_date TIMESTAMP NOT null,'
.
'hashed_user_id VARCHAR(80) NOT null, service_id VARCHAR(255) NOT null, attribute VARCHAR(80) NOT null,'
.
'UNIQUE (hashed_user_id, service_id)'
);
if
(
$res
===
false
)
{
SimpleSAML\Logger
::
error
(
'consent:Database - Failed to create table \''
.
$this
->
_table
.
'\'.'
);
return
false
;
}
return
true
;
}
/**
* Get database handle.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment