Page 1 of 1

Login Redirect

Posted: 05 May 2010, 19:47
by Post Bot
Login Redirect
Written by primehalo

Returns a user to the page they were at prior to logging in.

Open: includes/functions.php
Find:

Code: Select all

$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login');
Add after:

Code: Select all

//-- mod: Prime Login Return ------------------------------------------------//
		$redirect = ($user->page['page_dir'] || $user->page['page_name'] == "ucp.$phpEx") ? '' : '&redirect=' . urlencode(str_replace('&', '&', build_url(array('_f_'))));
		$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login' . $redirect);
//-- end: Prime Login Return ------------------------------------------------//
Find:

Code: Select all

// application/xhtml+xml not used because of IE
	header('Content-type: text/html; charset=UTF-8');
Add before:

Code: Select all

//-- mod: Prime Login Return ------------------------------------------------//
	if (($redirect = request_var('redirect', '')) != '')
	{
		$template->assign_var('S_LOGIN_REDIRECT', build_hidden_fields(array('redirect' => $redirect)));
	}
//-- end: Prime Login Return ------------------------------------------------//

Re: Login Redirect

Posted: 05 May 2010, 19:56
by cisco007
once again you are making Oliver very happy!

Re: Login Redirect

Posted: 06 May 2010, 00:21
by Oliver
Very Good. Thanks. These are very hard to find.

Re: Login Redirect

Posted: 06 May 2010, 00:29
by cisco007
they are not hard to find, you just have to know how to look!