Forums / General Questions / Require Login for one EZ Page?

Require Login for one EZ Page?

Started by monster_pawn on 6 Dec 2006, 10:14 PM · Views: 8,655

Results 21 to 27 of 27
29 May 2012, 2:50 PM
#21
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Require Login for one EZ Page?

	// bof: if company is "specific company" then customer authorization is approved; else pending
    
if ($company == "specific comany") {
	$customers_authorization = 0;
}
	else {
	$customers_authorization = CUSTOMERS_APPROVAL_AUTHORIZATION;
	}
	
	// eof: if company is "specific company" then customer authorization is approved; else pending

Would this code in module - create_account.php work to automatically approve certain customers who input a specific "company" in the create account form? Just curious if this is the only file that needs to be touched. If it turns out that more files and custom coding has to be done, then my wife says she will just manually approve.

Just for reference, we don't normally use the company field, but if this works then we will use it as sort of a secondary password to automatically approve certain customers locally who are referred to us by business associates which would cut down on the approval time lag.

29 May 2012, 2:58 PM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Require Login for one EZ Page?

You would need more customization than that as this is not updating the customers table it is just setting a variable ...

You would need to check the customer's company field and then update the customers table based on that result and providing the customer spells the company exactly as what you are testing for, you would then need to update the customers table ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 May 2012, 2:32 AM
#23
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Re: Require Login for one EZ Page?

Ajeh:

You would need more customization than that as this is not updating the customers table it is just setting a variable ...

You would need to check the customer's company field and then update the customers table based on that result and providing the customer spells the company exactly as what you are testing for, you would then need to update the customers table ...

Yes, that was the one thing we recognized which we were showing that the customers checkbox shows red and is pending approval. But am I correct to assume that this is only a visual problem where it says "pending approval" but in actuality it is "approved" for that account.

The code we used above actual passes the customer to the account_success screen. While all other company inputs takes them to the customer_authorization screen.

Modifications to this particular store in our subfolder bypasses the zencart checkout system. We don't use the admin for customers, orders or any data but instead use our merchant to keep the data. The only times we were loggin in to admin were to either update products or manually approve customer accounts. The latter is what we are trying to avoid so we don't have to login everyday as product updates only happen twice a month.

Would this coding suffice to as is or does the customer table need to be updated for other functions besides using the checkout system within zencart?

Thanks

30 May 2012, 2:57 AM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Require Login for one EZ Page?

You are doing a work around if you have the Customer details setup based on Customer Authorization ... so I am really not sure how to advise you on this ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

31 May 2012, 6:49 AM
#25
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Re: Require Login for one EZ Page?

Ajeh:

You are doing a work around if you have the Customer details setup based on Customer Authorization ... so I am really not sure how to advise you on this ...

Yes, its actually a bad workaround as it only allowed access after creating account. No access again if having to re-login. So we are going to dump the modification we did.

if ($ezpage_id == 16) {
  if (!$_SESSION['customer_id']) {
    $_SESSION['navigation']->set_snapshot();
    $messageStack->add_session('header', 'Please login to access Member\'s area', 'caution');
    zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
  }
  if ($_SESSION['customer_id'] != 2 && $_SESSION['customer_id'] != 7) {
    $messageStack->add_session('header', 'Sorry you do not have access to Member\'s area', 'caution');
    zen_redirect(zen_href_link(FILENAME_EZPAGES, 'id=17', 'NONSSL'));

A question though on using sessions? I see that "$_SESSION['customer_id']" is checking if a customer is logged in and if logged in to check their customer id. I have it modified further to include $_SESSION['customer_first_name'] and it works well. I can get customer id and first name to get checked but not others.

But I cannot get any other sessions to work to check other info such as $_SESSION['customer_last name'] or $_SESSION['customer_telephone']. I seen other posts back in 2007 to set these sessions in the login - header_php.php file by adding 2 lines. But even then it does not seem to work. Do you know what fields are allowed to be checked besides customer id and first name.

NOTE: since we don't use the zencart admin to use the data, we decided to modify the language files to show what we want on the form. So for example, we used the first name field as a "Code". We would like to use the last name field as a "Sub code". Presently we are using the first name "Code" field to automatically grant access certain ez pages. The sub code will let them access the other pages so it would be nice to have another session check so we don't have to go in this header_php file to manually update. Instead we can change access codes and such from the "extra filename" file we made.

Thanks

31 May 2012, 7:20 AM
#26
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Re: Require Login for one EZ Page?

Also to mention, the $_SESSION['customer_last_name'] only works when I logout after creating an account and by logging back in that it grants access to the certain pages. Is there a way to make the last_name work like the first_name where it can grab the customer info after the create account success without logging out and back in.

1 Jun 2012, 3:54 AM
#27
grantopt avatar

grantopt

New Zenner

Join Date:
May 2012
Posts:
36
Plugin Contributions:
0

Re: Require Login for one EZ Page?

the items in the cart are linked to the product pages. How do I make them non-clickable?

I assumed its in tpl_shopping_cart_default but unable to figure where the links are coded. This is important to make sure that no links are backtracking to member only areas for international customers.

Thanks