Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Member Approval v 0.1


Guest

Recommended Posts

I'm having a very odd problem with this contribution. Sometimes when a customer signs up for an account, after they hit subit it takes them to the screen telling them their account was created successfully and sends them the email. However this customer doesnt appear on the waiting approval page or anywhere for that matter.

 

I did some tinkering myself and I found that when I filled out the form with jumbles of text (dsgqejjadg) instead of proper info (except for the email, etc) it wouldnt work. This is a very strange problem and could and probably is causing a lot of problems since this is the first day of my store being online and there could be customers signing up that think we are going to approve them, and we cant.

 

Does anyone know why, or even anything specific I should check?

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

I just installed this, and I am not sure it's doing what it is supposed to.

 

I wanted something that would only allow access to someone whose account had been approved.  My vision was the visitor, upon arrival (unless logged in) would be greeted with the login/create account page.  They would then wait for approval, then be allowed access to the catalog.  Only upon activation would they be allowed to see categories, products, etc...

 

It appears that all this mod does is allow approval of the account, but not the permissions.  Am I right on this?  Does anyone have a further mod which does as I have described?

 

Thanks.

 

Rick,

 

I was working on what you wanted to do. I think your solution only locks down the index page...

 

try this:

 

in application_top.php, add the following new code:

 

.
.
.
// navigation history
 if (tep_session_is_registered('navigation')) {
   if (PHP_VERSION < 4) {
     $broken_navigation = $navigation;
     $navigation = new navigationHistory;
     $navigation->unserialize($broken_navigation);
   }
 } else {
   tep_session_register('navigation');
   $navigation = new navigationHistory;
 }
 $navigation->add_current_page();

