Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

return to the page you were on prior to loggin in


dreamscape

Recommended Posts

Uh.....wait....maybe I don't understand.....my thinking is the error needs to be in the same box as the sign in stuff.....It wouldn't do any good to tell them to try again from the second box where it normally says Hi $customer.....Am I missing in action again? 8)

Link to comment
Share on other sites

  • Replies 83
  • Created
  • Last Reply

Customer logs in ...

Invalid email or password ...

loging.php Sets $broken_login to a message

Redirect to same page ...

Login Box displays email/password and $broken_login message

 

Customer now can:

Try again ...

Click forgotten password ...

Click Create Account ...

 

$broken_login is reset to '' when valid

Link to comment
Share on other sites

Gotcha' ....that's what we need....yeah, yeah.... :D :D :D :D

 

Too many things running around my little pea brain tonight....Thanks for your patience!!

Link to comment
Share on other sites

hey guys I just realized a pretty serious error in our logical thinking for the return to previous page for logout.

 

if the customer is on a normal page its OK... but where would customer's usually log out from? either from there account or after placing an order... in both cases you are required to be logged in, so then when they log out and hit continue, the page they are directed to is a login protected page and they obviously aren't logged in anymore, so they get directed to login.php.

 

if there is anything more anoying than being directed back to default.php after loggin in, it has to be being directed to login.php immediately upon logging out... I'll take the red face on this one for failing to reason that out in the 1st place :oops: :oops: ....

 

guess we'll have to rethink the logout page direction logic... though the login return to previous page is working brilliantly so far... my bad on not seeing the problems with returning to the previous page upon logout :oops:

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

ok after a bit of quick thinking, it occured to me that a customer would be on "login restricted" pages when they are on SSL. Am I correct? I have tried but cannot think or come up with a time when a customer would be on an SSL page (by default) that did not require them to be logged in (except for Lindas security warning fix, where they are on SSL on default.php... but its default.php, so we are OK!)...

 

here is a quick new logic for the top of logoff.php that will set the link to the previous page, only if it was not in SSL. otherwise if it was in SSL (about 99% chance they were on a login restricted page... only exception I came come up with is they are on SSL on default.php if using Lindas security tags warning fix, but that doesn't hurt anything because...) the link is set to default.php. Now, this would only be effective if your site was running SSL (which I'd hope it was :) )... but its a good fix for now till we can come up with something better.

 

        if ((sizeof($navigation->snapshot) > 0) && ($navigation->snapshot['mode'] != 'SSL')) {

         $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);

         $navigation->clear_snapshot();

         $link = $origin_href;

       } else {

         $link = tep_href_link(FILENAME_DEFAULT);

       }

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I have a logoff in my navigation bar and in a loginbox

 

Both work great as is to return to the right page.

 

Your fix for the logoff worked fine.

 

I did add:

 

&& (!strstr($PHP_SELF,'checkout'))

 

to the IF in application_top.php so if I was on a product before checkout, and logoff in the middle of checkout I get the logoff.php then continue takes me to that last product.

 

If I was not logged in before I click checkout ... then I am taken to default.php when I logoff ... get to logoff.php and click continue.

Link to comment
Share on other sites

&& (!strstr($PHP_SELF,'checkout'))

 

good thinking...

 

yeah the fix for logoff.php seems to working good... only time it won't work is if there is a login restricted page on SSL, which I could not think of except your security warning fix... but in that case the page is default.php and the redirect if u hit logoff from SSL page is default.php, so we're cool there...

 

hey this little tip just gets better by the day... maybe someone from the dev team (hint hint :wink: :wink: ) could add it in as actual code... but then again stock OSC does not contain a "login" link in the navbar... maybe it should though :D

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I did not do anything on the SSL issue. I just left it as it was.

 

The new snapshots manage SSL and NONSSL much better now without the hassel of needing to worry who is what and when.

Link to comment
Share on other sites

to the IF in application_top.php so if I was on a product before checkout, and logoff in the middle of checkout I get the logoff.php then continue takes me to that last product.

 

actually in that case u are taken back to shopping_cart.php, which would be empty.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

&& (!strstr($PHP_SELF,'checkout'))

 

wait a second... wouldn't the SSL check of the last snapshot in logoff.php effectively eliminate the need for this?

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I really like these redirects.

 

Let's say I go to the cart and it's empty ... oh gosh, forgot to login ... I click the login in the navigation or use the loginbox (very handy to have these two things if not at least one or the other for customers) and the Login happens ... shazam! There is the cart full of toys and goodies from last visit.

 

