[EN] How to ... Redirect to the portal after login / logout

User avatar

Topic author
Kevin
Site Admin
Site Admin
Posts: 2888
Joined: 7. January 2006 21:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg

[EN] How to ... Redirect to the portal after login / logout

Post by Kevin » 11. July 2008 20:33

FAQ Table Of Contents / Inhaltsverzeichnis

open ucp.php

Redirect to the portal after login

search:

Code: Select all

    case 'login':
        if ($user->data['is_registered'])
        {
            redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
        }

        login_box(request_var('redirect', "index.$phpEx"));
    break; 
replace with:

Code: Select all

    case 'login':
        if ($user->data['is_registered'])
        {
            redirect(append_sid("{$phpbb_root_path}portal.$phpEx"));
        }

        login_box(request_var('redirect', "portal.$phpEx"));
    break; 

Redirect to the portal after logout

search:

Code: Select all

    case 'logout':
        if ($user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === $user->session_id)
        {
            $user->session_kill();
            $user->session_begin();
            $message = $user->lang['LOGOUT_REDIRECT'];
        }
        else
        {
            $message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
        }
        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> ');
        trigger_error($message);

    break; 
replace with:

Code: Select all

    case 'logout':
        if ($user->data['user_id'] != ANONYMOUS && isset($_GET['sid']) && !is_array($_GET['sid']) && $_GET['sid'] === $user->session_id)
        {
            $user->session_kill();
            $user->session_begin();
            $message = $user->lang['LOGOUT_REDIRECT'];
        }
        else
        {
            $message = ($user->data['user_id'] == ANONYMOUS) ? $user->lang['LOGOUT_REDIRECT'] : $user->lang['LOGOUT_FAILED'];
        }
        meta_refresh(3, append_sid("{$phpbb_root_path}portal.$phpEx"));

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

    break; 

Change text "Return to the index page" to "Return to the portal page"

open root\language\en\common.php
search:

Code: Select all

'RETURN_INDEX'				=> '%sReturn to the index page%s',
replace with:

Code: Select all

'RETURN_INDEX'				=> '%sReturn to the portal page%s',
FAQ Table Of Contents / Inhaltsverzeichnis
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Return to “KB-Archiv”