diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-01-30 11:48:02 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2004-01-30 11:48:02 +0000 |
| commit | c2f5e580aa3b38f65a8c3545013f0a2c64070c06 (patch) | |
| tree | 3d3f459b8655612f54a85ca2f581b06111890026 /phpBB/includes/functions.php | |
| parent | 0608bc73e6465cc7251300fa7798cd674d77b547 (diff) | |
| download | forums-c2f5e580aa3b38f65a8c3545013f0a2c64070c06.tar forums-c2f5e580aa3b38f65a8c3545013f0a2c64070c06.tar.gz forums-c2f5e580aa3b38f65a8c3545013f0a2c64070c06.tar.bz2 forums-c2f5e580aa3b38f65a8c3545013f0a2c64070c06.tar.xz forums-c2f5e580aa3b38f65a8c3545013f0a2c64070c06.zip | |
Enable redirect after login
git-svn-id: file:///svn/phpbb/trunk@4768 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3ba26e68cc..e0f9655cc8 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -938,10 +938,12 @@ function login_box($s_action, $s_hidden_fields = '', $login_explain = '') $err = ''; if (isset($_POST['login'])) { - $autologin = (!empty($_POST['autologin'])) ? TRUE : FALSE; + $username = request_var('username', ''); + $password = request_var('password', ''); + $autologin = (!empty($_POST['autologin'])) ? TRUE : FALSE; $viewonline = (!empty($_POST['viewonline'])) ? 0 : 1; - if (($result = $auth->login($_POST['username'], $_POST['password'], $autologin, $viewonline)) === true) + if (($result = $auth->login($username, $password, $autologin, $viewonline)) === true) { // TODO // Force change password ... plugin for EVENT_LOGIN in future @@ -960,6 +962,8 @@ function login_box($s_action, $s_hidden_fields = '', $login_explain = '') $err = ($result === 0) ? $user->lang['ACTIVE_ERROR'] : $user->lang['LOGIN_ERROR']; } + $s_hidden_fields = (!empty($_SERVER['HTTP_REFERER'])) ? '<input type="hidden" name="redirect" value="' . htmlspecialchars($_SERVER['HTTP_REFERER']) . '" />' : ''; + $template->assign_vars(array( 'LOGIN_ERROR' => $err, 'LOGIN_EXPLAIN' => $login_explain, |