// start of new code
if (!tep_session_is_registered('customer_id')) {

if ($HTTP_SERVER_VARS["SCRIPT_NAME"] != (DIR_WS_HTTP_CATALOG . FILENAME_LOGIN)) {
 if ($HTTP_SERVER_VARS["SCRIPT_NAME"] == (DIR_WS_HTTP_CATALOG . FILENAME_CREATE_ACCOUNT)) {
	 // don't do anything and let process through
 } else {
	 $navigation->set_snapshot();
	 tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
}
}
// end of new code
.
.
.

Link to comment
Share on other sites

  • 1 month later...
I'm having a very odd problem with this contribution. Sometimes when a customer signs up for an account, after they hit subit it takes them to the screen telling them their account was created successfully and sends them the email. However this customer doesnt appear on the waiting approval page or anywhere for that matter.

 

I did some tinkering myself and I found that when I filled out the form with jumbles of text (dsgqejjadg) instead of proper info (except for the email, etc) it wouldnt work. This is a very strange problem and could and probably is causing a lot of problems since this is the first day of my store being online and there could be customers signing up that think we are going to approve them, and we cant.

 

Does anyone know why, or even anything specific I should check?

 

 

yatahaze - did you ever figure this out? I am having the same problem but only from time to time - I had 13 members sign up completely and they all posted to the admin area for approval - then 1 didn't post but both admin and the customer received the email as they should - no client data in the database was added - so asked them to try again and it worked the second time - now i have had 6 people try to add and none of them have been added to the database so there is no data to approve even though emails were sent ... very strange indeed - on my system no code was changed or anything - it just stopped working....

 

anyone have any ideas on this?

 

thanks!

Link to comment
Share on other sites

I too am having the exact some problems as Rubygirl and Yatahaze...

 

Has anyone figured out why it is doing this???

 

All the emails are sent but it is not showing it in the "Waiting Approval" list.

 

I really need this function to work...

 

It sounds like its not being written to the MySQL DB. I went back, dropped the line and added it back with no success.

 

If anyone has experienced this and has a fix, I would love to hear it!

 

Thanks.

Link to comment
Share on other sites

  • 2 months later...

The solution to that problem I was talking about turned out to be if the customer doesnt enter the province/state correctly. If they live in British Columbia and they type anything other than British Columbia or BC it doesnt work. Also if they already have an account, it also has the same result. The solution is to get the Country/State Selector contribution.

Link to comment
Share on other sites

  • 4 months later...
I too am having the exact some problems as Rubygirl and Yatahaze...

 

Has anyone figured out why it is doing this???

 

All the emails are sent but it is not showing it in the "Waiting Approval" list.

 

I really need this function to work...

 

It sounds like its not being written to the MySQL DB. I went back, dropped the line and added it back with no success.

 

If anyone has experienced this and has a fix, I would love to hear it!

 

Thanks.

 

I'm having this problem too. But has nothing to do with state or anything.

The problem comes, when i sign up with an already existing emailaddress or adding an existing email address in the addressbook in a new address.

The problem is that after this contribution is installed, OSC is no longer looking for existing emails in the database. It just continues to the create_account_success.php, sending the mails as it should, but doesn't add the customer to the "Waiting for approval" sektion in admin.

I have tried to figure this out for weeks now how to solve this, so OSC will return the create_account.php telling the customer that the email already exist i the database, but can't find the solution anywhere. I have searched the net every day, but the closest threads about this problem, is the threads listed in this sektion.

 

I have tried to install the contribution on a new clean OSC and also tested if it worked before the contribution was installed and it did.

 

Can someone please help? please tell me where to change things to make this work.

 

I have added the install instructions for version 1.5 below:::

 

Member Approval 1.5 - September 1, 2004

I just added a section on admin\filenames.php because my install did not work
until i added some code there.  I think i have a newer release or snapshot but
either way, i had to make that small addition, so i thought i would pass it along.
I take no credit for the original code, but highly reccomend it, its been a wonder
for me, thank you to the original author!


Member Approval v 0.1 - 12/07/2003
Edited on Nov 28 2003
new version
Member Aproval V 1.2
Member Approval V 1.3

Edited all define variables. ( Cleaned up code a little)

Released 12 July 2003
Released under the GNU General Public License

Member Approval 1.4	 4/5/2004 by Paul Boekholt
- updated for MS2.2
- error message when member not approved
Install: Get member approval 1.3 from http://www.oscommerce.com/community/contributions,1691
and replace the README file with this one.

##################################################################

READ CAREFULLY THE README FILE before installing this module !

BACKUP YOUR DATABASE AND MODIFIED FILES BEFORE UPDATING 

##################################################################

This module will allow administrators to approve members before they have access to the shopping cart facilities. 

Customers will follow the usual signup routine, whereby on completion the site administrator receives an e-mail notifying that a new customer has signed up.  

The customer can then be approved or declined through the Administration panel.  


##################################################################

Database
--------
You will have to add an extra field to the customers table of the data base

ALTER TABLE `customers` ADD `member_level` INT(5) DEFAULT '0' NOT NULL;

##################################################################

Installation
------------

#### [ OPEN ] ##################################################################

catalog/create_account.php 

##################################################################

## Find ################################

tep_session_register('customer_id');
tep_session_register('customer_first_name');
tep_session_register('customer_default_address_id');
tep_session_register('customer_country_id');
tep_session_register('customer_zone_id');

// restore cart contents
$cart->restore_contents();

and delete the whole lot.


## Find this [approx line 233]:  ################################

  } else {
	$email_text = sprintf(EMAIL_GREET_NONE, $firstname);
  }

  $email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
  tep_mail($name, $email_address, EMAIL_SUBJECT, $email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

  tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));


## Replace with this:  ################################

} else {
  $email_text = sprintf(EMAIL_GREET_NONE, $firstname);
}
 }
// customer email notification 
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// admin email notification 

$admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, nl2br($admin_email_text), $name, $email_address, '');

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
 }




#### [ OPEN ] ##################################################################

catalog/includes/languages/english/create_account.php 

##################################################################								   
## Add/Replace  ################################


## find this ##########################

