Jump to content

Disallow registration


DTM

Recommended Posts

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

Link to comment
Share on other sites

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....

dJsSzOf.png

i'd suggest that you might need to remove/hide/redirect the "Order Hosting" link too.

NrqxBTl.png

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