1

Topic: Logout redirect

Hy all

I made a "Splash-Page" on my server called index.html. It's the first page that a user see if he visit my page. On this page he has to acceppt the terms and enter the vld-page located on --> index.php.

I just noticed, that the logout redirect is set to the webserver /root (.html).

Is there any way to change the redirect after logout to www.mysite.com/index.php ?

Best regards
wink

Last edited by nuMarc (2008-06-25 02:24:59)

2

Re: Logout redirect

Edit 'includes/lib/lib.account_logout.php' and change redirection path.

3

Re: Logout redirect

Hy vlad

Thank you for your quick reply.

Can you tell me, what I should insert there if I want to link my users to www.mysite.com/index.php?

I entered index.php there, but it doesn't work so far wink

Best regards

4

Re: Logout redirect

Insert a full path to the page you want to redirect to. Make sure you use double/single quotes around it.

5

Re: Logout redirect

Hi vlad,

this doesn't work or i am having a mistake.

lib.account_logout.php -> "redirect (VIR_PATH);"

Now i want to redirect to http://singlejoy.de/page/logout but all i tried doesn't work. I have a white page after logging out with http://singlejoy.de/account/logout in the addressline.

How do i have to change the redirect?

Thanks....


Edit:
It works now.... i forgot the () around the path... wink

Last edited by impression (2009-04-07 11:06:23)

6

Re: Logout redirect

I'm trying to redirect members after they log in so that instead of being taken to their profile they are take directly to the home page.  I looked in lib.account_login.php found "account/home/" and "index.php?m=account_home) in three places and figured I should change these.  Am I on the right path?  Can some one fill me on on the rest?

Much appreciated

7

Re: Logout redirect

Here are my redirection notes for 2.5.3. Hope it helps.

----------------------------------------------------------------
REDIRECTING AFTER MEMBER SENDS MESSAGE.
-----------------------------------------------------------------

By default when a member composes a messages (PM) and clicks the submit button he is redirected to the SENT template (account_messages_sent.tlp). Instead I want the member to be redircted to a custom page.

HERE IS HOW:

1. OPEN: lib.account_messages.php

2. FIND:

//------------------------------------------------
// Set message and redirect to edit member
//------------------------------------------------
$TEMPLATE->set_message("info", ($LANG['messages']['sent']), 0, 0);
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/messages/sent/" : "index.php?m=account_messages&p=sent"));


3. CHANGE TO:

//------------------------------------------------
// Set message and redirect to edit member
//------------------------------------------------
$TEMPLATE->set_message("info", ($LANG['messages']['sent']), 0, 0);
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "FilipinaEyes.html" : "index.php?m=FilipinaEyes"));


NOTE: The above change redirects them to a custom page on scamming. The URL is http://www.filipinaeyes.com/online-dati … /scam.html


----------------------------------------------------------------
REDIRECTING TO CUSTOM PAGE
----------------------------------------------------------------


I wanted to create a custom page that members would be redirected to after the filled out the sign up form. Here is how I did it:

MY NOTES ON CREATING A WELCOME CUSTOM PAGE AND REDIRECTING THE MEMBER TO THE CUSTOM PAGE AFTER THEY SIGN UP.


1. Create custom template. I did one for FE called page_welcome


2. The URL to the custom page is: http://www.filipinaeyes.com/online-dati … lcome.html


3. Make the following changes to lib.account_register.php (asian-welcome is the keyword from the URL that I will be using in the code below).


FIND: redirect( VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/home/" : "index.php?m=account_home") );

CHNAGE TO: redirect( VIR_PATH . ($PREFS->conf['fancy_urls'] ? "asian-welcome.html" : "index.php?m=asian-welcome") );


NOTE: Instead of the member being redirected to account home, he or she will now be rediredted to the custom page after they sign up for the site.


-------------------------------------------
REDIRECTING AFTER MEMBER LOGS IN
-------------------------------------------

HERE IS HOW:

1. OPEN: lib.account_login.php

2. FIND AND MAKE THE FOLLOWING CHANGES:


$request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/home/" : "index.php?m=account_home");

CHANGE TO:

$request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "asian-eds.html" : "index.php?m=asian-eds");



redirect( VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/home/" : "index.php?m=account_home") );

CHANGE TO:

redirect( VIR_PATH . ($PREFS->conf['fancy_urls'] ? "asian-eds.html" : "index.php?m=asian-eds") );


NOTE THE ABOVE CHANGES REFLECT REDIRECTION TO MEMBER HOST CUSTOM PAGE


-------------------------------------------
REDIRECTING AFTER MEMBER LOGS OUT
-------------------------------------------

HERE IS HOW:

1. OPEN: lib.account_logout.php

2. FIND:

//------------------------------------------------
// Redirect back to index page
//------------------------------------------------
redirect(VIR_PATH);

CHANGE TO:

//------------------------------------------------
// Redirect back to index page
//------------------------------------------------
redirect(VIR_PATH . ($PREFS->conf['fancy_urls'] ? "FilipinaEyes.html" :
"index.php?m=pages&p=FilipinaEyes"), 1);

8

Re: Logout redirect

Wow thanks man.  I found

$request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/home/" : "index.php?m=account_home");

twice in the code and the other one once.  At first I switched account/home/ and account_home to homepage.tpl and homepage but that didn't work.  I played around with a few things and eventually just deleted them both and left the quotation marks there.  Does this seem right?  It worked like a charm but I worry about running into some unforseen problem down the road.

Thanks

9

Re: Logout redirect

rustys wrote

Wow thanks man.  I found

$request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "account/home/" : "index.php?m=account_home");

twice in the code and the other one once.  At first I switched account/home/ and account_home to homepage.tpl and homepage but that didn't work.  I played around with a few things and eventually just deleted them both and left the quotation marks there.  Does this seem right?  It worked like a charm but I worry about running into some unforseen problem down the road.

Thanks

I'm not sure I follow. Do this: Tell us what template you changed and post your code here for us to look at.

10

Re: Logout redirect

The template I use is webby2 but I didn't go into the template file.  I went into lib.account_login.php  This is what I have the code starting at line 72


    $request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "" : "index.php?m=");
        }
        redirect( $request_uri );
    }
    elseif ( isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] ) {
        $request_uri = $_SERVER['HTTP_REFERER'];
        if ( isset($_POST['islogin'])  &&  $_POST['islogin'] && (strcmp($request_uri, VIR_PATH) == 0 || strcmp($request_uri.'/', VIR_PATH) == 0 || strpos($request_uri, 'account_login') !== false || strpos($request_uri, 'account/login') !== false) ) {
            $request_uri = VIR_PATH . ($PREFS->conf['fancy_urls'] ? "" : "index.php?m=");
        }
        redirect( $request_uri );
    }
    else {
        redirect( VIR_PATH . ($PREFS->conf['fancy_urls'] ? "" : "index.php?m=") );
    }

11

Re: Logout redirect

I never seen it done that way, but if it works, it works. Good job.