define('EMAIL_TEXT', 'You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");

## replace with ######################

define('ADMIN_EMAIL_WELCOME', 'Application to become a wholesale customer of <b>' . STORE_NAME . '</b>.' . "\n\n");

define('EMAIL_TEXT', 'Your application to become a wholesale customer [which will enable you purchase our products at a discounted rate] is currently being evaluated.  We will notify you within 48 hours as to when you can access our eCommerce  system.  <br><br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to send birthday gifts direct to the birthday-person themselves.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n\n");

define('ADMIN_EMAIL_TEXT', 'You have received an application to become a wholesale customer from your website.  Information regarding this application can be found at your online administration panel.' . "\n\n");


#### [ OPEN ] ##################################################################

catalog/login.php 

##################################################################

## Find this: [line 28] ################################

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");

## Replace with this:  ################################

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id, member_level  from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");




## and after this [approx line 34]:  ################################

  if (!tep_validate_password($password, $check_customer['customers_password'])) {
	$error = true;
  } else {


## insert this: ################################


	if ($check_customer['member_level'] == 0 ) {
	  $HTTP_GET_VARS['login'] = 'invalid';
  $messageStack->add('login', TEXT_NOT_APPROVED);
	} else {



## Find this [approx line 67]:  ################################

	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	}
  }
}
 }
 if ($error == true) {


## Replace with this:  ################################

	} else {
	  tep_redirect(tep_href_link(FILENAME_DEFAULT));
	  }
	}
  }
}
 }
 if ($error == true) {





#### [ OPEN ] ##################################################################

catalog/includes/languages/english/login.php 

##################################################################								   
## Add/Replace  ################################

define('TEXT_VALID_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> This account has not been approved yet, please contact the site Administrator.');

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.  Please note that new accounts must first be approved to gain access to the catalog.');

define('TEXT_NOT_APPROVED', 'Your membership has not been approved yet');


#### [ OPEN ] ##################################################################

admin/filesnames.php

##################################################################

## Add ################################

 define('FILENAME_MEMBERS', 'members.php');


#### [ OPEN ] ##################################################################

admin/includes/application_top.php

##################################################################

## Add ################################

 define('FILENAME_MEMBERS', 'members.php');



#### [ OPEN ] ##################################################################

admin/includes/boxes/customers.php 

##################################################################

## After this: ################################

'<a href="' . tep_href_link(FILENAME_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_CUSTOMERS . '</a><br>' .


## Insert this: ################################

'<a href="' . tep_href_link(FILENAME_MEMBERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CUSTOMERS_APPROVAL . '</a><br>' .

#####then add the following at the end just above   ?>#############################


define('EMAIL_CONTACT', 'For help with any of our online services, please email us at: ' . STORE_OWNER_EMAIL_ADDRESS);

define('EMAIL_TEXT_CONFIRM', 'Your application to become a wholesale customer of (your store) has been approved. You can now access pricing on the (your store) site.<br>You can now take part in the <b>various services</b> we have to offer you. Some of these services include:' . "\n" . '<li><b>Permanent Cart</b> - Any products added to your online cart remain there until you remove them, or check them out.' . "\n" . '<li><b>Address Book</b> - We can now deliver your products to another address other than yours! This is perfect to drop ship direct to your customer.' . "\n" . '<li><b>Order History</b> - View your history of purchases that you have made with us.' . "\n" . '<li><b>Products Reviews</b> - Share your opinions on products with our other customers.' . "\n");

define('EMAIL_WARNING', '<b>Note:</b> This email address was used to request access to our wholesale website. If you did not signup to be a customer, please send an email to ' . STORE_OWNER_EMAIL_ADDRESS . "\n\n");

define('EMAIL_TEXT_SUBJECT', 'Account Approved');

define('EMAIL_SEPARATOR', '----------------------------------------------');


Add or take out the "\n" 's to suit your taste in spacing




#### [ OPEN ] ##################################################################

admin/includes/languages/english.php 

##################################################################								   
## Add ################################

define('TABLE_HEADING_LASTNAME', 'Lastname');
define('TABLE_HEADING_FIRSTNAME', 'Firstname');
define('TABLE_HEADING_ACCOUNT_CREATED', 'Account Created');
define('TABLE_HEADING_ACTION', 'Action');
define('BOX_CUSTOMERS_APPROVAL', 'Waiting Approval');
define('HEADING_TITLE_SEARCH', 'Search');
define('HEADING_TITLE', 'Member approval');



##################################################################				  
##################################################################				  

THANKS TO:


Steve 'Snowman' Kemp  - who supplied me with the basis of this code.  
Dootch who supplied the bug fix for he confirmation email

##################################################################				  

I hope you find this useful.  

David Beck
eMedia Worx
http://************.com.au

 

TIA.

Nikolaj

Link to comment
Share on other sites

I too would be very interested in any solutions to the problem described in the above post, but in addition. I have one further question.

 

Is there a way to prevent the member that is waiting on approval from appearing in the main members list until such time as they are approved?

 

Its confusing the hell out of the ladies using this section of admin and anything to make their life a little easier would be appreciated.

Link to comment
Share on other sites

  • 1 month later...

Member Approval 1.5 appears to break duplicate email checking.

 

If someone signs up with the same email, they get to Create Account Success ... but nothing is written to the database, and no account is waiting for approval.

 

Does anyone have a bugfix for this?

 

Thanks,

EricK

Link to comment
Share on other sites

  • 4 months later...

I'm still having problems with it, even after installing the country-state selector. I have at least one customer that is trying to make an account that doesn't already have one with the same email address and it still isnt working. I know that this mod also breaks checking the passwords too, if the user enters a different password in the 2nd password box, it tells them the account was created even though it wasn't.

 

I know that it does send them an email saying the account was created, so maybe I can edit it to forward those emails to me, so I can check each one by hand to make sure they actually got their account made and notify them if it wasn't. I have a much bigger chance of accomplishing that than fixing the bugs, because I know very little about php.

Link to comment
Share on other sites

I've uncovered another bug. The password length must be 5 characters or more. Any less results in the customer getting the success screen but no account actually created. I think all or most of the error checking is broken.

 

We really need a php coder to help us fix this contribution.

Edited by yatahaze
Link to comment
Share on other sites

  • 2 weeks later...

Ok, if you use this contrib and the country-state selector I believe this fix will apply to you. It fixed the error checking problems.

 

There is a bad edit to create_account.php. Change this:

  }
// customer email notification
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// admin email notification

$admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, nl2br($admin_email_text), $name, $email_address, '');

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
 }

 

