mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-09 10:16:36 +02:00
merge
git-svn-id: file:///svn/phpbb/trunk@8587 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -60,6 +60,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'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_url . '">', '</a>'));
|
||||
}
|
||||
|
||||
if (!confirm_box(true))
|
||||
{
|
||||
switch ($action)
|
||||
@@ -107,6 +115,7 @@ class acp_main
|
||||
{
|
||||
switch ($action)
|
||||
{
|
||||
|
||||
case 'online':
|
||||
if (!$auth->acl_get('a_board'))
|
||||
{
|
||||
|
@@ -2176,6 +2176,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
|
||||
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
|
||||
{
|
||||
global $db, $user, $template, $auth, $config;
|
||||
|
||||
|
||||
$err = '';
|
||||
|
||||
@@ -2184,6 +2185,16 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
{
|
||||
$user->setup();
|
||||
}
|
||||
|
||||
if (defined('ADMIN_START'))
|
||||
{
|
||||
// Set custom template for admin area
|
||||
$template->set_custom_template(PHPBB_ADMIN_PATH . 'style', 'admin');
|
||||
$template->assign_var('T_TEMPLATE_PATH', PHPBB_ADMIN_PATH . 'style');
|
||||
|
||||
// the acp template is never stored in the database
|
||||
$user->theme['template_storedb'] = false;
|
||||
}
|
||||
|
||||
// Print out error if user tries to authenticate as an administrator without having the privileges...
|
||||
if ($admin && !$auth->acl_get('a_'))
|
||||
@@ -2351,7 +2362,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
// If we are not within the admin directory we use the page dir...
|
||||
$redirect = '';
|
||||
|
||||
if (!$admin)
|
||||
if (!$admin && !defined('ADMIN_START'))
|
||||
{
|
||||
$redirect .= ($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '';
|
||||
}
|
||||
@@ -2384,24 +2395,47 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
||||
'U_PRIVACY' => append_sid('ucp', 'mode=privacy'),
|
||||
|
||||
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
|
||||
'S_LOGIN_ACTION' => (!$admin) ? append_sid('ucp', 'mode=login') : append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, false, true, $user->session_id),
|
||||
'S_LOGIN_ACTION' => (!$admin && !defined('ADMIN_START')) ? append_sid('ucp', 'mode=login') : append_sid(PHPBB_ADMIN_PATH . 'index.' . PHP_EXT, false, true, $user->session_id),
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
|
||||
'S_ADMIN_AUTH' => $admin,
|
||||
'S_ACP_LOGIN' => defined('ADMIN_START'),
|
||||
'USERNAME' => ($admin) ? $user->data['username'] : '',
|
||||
|
||||
'USERNAME_CREDENTIAL' => 'username',
|
||||
'PASSWORD_CREDENTIAL' => ($admin) ? 'password_' . $credential : 'password',
|
||||
));
|
||||
|
||||
page_header($user->lang['LOGIN'], false);
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'login_body.html')
|
||||
);
|
||||
|
||||
if (defined('ADMIN_START'))
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'body' => 'acp_login.html')
|
||||
);
|
||||
$template->assign_block_vars('t_block1', array(
|
||||
'L_TITLE' => $user->lang['LOGIN'],
|
||||
'S_SELECTED' => true,
|
||||
'U_TITLE' => '',
|
||||
));
|
||||
adm_page_header($user->lang['LOGIN'], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$template->set_filenames(array(
|
||||
'body' => 'login_body.html')
|
||||
);
|
||||
page_header($user->lang['LOGIN'], false);
|
||||
}
|
||||
|
||||
make_jumpbox(append_sid('viewforum'));
|
||||
|
||||
page_footer();
|
||||
if (defined('ADMIN_START') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
{
|
||||
adm_page_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
page_footer();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3003,7 +3037,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
|
||||
if (!defined('HEADER_INC'))
|
||||
{
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('ADMIN_START') || (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']))
|
||||
{
|
||||
adm_page_header($msg_title);
|
||||
}
|
||||
@@ -3027,7 +3061,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
|
||||
// We do not want the cron script to be called on error messages
|
||||
define('IN_CRON', true);
|
||||
|
||||
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])
|
||||
if (defined('ADMIN_START') || (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']))
|
||||
{
|
||||
adm_page_footer();
|
||||
}
|
||||
|
@@ -1321,6 +1321,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user