mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/delete-auto-logins] checks form key
The form key is checked after submission if not correct error is returned. PHPBB3-9647
This commit is contained in:
parent
79ef960435
commit
4129711e9f
1 changed files with 23 additions and 10 deletions
|
@ -627,6 +627,13 @@ class ucp_profile
|
|||
{
|
||||
$keys = request_var('keys', array(''));
|
||||
|
||||
if (!check_form_key('ucp_autologin_keys'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (!sizeof($error))
|
||||
{
|
||||
if (!empty($keys))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
|
@ -641,6 +648,10 @@ class ucp_profile
|
|||
}
|
||||
}
|
||||
|
||||
// Replace "error" strings with their real, localised form
|
||||
$error = array_map(array($user, 'lang'), $error);
|
||||
}
|
||||
|
||||
$sql = 'SELECT key_id, last_ip, last_login
|
||||
FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'];
|
||||
|
@ -650,6 +661,8 @@ class ucp_profile
|
|||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('sessions', array(
|
||||
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
|
||||
|
||||
'KEY' => $row['key_id'],
|
||||
'IP' => $row['last_ip'],
|
||||
'LOGIN_TIME' => $row['last_login'],
|
||||
|
|
Loading…
Add table
Reference in a new issue