Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Autologin Secure 2.0 - anyone get it to work?


420

Recommended Posts

Using the latest version of osC and I can't get this mod working at all. Specifically, I get errors referring to "undefined function" for autologincookie on both the login and logoff pages. I have followed the insturctions to a T, all files there and as directed, ran the SQl, etc.

 

tia for any help. :)

Link to comment
Share on other sites

It looks like the contribution has just been updated.

 

http://www.oscommerce.com/community/contributions,2087

 

I guess a file was missing.

 

One instruction was missing in the read me file.

include('includes/functions/autologin.php');

 

I would love to hear any feedback from those who have it working.

 

Take care

Edited by magicproshop
Link to comment
Share on other sites

Work fine!

One problem: I'm login with username and password (login.php), flag the box remember me, see my account, close IE, open again IE into my website, but I see the "welcome guest" in the index page.

Thank you

Skype: centoasa

Skype: remigioruberto

Link to comment
Share on other sites

Same here.

 

I have recognized that nowhere the function call to the tep_doautologin is done.

 

So my question here is: where should this function be called from??

 

To make it clear:

 

Setting cookies is working fine, but you can not read them out, because osc do not get the command to read them out.

 

I HOPE SOMEONE CAN HELP HERE :o

 

 

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

2.

just a hint for those who would like to use this also for customers with dynamic IP addresses (theoratically, because I could not test yet)

 

Just go the the autologin.php and do this in function tep_autologincookie

 

    setcookie( "osC_AutoCookieLogin", md5($check_customer['customers_id'].$check_customer['customers_email_address'].$check_customer['customers_password']), time()+60*60*24*14, "/",  "", 0 );

 

