mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 12:03:21 +01:00
[feature/delete-auto-logins] User can view/delete auto logins.
User has an extra option in UCP->Profile to view the auto logins and clear them. PHPBB3-9647
This commit is contained in:
parent
1d0607cbb3
commit
5ce46cc960
@ -23,6 +23,7 @@ class ucp_profile_info
|
||||
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
'avatar' => array('title' => 'UCP_PROFILE_AVATAR', 'auth' => 'cfg_allow_avatar && (cfg_allow_avatar_local || cfg_allow_avatar_remote || cfg_allow_avatar_upload || cfg_allow_avatar_remote_upload)', 'cat' => array('UCP_PROFILE')),
|
||||
'reg_details' => array('title' => 'UCP_PROFILE_REG_DETAILS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
'autologin_keys'=> array('title' => 'UCP_PROFILE_AUTOLOGIN_KEYS', 'auth' => '', 'cat' => array('UCP_PROFILE')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -618,6 +618,46 @@ class ucp_profile
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'autologin_keys':
|
||||
|
||||
add_form_key('ucp_autologin_keys');
|
||||
|
||||
if ($submit)
|
||||
{
|
||||
$keys = request_var('keys', array(''));
|
||||
|
||||
if (!empty($keys))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'] . '
|
||||
AND ' . $db->sql_in_set('key_id', $keys) ;
|
||||
|
||||
$db->sql_query($sql);
|
||||
|
||||
$message = $user->lang['AUTOLOGIN_SESSIONS_KEYS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
|
||||
trigger_error($message);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'SELECT key_id, last_ip, last_login
|
||||
FROM ' . SESSIONS_KEYS_TABLE . '
|
||||
WHERE user_id = ' . (int) $user->data['user_id'];
|
||||
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$template->assign_block_vars('sessions', array(
|
||||
'KEY' => $row['key_id'],
|
||||
'IP' => $row['last_ip'],
|
||||
'LOGIN_TIME' => $row['last_login'],
|
||||
));
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
|
@ -87,6 +87,7 @@ $lang = array_merge($lang, array(
|
||||
'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this board.',
|
||||
'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.',
|
||||
'ATTACHMENT_DELETED' => 'Attachment successfully deleted.',
|
||||
'AUTOLOGIN_SESSION_KEYS_DELETED'=> 'The selected auto-login session keys were successfully deleted.',
|
||||
'AVATAR_CATEGORY' => 'Category',
|
||||
'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$s, height: %2$s, file size: %3$.2f KiB.',
|
||||
'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.',
|
||||
@ -376,6 +377,8 @@ $lang = array_merge($lang, array(
|
||||
'PREFERENCES_UPDATED' => 'Your preferences have been updated.',
|
||||
'PROFILE_INFO_NOTICE' => 'Please note that this information may be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.',
|
||||
'PROFILE_UPDATED' => 'Your profile has been updated.',
|
||||
'PROFILE_AUTOLOGIN_KEYS' => 'The auto-login session keys can be selected and deleted.',
|
||||
'PROFILE_NO_AUTOLOGIN_KEYS' => 'There are no saved auto-login session keys.',
|
||||
|
||||
'RECIPIENT' => 'Recipient',
|
||||
'RECIPIENTS' => 'Recipients',
|
||||
@ -465,6 +468,7 @@ $lang = array_merge($lang, array(
|
||||
'UCP_PROFILE_PROFILE_INFO' => 'Edit profile',
|
||||
'UCP_PROFILE_REG_DETAILS' => 'Edit account settings',
|
||||
'UCP_PROFILE_SIGNATURE' => 'Edit signature',
|
||||
'UCP_PROFILE_AUTOLOGIN_KEYS'=> 'Edit auto-login session keys',
|
||||
|
||||
'UCP_USERGROUPS' => 'Usergroups',
|
||||
'UCP_USERGROUPS_MEMBER' => 'Edit memberships',
|
||||
|
@ -0,0 +1,45 @@
|
||||
<!-- INCLUDE ucp_header.html -->
|
||||
|
||||
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
|
||||
|
||||
<h2>{L_TITLE}</h2>
|
||||
<div class="panel">
|
||||
<div class="inner"><span class="corners-top"><span></span></span>
|
||||
|
||||
<fieldset>
|
||||
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
|
||||
<!-- IF .sessions -->
|
||||
<p>{L_PROFILE_AUTOLOGIN_KEYS}</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Key</th>
|
||||
<th>IP</th>
|
||||
<th>Login-Time</th>
|
||||
</tr>
|
||||
<!-- BEGIN sessions -->
|
||||
<tr>
|
||||
<td><input type="checkbox" name="keys[]" value="{sessions.KEY}" /></td>
|
||||
<td>{sessions.KEY}</td>
|
||||
<td>{sessions.IP}</td>
|
||||
<td>{sessions.LOGIN_TIME}</td>
|
||||
</tr>
|
||||
<!-- END sessions -->
|
||||
</table>
|
||||
<!-- ELSE -->
|
||||
<p>{L_PROFILE_NO_AUTOLOGIN_KEYS}</p>
|
||||
<!-- ENDIF -->
|
||||
</fieldset>
|
||||
<span class="corners-bottom"><span></span></span></div>
|
||||
</div>
|
||||
|
||||
<!-- IF .sessions -->
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />
|
||||
<input type="submit" name="submit" value="{L_DELETE}" class="button1" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE ucp_footer.html -->
|
Loading…
x
Reference in New Issue
Block a user