DTM Posted November 14, 2020 Share Posted November 14, 2020 Hi I've been setting up our client area and there's one thing that I cannot find how to do, which is to stop anyone registering. We're a consultancy. We will sell domains and email, and some cheaper hosting packages, but not on their own - only with a consulting account. People can't just sign up for those online. I can see that I can disallow registration without an order, but this still leaves open the possibility that people can register. It also allows the customer to create another separate account at order time. I need to get rid of both of those options. Ideally "Store" and any resold services would not appear in the menu until the customer has logged in. Does anyone know how I can accomplish that - do I need to open some templates and wrap some PHP code around the links so they only render if the customer has already logged in? Thanks, Mark 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 18, 2020 Share Posted November 18, 2020 Hi Mark, On 14/11/2020 at 17:15, DTM said: I can see that I can disallow registration without an order via setup -> general settings -> other -> Allow Client registration (untick) https://docs.whmcs.com/Other_Tab#Allow_Client_Registration On 14/11/2020 at 17:15, DTM said: but this still leaves open the possibility that people can register. It also allows the customer to create another separate account at order time. I need to get rid of both of those options. in other words, you want only existing logged in users to be able to visit the cart, non logged in users will be blocked/redirected ?? there are only two ways to register (from the client area) - either they register without ordering (see above but you've disabled that), or they register when ordering (via the cart). if you wanted to ensure only logged in users could visit the cart, then that's a hook... <?php # Redirect Cart Visitors Hook # Written by brian! function redirect_cart_vistors($vars) { $client = Menu::context('client'); if (!$client){ header("Location: clientarea.php"); exit; } } add_hook("ClientAreaPageCart", 1, "redirect_cart_vistors"); the above action hook would redirect any user, who isn't logged in, away from the cart - currently it redirects them to clientarea.php (which would show the login page), but you could redirect them to any page you want. On 14/11/2020 at 17:15, DTM said: Ideally "Store" and any resold services would not appear in the menu until the customer has logged in. again, that would be another action hook (either as a separate file or in the same file as the above hook - though if in the same file, don't include the opening <?php of the second hook)... or alternatively, one line of CSS code.... i'd suggest that you might need to remove/hide/redirect the "Order Hosting" link too. 0 Quote Link to comment Share on other sites More sharing options...
DTM Posted November 25, 2020 Author Share Posted November 25, 2020 Hi Brian I haven't got around to this yet but in the meantime I just wanted to thank you for taking the time to write a detailed reply, that's very helpful. Thanks, Mark 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.