📄 panel_logout.php
字号:
<?php/* Copyright (C) 2003-2005 UseBB Team http://www.usebb.net $Header: /cvsroot/usebb/UseBB/sources/panel_logout.php,v 1.15 2005/08/13 11:36:09 pc_freak Exp $ This file is part of UseBB. UseBB is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. UseBB is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with UseBB; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*///// Die when called directly in browser//if ( !defined('INCLUDED') ) exit();//// User wants to logout//$session->update('logout');if ( !$session->sess_info['user_id'] ) { $functions->redirect('index.php'); } else { if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if ( !empty($_POST['logout']) ) { $refere_to = $functions->get_config('board_url').$functions->make_url('index.php', array(), false); $session->destroy(); } else { // // Get us back to the previous page // $refere_to = ( !empty($_SESSION['refere_to']) ) ? $functions->attach_sid($_SESSION['refere_to']) : $functions->get_config('board_url').$functions->make_url('index.php', array(), false); unset($_SESSION['refere_to']); } $functions->raw_redirect($refere_to); } else { $_SERVER['HTTP_REFERER'] = ( !empty($_SERVER['HTTP_REFERER']) && preg_match('#^'.preg_quote($functions->get_config('board_url'), '#').'#', $_SERVER['HTTP_REFERER']) && !preg_match('#(login|logout|register|activate|sendpwd|install)#', $_SERVER['HTTP_REFERER']) ) ? $_SERVER['HTTP_REFERER'] : ''; $_SESSION['refere_to'] = ( !empty($_SESSION['referer']) ) ? $_SESSION['referer'] : $_SERVER['HTTP_REFERER']; unset($_SESSION['referer']); // // Include the page header // require(ROOT_PATH.'sources/page_head.php'); $template->set_page_title(sprintf($lang['LogOut'], unhtml(stripslashes($session->sess_info['user_info']['name'])))); $template->parse('confirm_form', 'global', array( 'form_begin' => '<form action="'.$functions->make_url('panel.php', array('act' => 'logout')).'" method="post">', 'title' => sprintf($lang['LogOut'], unhtml(stripslashes($session->sess_info['user_info']['name']))), 'content' => $lang['LogOutConfirm'], 'submit_button' => '<input type="submit" name="logout" value="'.$lang['Yes'].'" />', 'cancel_button' => '<input type="submit" value="'.$lang['Cancel'].'" />', 'form_end' => '</form>' )); // // Include the page footer // require(ROOT_PATH.'sources/page_foot.php'); } }?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -