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
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
acacb116
Unverified
Commit
acacb116
authored
7 years ago
by
Jaime Pérez Crespo
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the API provided by SimpleSAML\Auth\TimeLimitedToken.
s/generateToken/generate/ && s/validateToken/validate/
parent
abcfd1af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/SimpleSAML/Auth/TimeLimitedToken.php
+8
-8
8 additions, 8 deletions
lib/SimpleSAML/Auth/TimeLimitedToken.php
with
8 additions
and
8 deletions
lib/SimpleSAML/Auth/TimeLimitedToken.php
+
8
−
8
View file @
acacb116
...
@@ -80,7 +80,7 @@ class TimeLimitedToken
...
@@ -80,7 +80,7 @@ class TimeLimitedToken
*
*
* @return string A time-limited token with the offset respect to the beginning of its time slot prepended.
* @return string A time-limited token with the offset respect to the beginning of its time slot prepended.
*/
*/
public
function
generate
Token
()
public
function
generate
()
{
{
$time
=
time
();
$time
=
time
();
$current_offset
=
(
$time
-
$this
->
skew
)
%
(
$this
->
lifetime
+
$this
->
skew
);
$current_offset
=
(
$time
-
$this
->
skew
)
%
(
$this
->
lifetime
+
$this
->
skew
);
...
@@ -89,12 +89,12 @@ class TimeLimitedToken
...
@@ -89,12 +89,12 @@ class TimeLimitedToken
/**
/**
* @see generate
Token
* @see generate
* @deprecated This method will be removed in SSP 2.0. Use generate
Token
() instead.
* @deprecated This method will be removed in SSP 2.0. Use generate() instead.
*/
*/
public
function
generate_token
()
public
function
generate_token
()
{
{
return
$this
->
generate
Token
();
return
$this
->
generate
();
}
}
...
@@ -105,7 +105,7 @@ class TimeLimitedToken
...
@@ -105,7 +105,7 @@ class TimeLimitedToken
*
*
* @return boolean True if the given token is currently valid, false otherwise.
* @return boolean True if the given token is currently valid, false otherwise.
*/
*/
public
function
validate
Token
(
$token
)
public
function
validate
(
$token
)
{
{
$splittoken
=
explode
(
'-'
,
$token
);
$splittoken
=
explode
(
'-'
,
$token
);
if
(
count
(
$splittoken
)
!==
2
)
{
if
(
count
(
$splittoken
)
!==
2
)
{
...
@@ -118,11 +118,11 @@ class TimeLimitedToken
...
@@ -118,11 +118,11 @@ class TimeLimitedToken
/**
/**
* @see validate
Token
* @see validate
* @deprecated This method will be removed in SSP 2.0. Use validate
Token
() instead.
* @deprecated This method will be removed in SSP 2.0. Use validate() instead.
*/
*/
public
function
validate_token
(
$token
)
public
function
validate_token
(
$token
)
{
{
return
$this
->
validate
Token
(
$token
);
return
$this
->
validate
(
$token
);
}
}
}
}
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