to this:

	// customer email notification
$email_text .= EMAIL_WELCOME . EMAIL_TEXT . EMAIL_CONTACT . EMAIL_WARNING;
tep_mail($name, $email_address, EMAIL_SUBJECT, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// admin email notification

$admin_email_text .= ADMIN_EMAIL_WELCOME . ADMIN_EMAIL_TEXT . EMAIL_WARNING;

tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, nl2br($admin_email_text), $name, $email_address, '');

tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT_SUCCESS, '', 'SSL'));
}
 }

 

In other words, move the right brace from just before the "customer email notification" comment to after the tep_redirect call. Because of this mistake, any errors detected by the PHP code are ignored.

 

Big thanks to stevel for the fix!! :D

Link to comment
Share on other sites

Is there any way to prevent the members awaiting approval from showing up on the Customers table of the Admin section? It is rather confusing to see members listed who have not yet been approved.

As I do not know much about PHP, I am wondering if somebody who knows more can help.

 

Is it a question of adding :

where member_level = '1'

somewhere in customers.php?

Link to comment
Share on other sites

  • 4 months later...

Hi there,

 

I've got a question: I want to use this script for activating a membership. At my site, customers can buy a membership which can last 1 or 2 years. So therefore I need to 'activate' the customer AND let the database know if I want to activate it for 1 year or for 2 years.

 

I've tried everything to change the script, but nothing seems to work.

 

Is there anybody who can help me with this?

 

Here's my version of the script so far. The lines in red are the ones I've added or changed...

 

