diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-09 16:11:08 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-03-09 16:11:08 +0000 |
| commit | 5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad (patch) | |
| tree | 3f00963da5e926ea6ef3683ea0a62b91c782c0ed /phpBB/login.php | |
| parent | cd9b3af2b5e76ee12651c17316ae9d0d9e84130f (diff) | |
| download | forums-5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad.tar forums-5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad.tar.gz forums-5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad.tar.bz2 forums-5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad.tar.xz forums-5cdf2b0b5902ad6073fb098a430cbb82dd91e3ad.zip | |
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
Diffstat (limited to 'phpBB/login.php')
| -rw-r--r-- | phpBB/login.php | 27 |
1 files changed, 15 insertions, 12 deletions
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' => '<meta http-equiv="refresh" content="3;url=' . "login.$phpEx$SID&redirect=$redirect" . '">') - ); + // 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 .= '<br /><br />' . sprintf($user->lang['RETURN_LOGIN'], '<a href="' . "login.$phpEx$SID&redirect=$redirect" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . "index.$phpEx$SID" . '">', '</a>'); - $message = $user->lang['Error_login'] . '<br /><br />' . sprintf($user->lang['Click_return_login'], '<a href="' . "login.$phpEx$SID&redirect=$redirect" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_index'], '<a href="' . "index.$phpEx$SID" . '">', '</a>'); 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' => '<input type="hidden" name="redirect" value="' . $redirect . '" />') ); - $page_title = $user->lang['Login']; + $page_title = $user->lang['LOGIN']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( |
