Jump to content

Logout Redirection


jbougeno

Recommended Posts

I would like to have users redirected back to my main website (NOT WHMCS or Client Area) when they hit the Logout button. I have them logging into the Client Area from my website and when they are finished, I'd like them to end up back at my website.

 

In trying to implement this, I looked at the logout.tpl and logout.php files. The logout.php file appears to be encrypted so nothing to change there. Tried changing the logout.tpl and the change didn't work.

 

Is it possible to implement this and if so, how?

 

Thanks.

Link to comment
Share on other sites

Where do I find the code for logout as I dont see in actions hook

 

Thx

 

It's in the includes folder. Should be right at the top if you list alphabetically.

 

function actionhook_ClientLogout($vars) {

# This function runs when a client logs out

# $vars["ClientID"]

}

Link to comment
Share on other sites

  • 9 months later...
  • 2 weeks later...
  • 2 months later...
Have you tried removing the comment tag? --> This symbol: #

from this line?

 

# $vars["ClientID"]

 

So that it looks like this:

$vars["ClientID"]

 

i've done that but no luck. :(

 

here is How i did it.

 

just go to the template directory you are using,

open logout.tpl

change the link address after {$LANG.logoutsuccessful <a href.... to the url you want to redirect customer,

 

optional is a auto redirect after 2 seconds

<meta http-equiv="refresh" content="2;URL=http://yourdomain.com" />

 

sample code of logout.tpl

<p>{$LANG.logoutsuccessful}  <a href="http://yourdomain.com">{$LANG.logoutcontinuetext}</a></p>
<meta http-equiv="refresh" content="2;URL=http://yourdomain.com" />

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
No i haven't tried.. but would removing # redirect to my domina's home page?

 

 

I just saved the following code in a php file and uploaded it to the includes/hooks directory.

 

<?php

function logout_redirect($vars) {
header( 'Location: http://www.YOUR-SITE.com/' ) ;
}

add_hook("ClientLogout",1,"logout_redirect","");

?>

 

I'm not a programmer, so your comments are welcome if I did something wrong. :-P

Link to comment
Share on other sites

I just saved the following code in a php file and uploaded it to the includes/hooks directory.

 

I'm not a programmer, so your comments are welcome if I did something wrong. :-P

 

Not sure what the extra ,"" was for so removed that and changed the url to /index.php but works good either way... Hadn't got around to doing this but have been meaning to thanks for the assist and not making me think....

Link to comment
Share on other sites

Not sure what the extra ,"" was for so removed that and changed the url to /index.php but works good either way... Hadn't got around to doing this but have been meaning to thanks for the assist and not making me think....

 

Yeah, I noticed the extra "" after my post. It still works, but I went back and deleted it because it wasn't needed. Thanks for the feedback.

Link to comment
Share on other sites

  • 3 years later...

I know this thread is old and outdated, but seeing as I came across it through a Google Search my input may still be useful.

 

Take your logout.tpl file, delete all it's contents, and just add the following:

 

{php}

header('Location: /YourIndexFolder/');

{/php}

 

Hope this helps some people;

 

~ Edward Tate.

Link to comment
Share on other sites

  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated