Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Small Problem with Contrib Restricted Website

Recommended Posts

I installed and double checked that all was done as described this contrib is supposed to add an authorization word feild when users register in order to register and be able to purchase, view prices, etc. After install I tried to register to see if it is working properly but it keeps telling me that I haven't filled in the required field but it is filled in and with the proper authorization code. Just in case below is the mod script.


We installed this on oscommerce-2.2ms2

This Mod can be used with Prices for "Logged-In Users Only - Login view price 4.0" OR "Require login to view site" contributed by compwhizmm90 14 Apr 2006.  These are both easy to install modifications that prevent viewing of the site without setting up an account.  However, anyone can still go set up an account, so this very simple Mod is intended to prevent unauthorized accounts from being set up on wholesale sites through use of an "Authorization Word" which the site owner provides to approved customers.  We included a simple email processed application form on our site for would-be customers.

This modification makes the assumption that your wholesale site will not need a Date of Birth for your customers and utilizes what is already there in the database, etc. for that feature.  You will need to activate requiring Date of Birth in your admin.

In create_account.php, find around line 81:

if (ACCOUNT_DOB == 'true') $dob = tep_db_prepare_input($HTTP_POST_VARS['dob']); DELETE IT
  if (ACCOUNT_DOB == 'true') {
  if (checkdate(substr(tep_date_raw($dob), 4, 2), substr(tep_date_raw($dob), 6, 2), substr(tep_date_raw($dob), 0, 4)) == false) {
	$error = true; 
REPLACE WITH (insert your own authorization word):

if (ACCOUNT_DOB == 'true') {
  if (isset($HTTP_POST_VARS ['dob'])){
   $dob = tep_db_prepare_input ($HTTP_POST_VARS['dob']);
 } else {
   $dob = false;

if (ACCOUNT_DOB == 'true') {   
if ( ($dob != 'PutYourAuthorizationWordHere') ) {
$error = true;

In includes/languages/english.php, FIND:

// text for date of birth example
define('DOB_FORMAT_STRING', 'mm/dd/yyyy');


// text for date of birth example
define('DOB_FORMAT_STRING', '');


define('ENTRY_DATE_OF_BIRTH', 'Date of Birth:');
define('ENTRY_DATE_OF_BIRTH_ERROR', 'Your Date of Birth must be in this format: MM/DD/YYYY (eg 05/21/1970)');
define('ENTRY_DATE_OF_BIRTH_TEXT', '* (eg. 05/21/1970)');


define('ENTRY_DATE_OF_BIRTH', 'Authorization Word:');
define('ENTRY_DATE_OF_BIRTH_ERROR', 'You must fill in the Authorization Word - Contact us for this');
define('ENTRY_DATE_OF_BIRTH_TEXT', '*');

In includes/languages/english/login.php, FIND:

define('TEXT_NEW_CUSTOMER', 'I am a new customer.');
define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'By creating an account at ' . STORE_NAME . ' you will be able to shop faster, be up to date on an orders status, and keep track of the orders you have previously made.');

Replace the text with some of your own text, for example:

define('TEXT_NEW_CUSTOMER', 'Attention: New Customers');
define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'This Store is for approved Wholesale Customers Only. You must create an account at ' . STORE_NAME . ' before you will be able to see products and prices.');


Don't forget to activate the Date of Birth requirement in your admin customer details section


Any help is greatly appreciated! :)

Link to comment
Share on other sites

  • 1 month later...
Is there anyone out there that can please take a look at this for me. Please.


Hi all - same problem with this contrib - trying to log and allways receive

Error msg - 'You must fill in the Authorization Word - Contact us for this'.

Does anybody know how to cure this prob, thanks for your time!

Link to comment
Share on other sites

  • 2 years later...
Is there anyone out there that can please take a look at this for me. Please.



Don't know if you ever solved this, but what was the problem exactly?


I've just installed this with no problem...


You might want to pay particular attention to this instruction (buried) in the code:



if ( ($dob != 'PutYourAuthorizationWordHere') ) {



change PutYourAuthorizationWordHere to something you will be able to give to your customers e.g. LetMein2007

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

  • Create New...