I am in the middle of a huge New Products listing ... get the bright idea to login ... login ... shazam! There is the New Products listing right where I left off ...

 

Gotta admit, this is a great idea from the customer's stand point, they seldom get lost now.

 

But, I strongly recommend that people use at least a toggle link for login/logoff in the navigation bar and/or the loginbox.

 

Very handy for the customer to always see a way to login.

Link to comment
Share on other sites

For giggles, I added this too to application_top.php

 

&& (!strstr($PHP_SELF,'account'))

 

About 95% of the time, continue continues correctly now.

 

The whole IF for application_top.php and I have this stuck as the last thing in there before the ?> is:

// WebMakers.com Added: Login and Logoff redirect

// if the customer is not logged on, set the page to return to upon login

 if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup')) && (!strstr($PHP_SELF,'checkout')) && (!strstr($PHP_SELF,'account')) && (substr(basename($PHP_SELF), 0, 4) != 'info') ) {

   $navigation->set_snapshot();

 }

Link to comment
Share on other sites

&& (!strstr($PHP_SELF,'checkout'))

 

wait a second... wouldn't the SSL check of the last snapshot in logoff.php effectively eliminate the need for this?

 

I did not seem to have those pages cooperating on the logoff

 

I will have to check again to see if not having that in there lets me logoff in the middle of checkout and return to where I was when I started the checkout.

Link to comment
Share on other sites

I tried this in application_top.php and so far so good:

 

  if ( ($HTTPS !='on') && (!strstr($PHP_SELF,'popup')) && (substr(basename($PHP_SELF), 0, 4) != 'info') ) {

Link to comment
Share on other sites

Almost right ... forgot logoff is not secure.

 

  if ( ($HTTPS !='on') && (!strstr($PHP_SELF,'popup')) && (!strstr($PHP_SELF,'logoff')) && (substr(basename($PHP_SELF), 0, 4) != 'info') ) {

Link to comment
Share on other sites

It would be cool when you 3 have figured this TIPS & TRICKS 'contribution' out so that you can make a nice 'real' contribution of it.

I love the idea of this one, but wait rather till it's ready without 'bugs'

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

Hi there

I have a Prob with this setup.

After login it stays on teh same page like its supposed to.

but i want no reference to login parts at all till they buy something so i removed all login parts.

 

Now the prob is this - when a new client goes to buy something he is taken to the signup page, he signs up successfully but when ya hit continue it stays on the account success page.

hovering over the continue button its linked to itself for some reason.

what do i need to do to fix it?

 

here my site if you want to see for yaself to get a better idea

http://net-tech.net.nz

 

Thanx heaps :)

Link to comment
Share on other sites

Well, this is just my opinion .....but I would remove this mod....You don't need it if you have removed all references to login until they go to checkout...if they login at check out it should continue through the checkout anyway.

Link to comment
Share on other sites

and i thought of something as well. i cant remove all reference to a login becuz the customer may like to come back and check his account stats and will have to buy (at least place it in his cart and hit check out)something to login :/ not a good look i think heh

Link to comment
Share on other sites

  • 2 weeks later...

I tried to get this too work in MS1. But following the directions in this post I get the following error.

 

Fatal error: Call to undefined function: tep_get_validate_show_link()

 

 

Can you help me update this for MS1?

Are Oompa-Loompa's asexual?

Link to comment
Share on other sites

  • 2 weeks later...

This is a great idea!

 

I can get the logoff part to go back to a product but the login part still redirects back to default.php

 

I have added this:

// if the customer is not logged on, set the page to return to upon login 

 if ( (basename($PHP_SELF) != FILENAME_LOGIN) && (basename($PHP_SELF) != FILENAME_LOGOFF) && (!strstr($PHP_SELF,'create')) && (!strstr($PHP_SELF,'popup')) && (!strstr($PHP_SELF,'checkout')) && (!strstr($PHP_SELF,'account')) && (substr(basename($PHP_SELF), 0, 4) != 'info') ) { 

   $navigation->set_snapshot(); 

 }

 

to the bottom of application_top.php

 

I thought it may be because of the info bit at the end (product_info has the word info in it) but then I don't know the significance of the 0, 4 either. In any case, I left that bit out and still no joy.

 

Does anyone know why this might be happening?

 

thanks

 

Jen

I haven't lost my mind - I have it backed up on disk somewhere.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...