Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Force Log In


goober0424

Recommended Posts

How can i force the user to login to their account before they can enter to shop.

 

Here's what i have tried.

 

if (!tep_session_is_registered('customer_id')) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

 

I added this to application_top.php

 

The problem i have with the above code is when connecting to the catalog it tells me that the redirection limit for the url has be reached.

 

Any Ideas are helpful.

 

Thanks.

Link to comment
Share on other sites

sorry guys, i'm stupid. I just figured it out.

 

I added

 

if (!tep_session_is_registered('customer_id')) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

 

to a new file and named it chklogin.php.

 

Now i'm just going to require it by index.php among other files to lock down the catalog.

 

Sometimes i just don't think before i type.

 

Have a good day.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...