Page 1 of 1

Logout redirect

Posted: 9. May 2008 13:36
by JirkaX
Hi, what is necessary to do to have redirect after logout to portal page (instead to index page)?
Thanks

Re: Logout redirect

Posted: 9. May 2008 13:48
by thomas.d
JirkaX wrote:Hi, what is necessary to do to have redirect after logout to portal page (instead to index page)?
Thanks
Hm, I guess you have to modify your .htaccess-file (in forum-root) about like this:

Code: Select all

<Files "config.php">
Order Allow,Deny
Deny from All
</Files>

<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

DirectoryIndex portal.php index.php index.html index.htm
In the last line is defined that portal.php is called first if it exists, if not index.php will be opened and so on ...

Re: Logout redirect

Posted: 9. May 2008 17:14
by Ice
Nah, you have to edit a specific file. I'll find it for you, I just got home. :)

Re: Logout redirect

Posted: 9. May 2008 18:24
by Ice
Edit ucp.php
Find - Line 95

Code: Select all

		meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
	
		$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');
Replace with

Code: Select all

		$portal_logout = request_var('portal_logout', 0);
		if( !$portal_logout )
		{
			$redirect_link = append_sid("{$phpbb_root_path}index.$phpEx");
			
		} else {
			$redirect_link = append_sid("{$phpbb_root_path}portal.$phpEx");
		}

		meta_refresh(3, $redirect_link);	
		$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_link . '">', '</a> ');
Open styless/*/template/portal/block/user_menu.php
Find

Code: Select all

{U_LOGIN_LOGOUT}
Replace with

Code: Select all

{U_LOGIN_LOGOUT}&portal_logout=1
Should work.

Re: Logout redirect

Posted: 9. May 2008 19:10
by JirkaX
Unfortunately doesn't work, redirect is still to the index.php

Re: Logout redirect

Posted: 9. May 2008 20:57
by Ice
Try

Code: Select all

		$portal_logout = request_var('portal_logout', 0);
		if( !$portal_logout )
		{
			$redirect_link = append_sid("{$phpbb_root_path}index.$phpEx");
			
		} else {
			$redirect_link = append_sid("{$phpbb_root_path}portal.$phpEx");
		}

		meta_refresh(3, $redirect_link);	
		$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect_link . '">', '</a> ');

Re: Logout redirect

Posted: 9. May 2008 21:35
by JirkaX
Now when I perform logout on portal page, I'm redirected to portal page, when I perform logout on board index page, I'm redirected to board index page. Is it possible to be redirected to portal page every time? If so, should I change code below

Code: Select all

if( !$portal_logout )
      {
         $redirect_link = append_sid("{$phpbb_root_path}index.$phpEx");
         
      } else {
         $redirect_link = append_sid("{$phpbb_root_path}portal.$phpEx");
      }
to

Code: Select all

$redirect_link = append_sid("{$phpbb_root_path}portal.$phpEx");
?

Re: Logout redirect

Posted: 9. May 2008 22:39
by Ice
Yeh just remove the changes I did and replace index with portal.

Re: Logout redirect

Posted: 9. May 2008 22:47
by JirkaX
Great. And one last question - is it possible to modify redirect to go to last page where user clicked on logout?

Re: Logout redirect

Posted: 9. May 2008 22:50
by Ice
You'd have to make quite a few changes to the logout script, for that you'd have to fiddle with it yourself I'm afraid.

Re: Logout redirect

Posted: 9. May 2008 23:00
by JirkaX
Ok, I will try it. Thanks for your help.