Skip to content
Snippets Groups Projects
Unverified Commit acacb116 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Simplify the API provided by SimpleSAML\Auth\TimeLimitedToken.

s/generateToken/generate/ && s/validateToken/validate/
parent abcfd1af
No related branches found
No related tags found
No related merge requests found
...@@ -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 generateToken() 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 generateToken * @see generate
* @deprecated This method will be removed in SSP 2.0. Use generateToken() instead. * @deprecated This method will be removed in SSP 2.0. Use generate() instead.
*/ */
public function generate_token() public function generate_token()
{ {
return $this->generateToken(); 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 validateToken($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 validateToken * @see validate
* @deprecated This method will be removed in SSP 2.0. Use validateToken() 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->validateToken($token); return $this->validate($token);
} }
} }
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