+
-
' . sprintf($user->lang['RETURN_INDEX'], '', '')); + } + if (!confirm_box(true)) { switch ($action) @@ -108,6 +116,7 @@ class acp_main { switch ($action) { + case 'online': if (!$auth->acl_get('a_board')) { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 435618f7ff..828739115f 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1332,6 +1332,16 @@ class session } return true; } + + + function unset_admin() + { + global $db; + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_admin = 0 + WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\''; + $db->sql_query($sql); + } } diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 85c57fb1c3..9ed92bfcfb 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -201,6 +201,9 @@ $lang = array_merge($lang, array( 'ADMIN_INDEX' => 'Admin index', 'ADMIN_PANEL' => 'Administration Control Panel', + 'ADM_LOGOUT' => 'ACP Logout', + 'ADM_LOGGED_OUT' => 'Successfully logged out from Administration Control Panel', + 'BACK' => 'Back', 'COLOUR_SWATCH' => 'Web-safe colour swatch',
{L_LOGGED_IN_AS}
{USERNAME} [ {L_LOGOUT} ]
{L_LOGGED_IN_AS}
{USERNAME} [ {L_LOGOUT} ][ {L_ADM_LOGOUT} ]
-
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index de46bb1232..e0fb51610b 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -109,6 +109,8 @@
- [Fix] Do not remove whitespace in front of url containing the boards url and no relative path appended (Bug #27355)
- [Change] Show email ban reason on registration. Additionally allow custom errors properly returned if using validate_data(). (Bug #26885)
- [Feature] Streamlined banning via the MCP by adding a ban link to the user profile. Also pre-fills ban fields as far as possible. +
- [Feature] Added ACP logout to reset an admin session. +
1.ii. Changes since 3.0.0
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index be337a20f3..7498ab2aef 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -61,6 +61,14 @@ class acp_main if ($action) { + if ($action === 'admlogout') + { + $user->unset_admin(); + $redirect_url = append_sid("{$phpbb_root_path}index.$phpEx"); + meta_refresh(3, $redirect_url); + trigger_error($user->lang['ADM_LOGGED_OUT'] . '' . sprintf($user->lang['RETURN_INDEX'], '', '')); + } + if (!confirm_box(true)) { switch ($action) @@ -108,6 +116,7 @@ class acp_main { switch ($action) { + case 'online': if (!$auth->acl_get('a_board')) { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 435618f7ff..828739115f 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1332,6 +1332,16 @@ class session } return true; } + + + function unset_admin() + { + global $db; + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_admin = 0 + WHERE session_id = \'' . $db->sql_escape($this->session_id) . '\''; + $db->sql_query($sql); + } } diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 85c57fb1c3..9ed92bfcfb 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -201,6 +201,9 @@ $lang = array_merge($lang, array( 'ADMIN_INDEX' => 'Admin index', 'ADMIN_PANEL' => 'Administration Control Panel', + 'ADM_LOGOUT' => 'ACP Logout', + 'ADM_LOGGED_OUT' => 'Successfully logged out from Administration Control Panel', + 'BACK' => 'Back', 'COLOUR_SWATCH' => 'Web-safe colour swatch',