aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php1
-rw-r--r--phpBB/includes/ucp/ucp_profile.php40
-rw-r--r--phpBB/language/en/ucp.php4
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html45
4 files changed, 90 insertions, 0 deletions
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index 09c0318de9..968538a178 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -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')),
),
);
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 9d81503f0a..f3e0984685 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -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(
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 2212e44628..1e36b4e9f7 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -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',
diff --git a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
new file mode 100644
index 0000000000..ad7b7a920d
--- /dev/null
+++ b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
@@ -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" />&nbsp;
+ <input type="submit" name="submit" value="{L_DELETE}" class="button1" />
+ {S_FORM_TOKEN}
+ </fieldset>
+<!-- ENDIF -->
+</form>
+
+<!-- INCLUDE ucp_footer.html -->