Guest benpotter1991 Posted February 28, 2012 Share Posted February 28, 2012 Hi there, For a few weeks I have been developing a system for my website to manage users with domain/hosting products. However I have recently decided to integrate this with WHMCS. I wish to continue using my custom login/logout pages and so far have successfully managed to set up hooks so that - (using my custom login page) when a user logs in they are logged into their WHMCS account. - when a user logs out they are logged out of WHMCS and redirected to my custom log out page. However I have a small issue which I could use a hand with. When a user (who is not logged in) tries to access a WHMCS-page which requires the user to be logged in, the WHMCS-based login form is displayed. In this situation I would rather the user be somehow redirected to my custom login page. Is there a way I can do this? I can't seem to find one myself. I appreciate any help given! - Ben 0 Quote Link to comment Share on other sites More sharing options...
Guest benpotter1991 Posted February 28, 2012 Share Posted February 28, 2012 I have actually figured out a way that suits what I need, not sure if its the best way but hey it works! Right at the top of header.tpl I have the code {php} if ($this->_tpl_vars['loginpage'] == 1) { $redirect_to = substr($this->_tpl_vars['SCRIPT_NAME'], 1); header('location: https://site.com/customlogin.php?redirect=' . $redirect_to); exit(); } {/php} 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.