Logout redirect

Current Version: 1.0.6
Released: 09.01.10
Forum rules
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Logout redirect

Post by JirkaX »

Hi, what is necessary to do to have redirect after logout to portal page (instead to index page)?
Thanks
User avatar

thomas.d
Former Team Member
Posts: 625
Joined: 19. January 2008 23:56
phpBB.de User: thomas.d
phpBB.com User: thomas.d
Contact:

Re: Logout redirect

Post 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 ...
Viele Grüße

Thomas

Deutsche Sprachdateien für
[Alpha] phpBB Calendar 0.0.8 (alightner) | [RC] phpBB Arcade 1.0.RC8 |
ACP Add User MOD 1.0.0 |
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Logout redirect

Post by Ice »

Nah, you have to edit a specific file. I'll find it for you, I just got home. :)
Board3 Portal Dev & English Tech Support
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Logout redirect

Post 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.
Board3 Portal Dev & English Tech Support

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Logout redirect

Post by JirkaX »

Unfortunately doesn't work, redirect is still to the index.php
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Logout redirect

Post 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> ');
Board3 Portal Dev & English Tech Support

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Logout redirect

Post 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");
?
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Logout redirect

Post by Ice »

Yeh just remove the changes I did and replace index with portal.
Board3 Portal Dev & English Tech Support

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Logout redirect

Post by JirkaX »

Great. And one last question - is it possible to modify redirect to go to last page where user clicked on logout?
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: Logout redirect

Post 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.
Board3 Portal Dev & English Tech Support

Topic author
JirkaX
Translator
Posts: 67
Joined: 19. April 2008 14:47

Re: Logout redirect

Post by JirkaX »

Ok, I will try it. Thanks for your help.
Locked

Return to “board3 Portal 1.0.x - English Support”