sol2010 Posted May 3, 2017 Share Posted May 3, 2017 In my custom page, I have a check to see if user / client is logged in. If not, it links to the clientarea.php login page. But how to send user back to my custompage once they've logged in? For example: Login here: mysite.com/clientlogin?&redirectto_custompage.php Or - even better, how could I add a login popup modal on the custom page, which will allow them to login right there. I've searched and searched and can't find any relevant information on this. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 3, 2017 Share Posted May 3, 2017 what's in your php code that creates the custompage.php file in the first place? 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted May 5, 2017 Author Share Posted May 5, 2017 Hi Brian The custom page is a copy of serverstatus.tpl. It contains a bunch of divs with live server status information from an external 3rd party source (iframe). I would like the user to be logged in to view. It's easy to link to the login page using {if !$loggedin} but of course that does not redirect the user back to my custom page. I want to either have a popup login modal (similar to the top toolbar login popover) that would allow a login box on the page without redirect (Ajax?), or if not easy to do that, then send user to login page, then redirect back to the custom page once logged in. I'm aware of hooks, I'm just not sure how to implement. Thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 5, 2017 Share Posted May 5, 2017 The custom page is a copy of serverstatus.tpl. It contains a bunch of divs with live server status information from an external 3rd party source (iframe). I would like the user to be logged in to view. oh it's a custom template page ? I assumed you were using a custom php page with it's own template... if so, I think the solution would have been to put the redirection in the .php file, but to do it later in the template would be more long-winded. 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted May 6, 2017 Author Share Posted May 6, 2017 ...but to do it later in the template would be more long-winded. I'm not sure I understand - is there not any method to add a simple login and redirect back to same page? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 6, 2017 Share Posted May 6, 2017 if you were using a .php file, yes.... https://developers.whmcs.com/advanced/creating-pages/ //$ca->requireLogin(); // Uncomment this line to require a login to access this page i'm not saying that you couldn't do it in the template, but I doubt you could find a simpler method than just removing // from the .php file. 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted May 8, 2017 Author Share Posted May 8, 2017 Thanks @brian! That is probably the easier way to go - however, this is my first time making a new page and the instructions are not very clear. Fine to create the "mypage.php" using their example, and with my custom content - and upload that to root whmcs directory - but this part has thrown me.... "Now when ready to test, upload the PHP file to the root WHMCS directory and the template file to your active template directory. Then visit the PHP file in your browser to try it." Could you / someone shed any light on what it means by "the template file"? It's only mentioned the php file so far in the instruction - so I'm not clear what "other" template file I need to use...! 0 Quote Link to comment Share on other sites More sharing options...
sol2010 Posted May 9, 2017 Author Share Posted May 9, 2017 Well - I worked it out using your other post Brian: https://forum.whmcs.com/showthread.php?127834-Terms-of-service-page&p=511398#post511398 WHMCS documentation leaves a lot to be desired! They really should be paying you for your valuable contributions! Thanks for your assistance. 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.