TaskHusky Posted July 8, 2021 Share Posted July 8, 2021 We have a custom WHMCS page that is meant for clients once they are logged in. When a client goes directly to this page (not logged in) instead of showing a log in form, it says Oops Something went wrong and we couldn't process your request.. How do I fix this page to show a log in form and then redirect the user to their original page once they are logged in? 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 8, 2021 Share Posted July 8, 2021 An oops page is usually a PHP error happening and so you would need to turn on debugging (General settings -> Other -> Display Errors) and fix the php error. You're likely trying to access an object that isn't there and that causing an exception to happen. Unless you really need to keep them on that custom page, I would suggest checking if they are logged in and if not doing a redirect via a header("location: login.php") call to redirect to the login page. Then after login if you need them back on that custom page, use a hook to send them there. Using a session variable and checking in that hook for that variable would be enough to see if sending to the custom page is needed. 0 Quote Link to comment Share on other sites More sharing options...
TaskHusky Posted July 8, 2021 Author Share Posted July 8, 2021 3 minutes ago, steven99 said: An oops page is usually a PHP error happening and so you would need to turn on debugging (General settings -> Other -> Display Errors) and fix the php error. You're likely trying to access an object that isn't there and that causing an exception to happen. Unless you really need to keep them on that custom page, I would suggest checking if they are logged in and if not doing a redirect via a header("location: login.php") call to redirect to the login page. Then after login if you need them back on that custom page, use a hook to send them there. Using a session variable and checking in that hook for that variable would be enough to see if sending to the custom page is needed. Right on....This is it:Error: Call to undefined function WHMCS\CALinkUpdateCC() in whmcs/whmcs-foundation/lib/ClientArea.php:0Stack trace: How can I fix that? 0 Quote Link to comment Share on other sites More sharing options...
string Posted July 8, 2021 Share Posted July 8, 2021 (edited) https://developers.whmcs.com/advanced/creating-pages/ If you add this to your custom page, the page should show a login page to guests, instead of the error message:. $ca->requireLogin(); Edited July 8, 2021 by string 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 8, 2021 Share Posted July 8, 2021 18 minutes ago, TaskHusky said: Right on....This is it:Error: Call to undefined function WHMCS\CALinkUpdateCC() in whmcs/whmcs-foundation/lib/ClientArea.php:0Stack trace: How can I fix that? What version of WHMCS are you using? From searches, that appears to be an issue after upgrading to 7.8 (probably 8.x also) and applying the hotfix at may help with that error for at least 7.8 . 0 Quote Link to comment Share on other sites More sharing options...
TaskHusky Posted July 8, 2021 Author Share Posted July 8, 2021 1 minute ago, steven99 said: What version of WHMCS are you using? From searches, that appears to be an issue after upgrading to 7.8 (probably 8.x also) and applying the hotfix at may help with that error for at least 7.8 . Running 7.7.1 7 minutes ago, string said: https://developers.whmcs.com/advanced/creating-pages/ If you add this to your custom page, the page should show a login page to guests, instead of the error message:. $ca->requireLogin(); This is already in the code. That is why I'm surprised it is broke. 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.