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:
Paul S. Owen 2001-11-30 18:51:08 +00:00
parent 84856b8499
commit 153d4b548a

View file

@ -20,6 +20,12 @@
*
***************************************************************************/
//
// Allow people to reach login page if
// board is shut down
//
define("IN_ADMIN", true);
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
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'] : "";
$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."
WHERE username = '$username'";
$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);
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'] )
{
@ -63,10 +76,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
{
if( !empty($HTTP_POST_VARS['redirect']) )
{
header("HTTP/1.0 302 Redirect");
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
}
else
{
header("HTTP/1.0 302 Redirect");
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);
}
}
}
else
{
$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']) )
{
header("HTTP/1.0 302 Redirect");
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
}
else
{
header("HTTP/1.0 302 Redirect");
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']) )
{
header("HTTP/1.0 302 Redirect");
header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
}
else
{
header("HTTP/1.0 302 Redirect");
header("Location: " . append_sid("index.$phpEx", true));
}
}
@ -203,6 +223,7 @@ else
}
else
{
header("HTTP/1.0 302 Redirect");
header("Location: index.$phpEx");
}