|
From: Paul S. O. <ps...@us...> - 2001-11-30 18:51:13
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv28779
Modified Files:
login.php
Log Message:
Allow admins to login to disabled board ... for admin panel access only
Index: login.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/login.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** login.php 2001/11/18 14:00:31 1.33
--- login.php 2001/11/30 18:51:08 1.34
***************
*** 21,24 ****
--- 21,30 ----
***************************************************************************/
+ //
+ // Allow people to reach login page if
+ // board is shut down
+ //
+ define("IN_ADMIN", true);
+
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
***************
*** 41,45 ****
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : "";
! $sql = "SELECT user_id, username, user_password, user_active
FROM ".USERS_TABLE."
WHERE username = '$username'";
--- 47,51 ----
$password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : "";
! $sql = "SELECT user_id, username, user_password, user_active, user_level
FROM ".USERS_TABLE."
WHERE username = '$username'";
***************
*** 54,90 ****
if( count($rowresult) )
{
! if( md5($password) == $rowresult['user_password'] && $rowresult['user_active'] )
{
! $autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0;
! $session_id = session_begin($rowresult['user_id'], $user_ip, PAGE_INDEX, $session_length, TRUE, $autologin);
! if( $session_id )
! {
! if( !empty($HTTP_POST_VARS['redirect']) )
{
! header("Location: " . append_sid($HTTP_POST_VARS['redirect'], true));
}
else
{
! header("Location: " . append_sid("index.$phpEx", true));
}
}
else
{
! message_die(CRITICAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__);
! }
! }
! else
! {
! $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("login.$phpEx?$redirect") . '">')
! );
!
! $message = $lang['Error_login'] . "<br /><br />" . sprintf($lang['Click_return_login'], "<a href=\"" . append_sid("login.$phpEx?$redirect") . "\">", "</a> ") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a> ");
!
! message_die(GENERAL_MESSAGE, $message);
}
}
--- 60,106 ----
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'] )
! {
! $autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0;
! $session_id = session_begin($rowresult['user_id'], $user_ip, PAGE_INDEX, $session_length, TRUE, $autologin);
! if( $session_id )
{
! 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));
! }
}
else
{
! message_die(CRITICAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__);
}
}
else
{
! $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "";
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("login.$phpEx?$redirect") . '">')
! );
!
! $message = $lang['Error_login'] . "<br /><br />" . sprintf($lang['Click_return_login'], "<a href=\"" . append_sid("login.$phpEx?$redirect") . "\">", "</a> ") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a> ");
!
! message_die(GENERAL_MESSAGE, $message);
! }
}
}
***************
*** 111,118 ****
--- 127,136 ----
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));
}
***************
*** 122,129 ****
--- 140,149 ----
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));
}
***************
*** 204,207 ****
--- 224,228 ----
else
{
+ header("HTTP/1.0 302 Redirect");
header("Location: index.$phpEx");
}
|