aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-06-11 23:39:09 +0200
committerNils Adermann <naderman@naderman.de>2012-06-11 23:39:09 +0200
commit5acbf0980dd948c110c8573431b8e08b4a42352a (patch)
treeb9da4e26ac4620274db3022204698ee5b57d686c /phpBB/includes
parent3852f78bb4f640f4ad0bc7c084bbade4d12e79bd (diff)
parenta9549cbe6ab66732fcf9c321496b74943e2972e7 (diff)
downloadforums-5acbf0980dd948c110c8573431b8e08b4a42352a.tar
forums-5acbf0980dd948c110c8573431b8e08b4a42352a.tar.gz
forums-5acbf0980dd948c110c8573431b8e08b4a42352a.tar.bz2
forums-5acbf0980dd948c110c8573431b8e08b4a42352a.tar.xz
forums-5acbf0980dd948c110c8573431b8e08b4a42352a.zip
Merge remote-tracking branch 'github-dhruvgoel92/feature/delete-auto-logins' into develop
* github-dhruvgoel92/feature/delete-auto-logins: [feature-delete-auto-logins] adds module to database update [feature/delete-auto-logins] fixes style [feature/delete-auto-logins] improves styling [feature/delete-auto-logins] fixes language entry [feature/delete-auto-logins] fix language keys and styling [feature/delete-auto-logins] explain persistent keys in the ucp. [feature/delete-auto-logins] template added for subsilver2 [feature/delete-auto-logins] improved styling and fixes language [feature/delete-auto-logins] using loop for errors [feature/delete-auto-logins] fixes css corners [feature/delete-auto-logins] Fixes language entries [feature/delete-auto-logins] checks form key [feature/delete-auto-logins] Fixes language entries and redirection. [feature/delete-auto-logins] User can view/delete auto logins.
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php1
-rw-r--r--phpBB/includes/ucp/ucp_profile.php54
2 files changed, 55 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..2ac82fb52f 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -618,6 +618,60 @@ class ucp_profile
}
break;
+
+ case 'autologin_keys':
+
+ add_form_key('ucp_autologin_keys');
+
+ if ($submit)
+ {
+ $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 . '
+ WHERE user_id = ' . (int) $user->data['user_id'] . '
+ AND ' . $db->sql_in_set('key_id', $keys) ;
+
+ $db->sql_query($sql);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['AUTOLOGIN_SESSION_KEYS_DELETED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
+ }
+ }
+
+ // 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'];
+
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $template->assign_block_vars('sessions', array(
+ 'errors' => $error,
+
+ 'KEY' => $row['key_id'],
+ 'IP' => $row['last_ip'],
+ 'LOGIN_TIME' => $user->format_date($row['last_login']),
+ ));
+ }
+
+ $db->sql_freeresult($result);
+
+ break;
}
$template->assign_vars(array(