mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 11:44:08 +02:00
[ticket/security/276] Centralise call for token expiration
SECURITY-276
This commit is contained in:
@@ -57,7 +57,7 @@ class user extends \phpbb\session
|
||||
* @param \phpbb\language\language $lang phpBB's Language loader
|
||||
* @param string $datetime_class Class name of datetime class
|
||||
*/
|
||||
function __construct(\phpbb\language\language $lang, $datetime_class)
|
||||
public function __construct(\phpbb\language\language $lang, $datetime_class)
|
||||
{
|
||||
global $phpbb_root_path;
|
||||
|
||||
@@ -78,6 +78,16 @@ class user extends \phpbb\session
|
||||
return $this->is_setup_flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get expiration time for user tokens, e.g. activation or reset password tokens
|
||||
*
|
||||
* @return int Expiration for user tokens
|
||||
*/
|
||||
public static function get_token_expiration(): int
|
||||
{
|
||||
return strtotime('+1 day') ?: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Magic getter for BC compatibility
|
||||
*
|
||||
|
Reference in New Issue
Block a user