mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-13 14:58:52 +00:00
Allow admins to login to disabled board ... for admin panel access only
git-svn-id: file:///svn/phpbb/trunk@1490 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
84856b8499
commit
153d4b548a
1 changed files with 44 additions and 23 deletions
|
@ -20,6 +20,12 @@
|
||||||
*
|
*
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
//
|
||||||
|
// Allow people to reach login page if
|
||||||
|
// board is shut down
|
||||||
|
//
|
||||||
|
define("IN_ADMIN", true);
|
||||||
|
|
||||||
$phpbb_root_path = "./";
|
$phpbb_root_path = "./";
|
||||||
include($phpbb_root_path . 'extension.inc');
|
include($phpbb_root_path . 'extension.inc');
|
||||||
include($phpbb_root_path . 'common.'.$phpEx);
|
include($phpbb_root_path . 'common.'.$phpEx);
|
||||||
|
@ -40,7 +46,7 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
$username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : "";
|
$username = isset($HTTP_POST_VARS['username']) ? $HTTP_POST_VARS['username'] : "";
|
||||||
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : "";
|
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : "";
|
||||||
|
|
||||||
$sql = "SELECT user_id, username, user_password, user_active
|
$sql = "SELECT user_id, username, user_password, user_active, user_level
|
||||||
FROM ".USERS_TABLE."
|
FROM ".USERS_TABLE."
|
||||||
WHERE username = '$username'";
|
WHERE username = '$username'";
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
@ -52,6 +58,13 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
$rowresult = $db->sql_fetchrow($result);
|
$rowresult = $db->sql_fetchrow($result);
|
||||||
|
|
||||||
if( count($rowresult) )
|
if( count($rowresult) )
|
||||||
|
{
|
||||||
|
if( $rowresult['user_level'] != ADMIN && $board_config['board_disable'] )
|
||||||
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
|
header("Location: " . append_sid("index.$phpEx", true));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if( md5($password) == $rowresult['user_password'] && $rowresult['user_active'] )
|
if( md5($password) == $rowresult['user_password'] && $rowresult['user_active'] )
|
||||||
{
|
{
|
||||||
|
@ -63,10 +76,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
{
|
{
|
||||||
if( !empty($HTTP_POST_VARS['redirect']) )
|
if( !empty($HTTP_POST_VARS['redirect']) )
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid("index.$phpEx", true));
|
header("Location: " . append_sid("index.$phpEx", true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,6 +103,7 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
message_die(GENERAL_MESSAGE, $message);
|
message_die(GENERAL_MESSAGE, $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
|
$redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
|
||||||
|
@ -110,10 +126,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
|
|
||||||
if( !empty($HTTP_POST_VARS['redirect']) )
|
if( !empty($HTTP_POST_VARS['redirect']) )
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid("index.$phpEx", true));
|
header("Location: " . append_sid("index.$phpEx", true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,10 +139,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
|
||||||
{
|
{
|
||||||
if( !empty($HTTP_POST_VARS['redirect']) )
|
if( !empty($HTTP_POST_VARS['redirect']) )
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: " . append_sid("index.$phpEx", true));
|
header("Location: " . append_sid("index.$phpEx", true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,6 +223,7 @@ else
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
header("HTTP/1.0 302 Redirect");
|
||||||
header("Location: index.$phpEx");
|
header("Location: index.$phpEx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue