Merge pull request #1543 from nickvergessen/ticket/11685

[ticket/11685] Remove logout confirmation page
This commit is contained in:
Nathan Guse 2013-07-13 10:37:43 -07:00
commit b6c3939c32
4 changed files with 8 additions and 12 deletions

View file

@ -63,9 +63,7 @@ class acp_main
if ($action === 'admlogout') if ($action === 'admlogout')
{ {
$user->unset_admin(); $user->unset_admin();
$redirect_url = append_sid("{$phpbb_root_path}index.$phpEx"); redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
meta_refresh(3, $redirect_url);
trigger_error($user->lang['ADM_LOGGED_OUT'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
} }
if (!confirm_box(true)) if (!confirm_box(true))

View file

@ -85,17 +85,16 @@ switch ($mode)
{ {
$user->session_kill(); $user->session_kill();
$user->session_begin(); $user->session_begin();
$message = $user->lang['LOGOUT_REDIRECT'];
} }
else else if ($user->data['user_id'] != ANONYMOUS)
{ {
$message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
}
meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> '); $message = $user->lang['LOGOUT_FAILED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
trigger_error($message); trigger_error($message);
}
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
break; break;
case 'terms': case 'terms':

View file

@ -39,7 +39,6 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
// logout // logout
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
$this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text());
// look for a register link, which should be visible only when logged out // look for a register link, which should be visible only when logged out
$crawler = self::request('GET', 'index.php'); $crawler = self::request('GET', 'index.php');

View file

@ -629,7 +629,7 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->add_lang('ucp'); $this->add_lang('ucp');
$crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout'); $crawler = self::request('GET', 'ucp.php?sid=' . $this->sid . '&mode=logout');
$this->assertContains($this->lang('LOGOUT_REDIRECT'), $crawler->filter('#message')->text()); $this->assertContains($this->lang('REGISTER'), $crawler->filter('.navbar')->text());
unset($this->sid); unset($this->sid);
} }