and in the function tep_doautologin

 

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where md5(CONCAT(customers_id,customers_email_address,customers_password'))= '" . $HTTP_COOKIE_VARS['osC_AutoCookieLogin'] . "'");

 

This should work then...

 

 

 

BUT it is vital that the first point is answered... PLEASE

Link to comment
Share on other sites

Hi,

 

After the contribution fix now I don't get the function error but the autologin feature doesn't seem to work... I'm in local testing and when I close and re-open explorer I have to re-login because I'm not recognised as registered user

 

Did anybody experience the same?

 

Thanks

Outside links in signatures are not allowed!

Link to comment
Share on other sites

I've just installed fixed contribution, autologin secure 2.01 by Chaveiro, but in login page this error:

 

Fatal error: Cannot redeclare tep_autologincookie() (previously declared in /web/htdocs/www.100asa.it/home/includes/functions/autologin.php:21) in /web/htdocs/www.100asa.it/home/includes/functions/autologin.php on line 21

Skype: centoasa

Skype: remigioruberto

Link to comment
Share on other sites

  • 3 weeks later...
I've just installed fixed contribution, autologin secure 2.01 by Chaveiro, but in login page this error:

 

Fatal error: Cannot redeclare tep_autologincookie() (previously declared in /web/htdocs/www.100asa.it/home/includes/functions/autologin.php:21) in /web/htdocs/www.100asa.it/home/includes/functions/autologin.php on line 21

Same error here.

Link to comment
Share on other sites

HI everyday,I came from Taiwan,

It's glad to know every good friend.

 

I also just installed fixed contribution, autologin secure 2.01 by Chaveiro.

 

and the contribution can working very normal.

But I found a very important problem

 

First I have installed two osc2.2 on two different share hosting.

one hosting I install osc2.2 and select install the SSL while in the osc2.2's insatll step.

and another hosting insatll osc2.2 without SSL.

 

A strong point was that if install osc2.2 with SSL,all your customer will feel your shopwebsite very safe like : new customer register,customer login,customer checkout ......etc,this was OSC's good because it auto suitable with your hosting.

 

Now was my pronlem point,

The autologin secure 2.01 insatlled with no SSL mode will be work very normal.

 

The autologin secure 2.01 insatlled with SSL mode, can be installed ok but can not work,I mean after customer login ,he close the IE and open a new IE,

this customer still need login again.

 

autologin secure 2.01 is a very usefull contribution

Does any good friend can help fix this problem

 

Thank first.

Link to comment
Share on other sites

  • 1 month later...

Take a look at the tep_autologincookie method (includes/functions/autologin.php):

function tep_autologincookie ($on) {

global $customer_id ;

if ($on) {

? ?  if (tep_session_is_registered('customer_id')) {

 

? ? ? $check_customer_query = tep_db_query("select customers_id, customers_password, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");

? ? ? if (tep_db_num_rows($check_customer_query)) {

//?  echo "COOKIE ON" ;

? ? $check_customer = tep_db_fetch_array($check_customer_query);

? ? $ip_address = tep_get_ip_address();

? ? setcookie( "osC_AutoCookieLogin", md5($check_customer['customers_id'].$check_customer['customers_email_address'].$check_customer['customers_password'].$ip_address), time()+60*60*24*60, "/",? ".YOUR-DOMAIN.COM", 0 );

?  }

? }

? ? } else {

//? echo "COOKIE OFF" ;

? ?  setcookie( "osC_AutoCookieLogin", "", 0, "/",? ".YOUR-DOMAIN.COM", 0 );

}

}

Notice the definition of the .YOUR-DOMAIN.COM and the inclusion of the first dot. Now, it would probably be best to use a predefined constant variable from the stock OSC files (such as HTTP_COOKIE_DOMAIN) but not necessary. Be sure to use the dot in front especially if you use a different subdomain for SSL. For example, I use secure.my-domain.com and the cookie needs to be set DOMAIN WIDE. With the dot in front, when they sign in or register at https://secure.my-domain.com and return to http://my-domain.com/index.php they are still logged in.

 

So, to answer everybody's question of whether or not the contribution works: YES, and works flawlessly if properly configured. Make these changes and see how it works for you!

 

Chemo

Edited by Chemo
Link to comment
Share on other sites

  • 1 month later...

Hi - I tried the configuration above, but it still doesn't work.

 

No errors or anything. Login works fine. But when I close my IE browser and reopen it with osCommerce, I'm a Guest again.

 

Anyone besides Chemo get this working? Or Autlogin 1.07 on the latest osCommerce?

 

(No offense Chemo, I've just spent 24 hours trying to get it working on a fresh install, and am convinced there must be another configuration step.)

 

Thanks !

Link to comment
Share on other sites

Sam,

 

Can you explain the problem you had a little more? Did you mean you made your changes to catalog/include/language/english/login.php when you should have made them to catalog/login.php?

 

I made my changes to catalog/login.php but I still can't get this to work! It seems that in Autologin.php, the function tep_autologincookie() is only called when $on is false (logoff). But it never gets called when @on is true.

 

Any ideas please! Thanks, -Chris.

Link to comment
Share on other sites

Yes, I accidentally edited the wrong file.

 

After many hours, I did a fresh install, including the english/login file, and it started working. No configuration was necessary, though I've since changed some configuration okay.

Link to comment
Share on other sites

NOTE to ALL users from this contribution

 

after installing this contribution i noticed a horrible thing, the searchengine spiders are NOT picking up your site anymore.

The reason is that it stops reading the webpage in application_top.php where the change from this contribution starts

 

if (ALLOW_AUTOLOGON == 'true') {                                // Is Autologon enabled?
 if (basename($PHP_SELF) != FILENAME_LOGIN) {                  // yes
   if (!tep_session_is_registered('customer_id')) { include('includes/modules/autologon.php'); }
 }
} else {
 setcookie("email_address", "", time() - 3600, $cookie_path);  //no, delete email_address cookie
 setcookie("password", "", time() - 3600, $cookie_path);       //no, delete password cookie
}

 

thats where it gets killed, it took me forever to bugtrack this one :(:(

 

SO BE AWARE !!!

 

i've turned it off till the moment i've time to bugtrack this

Edited by Druide

Robert

 

We all need to learn it once, how hard it may seem when you look at it, also you will master it someday ;)

Link to comment
Share on other sites

Ok, I am mistaken, I have not gotten this mod working properly as of yet.

 

EITHER:

 

(1) The mod seems installed fine, but when I close and open my browser the login is lost.

 

OR

 

(2) The login holds when I close and open my browser, but there is no way to logoff.

 

I can toggle between these two scenarios by modifying the configuration as Chemo suggests.

 

It seems Chemo's configuration is necessary to get the mod working, but then the logoff is failing to reset the cookie OR the application_top code is ignoring the reset the cookie.

 

Any ideas how to fix this mod's logoff or application_top code?

 

Sam

Link to comment
Share on other sites

No idea how to make it work... I'm sure I installed it correctly (checked it twice) and it just doesn't work for me. Plus with the post by Druide about search engines stopping their search because of it, I'm going to completely uninstall it. :(

Link to comment
Share on other sites

  • 3 weeks later...

The claim by him about search engines not spidering the site after the contribution install is not accurate. My clients site gets crawled every day and indexes properly.

 

Chemo

Link to comment
Share on other sites

The claim by him about search engines not spidering the site after the contribution install is not accurate. My clients site gets crawled every day and indexes properly.

 

Chemo

After installing this mod, I could not get it to work, but my site is still spidered daily.

Link to comment
Share on other sites

  • 2 weeks later...

Okay, I finally got it to work. The tricky part for me was figuring out how to do the SQL part (since I don't do much with that on a regular basis). Everything else is pretty straightforward.

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