diff options
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r-- | include/functions_user.inc.php | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index ac85d1b47..de8f87c7f 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -945,10 +945,13 @@ function log_user($user_id, $remember_me) { // make sure we clean any remember me ... setcookie($conf['remember_me_name'], '', 0, cookie_path(),ini_get('session.cookie_domain')); } - if ( session_id()!="" and (version_compare(PHP_VERSION, '7') <= 0 or version_compare(PHP_VERSION, '7.0.3') >= 0)) + if ( session_id()!="" ) { // we regenerate the session for security reasons // see http://www.acros.si/papers/session_fixation.pdf - session_regenerate_id(true); + if (version_compare(PHP_VERSION, '7') <= 0) + { + session_regenerate_id(true); + } } else { @@ -1593,4 +1596,22 @@ SELECT return create_user_auth_key($user_id, $user_status); } } + +/** + * Deactivates authentication keys + * + * @since 2.8 + * @param int $user_id + * @return null + */ +function deactivate_user_auth_keys($user_id) +{ + $query = ' +UPDATE '.USER_AUTH_KEYS_TABLE.' + SET expired_on = NOW() + WHERE user_id = '.$user_id.' + AND expired_on > NOW() +;'; + pwg_query($query); +} ?> |