<?php
/*
 $Id: members.php,v 1.1 2003/07/13 20:28:45 wilt Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 if ($HTTP_GET_VARS['action']) {
switch ($HTTP_GET_VARS['action']) {
	case 'confirmaccept':
[color=#FF0000]		$expiry_date = tep_db_prepare_input($HTTP_POST_VARS['expiry_date']);

	if (checkdate(substr(tep_date_raw($expiry_date), 6, 2), substr(tep_date_raw($expiry_date), 4, 2), substr(tep_date_raw($expiry_date), 0, 4)) == false) {
	  $error = true;

	  $messageStack->add(ENTRY_EXPIRY_DATE_ERROR, 'error');
	}

	if($HTTP_POST_VARS['expiry_date'] > 0) {
	  tep_db_query("update " . TABLE_CUSTOMERS . " set member_level = '1', expiry_date = '" . tep_db_input($expiry_date) . "' where customers_id = '" . tep_db_input($customers_id) . "'");
	} else {
	  $messageStack->add(NO_EXPIRY_DATE_INSERTED, 'error');
	}[/color]
	$HTTP_GET_VARS['action'] = '';
	$HTTP_GET_VARS['cID'] = '';
	break;
  case 'deleteconfirm':
	$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

	if ($HTTP_POST_VARS['delete_reviews'] == 'on') {
	  $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'");
	  while ($reviews = tep_db_fetch_array($reviews_query)) {
		tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . $reviews['reviews_id'] . "'");
	  }
	  tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'");
	} else {
	  tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . tep_db_input($customers_id) . "'");
	}

	tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customers_id) . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customers_id) . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customers_id) . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customers_id) . "'");
	tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customers_id) . "'");
	tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customers_id) . "'");

	tep_redirect(tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action'))));
	break;
}
 }
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onLoad="SetFocus();">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="2" cellpadding="2">
 <tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr><?php echo tep_draw_form('search', FILENAME_CUSTOMERS, '', 'get'); ?>
		<td class="pageHeading"><?php echo HEADING_TITLE_MEMBER; ?></td>
		<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
		<td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td>
	  </form></tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
			<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_LASTNAME; ?></td>
			<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td>
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACCOUNT_CREATED; ?></td>
[color=#FF0000]				<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_CUSTOMER_PAID; ?></td>[/color]
			<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>
		  </tr>
<?php
$search = '';
if ( ($HTTP_GET_VARS['search']) && (tep_not_null($HTTP_GET_VARS['search'])) ) {
  $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['search']));
  $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "' and member_level = '0'";
}
if ($search =='') $search = "where member_level = '0'";
$customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname";
$customers_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $customers_query_raw, $customers_query_numrows);
$customers_query = tep_db_query($customers_query_raw);
while ($customers = tep_db_fetch_array($customers_query)) {
  $info_query = tep_db_query("select customers_info_date_account_created as date_account_created, customers_info_date_account_last_modified as date_account_last_modified, customers_info_date_of_last_logon as date_last_logon, customers_info_number_of_logons as number_of_logons from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $customers['customers_id'] . "'");
  $info = tep_db_fetch_array($info_query);
  $orders_query = tep_db_query("select o.orders_id, o.customers_name, o.customers_id, o.date_purchased, o.last_modified, op.products_name, s.orders_status_name from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_PRODUCTS . " op on (o.orders_id = op.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id order by orders_id DESC");
  $orders = tep_db_fetch_array($orders_query);

  if (((!$HTTP_GET_VARS['cID']) || (@$HTTP_GET_VARS['cID'] == $customers['customers_id'])) && (!$cInfo)) {
	$country_query = tep_db_query("select countries_name from " . TABLE_COUNTRIES . " where countries_id = '" . $customers['entry_country_id'] . "'");
	$country = tep_db_fetch_array($country_query);

	$reviews_query = tep_db_query("select count(*) as number_of_reviews from " . TABLE_REVIEWS . " where customers_id = '" . $customers['customers_id'] . "'");
	$reviews = tep_db_fetch_array($reviews_query);

	$customer_info = array_merge($country, $info, $reviews);

	$cInfo_array = array_merge($customers, $customer_info, $orders);
	$cInfo = new objectInfo($cInfo_array);
  }

  if ( (is_object($cInfo)) && ($customers['customers_id'] == $cInfo->customers_id) ) {
	echo '		  <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '\'">' . "\n";
  } else {
	echo '		  <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '\'">' . "\n";
  }
?>
			<td class="dataTableContent"><?php echo $customers['customers_lastname']; ?></td>
			<td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>
			<td class="dataTableContent" align="right"><?php echo tep_date_short($info['date_account_created']); ?></td>
			[color=#FF0000]<td class="dataTableContent" align="right"><?php echo tep_date_short($orders['last_modified']); ?></td>[/color]
			<td class="dataTableContent" align="right"><?php if ( (is_object($cInfo)) && ($customers['customers_id'] == $cInfo->customers_id) ) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID')) . 'cID=' . $customers['customers_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>
		  </tr>
<?php
}
?>
		  <tr>
			<td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
			  <tr>
				<td class="smallText" valign="top"><?php echo $customers_split->display_count($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_CUSTOMERS); ?></td>
				<td class="smallText" align="right"><?php echo $customers_split->display_links($customers_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID'))); ?></td>
			  </tr>
<?php
if (tep_not_null($HTTP_GET_VARS['search'])) {
?>
			  <tr>
				<td align="right" colspan="2"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS) . '">' . tep_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td>
			  </tr>
<?php
}
?>
			</table></td>
		  </tr>
		</table></td>
<?php
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CUSTOMERS);
 $heading = array();
 $contents = array();
 switch ($HTTP_GET_VARS['action']) {
case 'confirm':
  $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_CUSTOMER . '</b>');

  $contents = array('form' => tep_draw_form('customers', FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=deleteconfirm'));
  $contents[] = array('text' => TEXT_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
  $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  break;
case 'accept':
[color=#FF0000]$email = EMAIL_HTML_BEGINS . EMAIL_TEXT_1 . EMAIL_TEXT_2 . tep_date_short($orders['last_modified']) . EMAIL_TEXT_3 . tep_date_short($customers['expiry_date']) . EMAIL_TEXT_4 . EMAIL_HTML_ENDS;[/color]
	  $heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
	  [color=#FF0000]$contents = array('form' => tep_draw_form('customers', FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirmaccept'));
	  $contents[] = array('text' => '<br><b>' . TEXT_CUSTOMER_BOUGHT . '</b> ' . $orders['products_name'] . '<br>');
	  $contents[] = array('text' => '<br><b>' . TEXT_CUSTOMER_PAID . '</b> ' . $orders['last_modified'] . '<br>');
	  $contents[] = array('text' => '<br><b>' . TEXT_FILLIN_EXPIRY_DATE . '</b> ' . tep_draw_input_field('expiry_date') . '<br>');
	  $contents[] = array('align' => 'center', 'text' => '<a onclick="' . tep_mail($cInfo->customers_name, $cInfo->customers_email_address, EMAIL_TEXT_SUBJECT, nl2br($email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '') . '">' . tep_image_submit('button_confirm.gif', IMAGE_CONFIRM) . '</a> <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=') . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');[/color]		  break;
default:
  if (is_object($cInfo)) {
	  $heading[] = array('text' => '<b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>');
	  $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=edit') . '" >' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=accept') . '">' . tep_image_button('button_activate.gif', IMAGE_ACTIVATE) . '</a> <a href="' . tep_href_link(FILENAME_MEMBERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $cInfo->customers_id . '&action=confirm') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a><br><a href="' . tep_href_link(FILENAME_MAIL, 'selected_box=tools&customer=' . $cInfo->customers_email_address) . '">' . tep_image_button('button_email.gif', IMAGE_EMAIL) . '</a>');
  }
  break;
 }

 if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {
echo '			<td width="25%" valign="top">' . "\n";

$box = new box;
echo $box->infoBox($heading, $contents);

echo '			</td>' . "\n";
 }
?>
	  </tr>
	</table></td>
  </tr>
</table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

OK! :'(

clearly everyone here is way beyond me in the knowledge of PHP and Databases...

 

i just installed a fresh version of osCommerce (done automatically by my webhosts) and the first thing i need is this Member Approval contribution, as the website im creating is for a wholesale jewler and requires members to be approved before logging in.

 

i know how to edit the .php files based on the instructions provided (using basic copy and paste) :P , but i have no idea how to edit my database as is required in the instructions:

 

##################################################################

 

Database

--------

You will have to add an extra field to the customers table of the data base

 

ALTER TABLE `customers` ADD `member_level` INT(5) DEFAULT '0' NOT NULL;

 

##################################################################

 

could someone pleeeease tell me how i would achieve this?

 

thank you all so much in advance :thumbsup:

 

cheers :)

Link to comment
Share on other sites

quick correction;

i've downloaded Member Approval 1.7 complete package and will be installing that, but i need to know how to alter the database first according to the instructions:

 

-------------------------------------------------------------------

-------------------------------------------------------------------

Database

--------

 

You will have to add two extra fields to the customers table of the data base

 

 

ALTER TABLE `customers` ADD `member_level` INT(5) DEFAULT '0' NOT NULL;

 

ALTER TABLE `customers` ADD `customers_language_id` INT( 11 ) NOT NULL;

 

 

-------------------------------------------------------------------

-------------------------------------------------------------------

 

 

thanks in advance!

 

cheers :)

Link to comment
Share on other sites

quick correction;

i've downloaded Member Approval 1.7 complete package and will be installing that, but i need to know how to alter the database first according to the instructions:

 

-------------------------------------------------------------------

-------------------------------------------------------------------

Database

--------

 

You will have to add two extra fields to the customers table of the data base

ALTER TABLE `customers` ADD `member_level` INT(5) DEFAULT '0' NOT NULL;

 

ALTER TABLE `customers` ADD `customers_language_id` INT( 11 ) NOT NULL;

-------------------------------------------------------------------

-------------------------------------------------------------------

thanks in advance!

 

cheers :)

 

Hi Koretek,

 

You need a program like PHPMyAdmin to insert the tables to your database. You can find this program at http://www.phpmyadmin.net

 

MarcusDesign

Link to comment
Share on other sites

thank you so much for your help... my hosting company did provide the mySQL editor

 

...i've installed everything and now i'm getting a weird line that im not sure i understand when i try to "activate" a member:

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Fatal error: main(): Failed opening required 'includes/languages//members_mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

and how would i deny a member access? or does that already happen?

 

thanks in advance

 

cheers :)

 

does anyone know why i get this

Link to comment
Share on other sites

thank you so much for your help... my hosting company did provide the mySQL editor

 

...i've installed everything and now i'm getting a weird line that im not sure i understand when i try to "activate" a member:

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Warning: main(includes/languages//members_mail.php): failed to open stream: No such file or directory in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

Fatal error: main(): Failed opening required 'includes/languages//members_mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/permaloc/public_html/taos/admin/members.php on line 167

 

and how would i deny a member access? or does that already happen?

 

thanks in advance

 

cheers :)

 

does anyone know why i get this

 

Hi Koretek,

 

It seems there is an error in line 167 at admin/members.php.

 

REPLACE:

 

$languages_dir_qry = tep_db_query("select directory from " . TABLE_LANGUAGES . " where languages_id = " . $customer_language_id_res['customers_language_id']);

$languages_dir_res = tep_db_fetch_array($languages_dir_qry);

require(DIR_WS_LANGUAGES . $languages_dir_res['directory'] . '/' . 'members_mail.php');

 

WITH:

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

require(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/' . 'members_mail.php');

}

 

Hope this will help.

 

MarcusDesign

Link to comment
Share on other sites

Hi Koretek,

 

It seems there is an error in line 167 at admin/members.php.

 

REPLACE:

 

$languages_dir_qry = tep_db_query("select directory from " . TABLE_LANGUAGES . " where languages_id = " . $customer_language_id_res['customers_language_id']);

$languages_dir_res = tep_db_fetch_array($languages_dir_qry);

require(DIR_WS_LANGUAGES . $languages_dir_res['directory'] . '/' . 'members_mail.php');

 

WITH:

 

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

require(DIR_WS_LANGUAGES . $languages[$i]['directory'] . '/' . 'members_mail.php');

}

 

Hope this will help.

 

MarcusDesign

 

made the chnages as stated, i;m useing the english language pack but when activateing a user i get an error message.

 

Warning: require(includes/languages/german/members_mail.php) [function.require]: failed to open stream: No such file or directory in C:\Program Files\xampp\htdocs\access\allow\catalog\admin\members.php on line 168

 

Fatal error: require() [function.require]: Failed opening required 'includes/languages/german/members_mail.php' (include_path='.;C:\Program Files\xampp\php\pear\') in C:\Program Files\xampp\htdocs\access\allow\catalog\admin\members.php on line 168

 

as you can see it's trying to goto the german language. any help

Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...

I seem to be having a simillar problem to these earlier messages.

Clients are attempting to create an account with the authorization word I send them.

They get the notification mail, as do I.

 

When I go to Admin, there is no account waiting approval.

 

From my own tests, I suspect one or two clients maybe incorrectly inputting the authorization word.

 

The contribution will still send out the mails confirming membership even if the customer puts the word in incorrectly. Obviously they cant log in because they dont appear in "waiting approval", but there is nothing to tell them that they have input the wrong authorization word....

 

Is there any way of prompting a warning message, simillar to the one you would get if you left the name or e-mail blank, that says the authorization word is wrong....?

 

Thanks

Link to comment
Share on other sites

  • 9 months later...

I believe I may be having an MYSQL 5 problem.

 

ERROR:

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/onsmedia/public_html/products/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/onsmedia/public_html/products/admin/includes/classes/object_info.php on line 18

 

 

 

 

I found another post that said to do this:

change this:

$customers = tep_db_fetch_array($customers_query);

$cInfo = new objectInfo($customers);

 

to this:

$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);

$cInfo_array = array_merge((array)$customers, (array)$customer_info);

 

 

the problem is , when I make the change, if I click on a member and click edit or activate, the fields are blank

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