Jump to content

logout hook no longer works after upgrade


Recommended Posts

Hello - appreciate if someone could guide me here.

the following logout hook has been working correctly so far. However it stopped working when i upgraded to v 8.0. Can anyone comment why this hook failing after upgrade?

/**
redirect to login page without taking then to WHMCS domain search page when user logs out
 */

<?php

function logout_redirect($vars) {
    header( 'Location: https://xxxxxx.com/clientarea.php' ) ;
}

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

?>

 

Link to comment
Share on other sites

thank you @brian!   i trried out following code per your suggestions, still it is not working..  please comment if i'm doing it wrong or not.

 

/**
redirect to login page without taking then to WHMCS domain search page when user logs out
 */

<?php

function logout_redirect($vars) {
    header( 'Location: https://xxxxxx.com/clientarea.php' ) ;
}

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

?>

 

 

 

 

Link to comment
Share on other sites

26 minutes ago, VirtualWorldGlobal said:

will this hook work for both primary and contacts both ?

it's a v8 hook and only users can login into v8 - so as written, the hook should redirect every user logging out to the same URL.

to predict the next question you're thinking - can you detect whether the user is a user or an owner and redirect them to different locations ?? the answer should be yes, you just need to determine who the user is and redirect accordingly.

Edited by brian!
Link to comment
Share on other sites

50 minutes ago, brian! said:

to predict the next question you're thinking - can you detect whether the user is a user or an owner and redirect them to different locations ?? the answer should be yes, you just need to determine who the user is and redirect accordingly.

😄 😃  😃  😄 😃  I am not going to do that again. Clients were just going round and round after login, they clicked billing to pay their invoices and again landed up to home.  I am looking for something which can automatically take clients to -  https://domainname.com/clients/clientarea.php

I also wanted to know about a hook and have messaged you, can you please have a look. 

Thanks

 

Edited by VirtualWorldGlobal
Link to comment
Share on other sites

1 hour ago, brian! said:

the following hook should work...


<?php
add_hook('UserLogout', 1, function($vars) {
	header('Location: clientarea.php');
	exit;
});

remember that if you're redirecting to another WHMCS page, you shouldn't need to use the full URL.

 

thank you @brian!   it worked perfectly. Now my users are able to see login scree as soon as they click 'logout'!!!

 

 

Edited by jimsweb
Link to comment
Share on other sites

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