From 5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 9 Mar 2003 16:11:08 +0000 Subject: Enable per session view online, change layout, potential for links to terms and privacy policy git-svn-id: file:///svn/phpbb/trunk@3623 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/login.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'phpBB/login.php') diff --git a/phpBB/login.php b/phpBB/login.php index 793e261ea1..41b61df083 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -43,6 +43,7 @@ if (isset($login) || isset($logout)) if (isset($login) && $user->data['user_id'] == ANONYMOUS) { $autologin = (!empty($autologin)) ? true : false; + $viewonline = (!empty($viewonline)) ? 0 : 1; // Is the board disabled? Are we an admin? No, then back to the index we go if (!empty($config['board_disable']) && !$auth->acl_get('a_')) @@ -50,13 +51,18 @@ if (isset($login) || isset($logout)) redirect("index.$phpEx$SID"); } - if (!$auth->login($username, $password, $autologin)) + if (($result = $auth->login($username, $password, $autologin, $viewonline)) !== true) { - $template->assign_vars(array( - 'META' => '') - ); + // If we get a non-numeric (e.g. string) value we output an error + if (!is_numeric($result)) + { + trigger_error($result, E_USER_ERROR); + } + + // If we get an integer zero then we are inactive, else the username/password is wrong + $message = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR']; + $message .= '

' . sprintf($user->lang['RETURN_LOGIN'], '', '') . '

' . sprintf($user->lang['RETURN_INDEX'], '', ''); - $message = $user->lang['Error_login'] . '

' . sprintf($user->lang['Click_return_login'], '', '') . '

' . sprintf($user->lang['Click_return_index'], '', ''); trigger_error($message); } } @@ -65,25 +71,22 @@ if (isset($login) || isset($logout)) $user->destroy(); } - // // Redirect to wherever we're supposed to go ... - // - $redirect_url = ($redirect) ? preg_replace('/^.*?redirect=(.*?)&(.*?)$/', '\\1' . $SID . '&\\2', $redirect) : 'index.'.$phpEx; + $redirect_url = ($redirect) ? preg_replace('#^.*?redirect=(.*?)&(.*?)$#', '\1' . $SID . '&\2', $redirect) : 'index.'.$phpEx; redirect($redirect_url); } if ($user->data['user_id'] == ANONYMOUS) { $template->assign_vars(array( - 'L_ENTER_PASSWORD' => $user->lang['Enter_password'], - 'L_SEND_PASSWORD' => $user->lang['Forgotten_password'], - 'U_SEND_PASSWORD' => "ucp.$phpEx$SID&mode=sendpassword", + 'U_TERMS_USE' => "ucp.$phpEx$SID&mode=terms", + 'U_PRIVACY' => "ucp.$phpEx$SID&mode=privacy", 'S_HIDDEN_FIELDS' => '') ); - $page_title = $user->lang['Login']; + $page_title = $user->lang['LOGIN']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( -- cgit v1.2.1