How To Disable New Customer Registration

What is the best method to disable/prevent new customer registration while still allowing current customers with accounts to log in and modify account? I just don't want new accounts created.

This is the page I don't want to be used: /profiles-add/

Tried commenting out sections of .tpl files including: / templates / views / profiles / update.tpl, but nothing worked.

Thank you,

Bob

Here is a description of how I'd do it (UNTESTED).

+ create a app/addons/my_changes/controllers/frontend/profiles.pre.php file

+ Have content in that file similar to:

if( !defined('BOOTSTRAP') ) die('Access denied');

if( $_SERVER[‘REQUEST_METHOD’] != ‘POST’ ) {
switch($mode) {
case ‘update’:
if( !empty($_REQUEST[‘user_id’]) )
return array(CONTROLLER_STATUS_OK);
// else fall through
case ‘add’:
fn_set_notification(‘E’, __(“error”), “New user registration is disabled.”);
fn_redirect(fn_url());
}
}
return array(CONTROLLER_STATUS_OK);

Thanks tbirnseth,

I tried your suggestion (thank you) and what happens is the code is printed at the top of the page. No errors or functional changes.

At the top of page after clicking Registration:

if( !defined('BOOTSTRAP') ) die('Access denied'); if( $_SERVER['REQUEST_METHOD'] != 'POST' ) { switch($mode) { case 'update': if( !empty($_REQUEST['user_id']) ) return array(CONTROLLER_STATUS_OK); // else fall through case 'add': fn_set_notification('E', __("error"), "New user registration is disabled."); fn_redirect(fn_url()); } } return array(CONTROLLER_STATUS_OK);

Also, does not impact registration from the cart page.

The reason I want to do this is that all the new registrations for the last several months are from Russia or a few from other countries. I track the IP addresses to know spammers. I end up disabling the account and then blocking their IP address.

Every day there is a new one. Just had new account created an hour ago.

Not using the site much so don't need to register new users.

Thanks for your help.

Bob

Are you not using captcha?

Yes, I am using captcha. Standard one with 4.3.5. I increased the number of characters to 8 and made all profile fields required so not just user name and email. Did this a few months ago.

I did go into translations and removed all the words related to Register and Registration. This actually removed the link to Register in My Account (Sign in link works) and partially in the cart. I'll see how this works, just probably not the best way.

Thank you,

Bob

Thanks tbirnseth,

I tried your suggestion (thank you) and what happens is the code is printed at the top of the page. No errors or functional changes.

At the top of page after clicking Registration:

if( !defined('BOOTSTRAP') ) die('Access denied'); if( $_SERVER['REQUEST_METHOD'] != 'POST' ) { switch($mode) { case 'update': if( !empty($_REQUEST['user_id']) ) return array(CONTROLLER_STATUS_OK); // else fall through case 'add': fn_set_notification('E', __("error"), "New user registration is disabled."); fn_redirect(fn_url()); } } return array(CONTROLLER_STATUS_OK);

Also, does not impact registration from the cart page.

The reason I want to do this is that all the new registrations for the last several months are from Russia or a few from other countries. I track the IP addresses to know spammers. I end up disabling the account and then blocking their IP address.

Every day there is a new one. Just had new account created an hour ago.

Not using the site much so don't need to register new users.

Thanks for your help.

Bob

It sounds like you did not use opening

The standard captcha no longer works and that's why CSC replaced it with Google recaptcha. It's not available in your version but there are a couple of free ones in the marketplace that should work with your version.

Hello!

Please install one of the Google recaptcha add-ons from marketplace.

tbirnseth: I fixed the code and now it works in the My Account section-thank you,

I will look at the replacement recaptcha add-ons. It did appear that the last fake registrations might have been manual since all the profile fields were required and were completed.

Thank you,

Bob

Bob, Strongly suggest that you try the recaptcha solution FIRST and only do something like I recommended as a last resort. I had thought you already had a recaptcha solution in place and it was not eliminating your false registrations.

tbirnseth,

Yes, I will get the recaptcha and install it. Is there more than one version of recaptcha? I have seen the ones on the Marketplace.

Thank you, Looks like i actually registered for recapture a long time ago and for some reason did not install it. Maybe because there were no addons created then.

Bob

As stated earlier...

The standard captcha no longer works and that's why CSC replaced it with Google recaptcha.

I am using Version 4.3.9 and the captcha works just fine therefore I assume you are talking about

more recent versions of CS-Cart.

Google re-captcha is infuriating where road signs and cars are concerned and I won't put my

customers through this so...

is the 'invisible' version of re-captcha working OK for you guys ??