X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Make logout confirmation page? How to? (https://forum.x-cart.com/showthread.php?t=24139)

taltos1 08-16-2006 09:50 AM

Make logout confirmation page? How to?
 
Hello, I have used this thread as a starting point
http://forum.x-cart.com/viewtopic.php?t=3024&start=45&postdays=0&postorder =asc&highlight=logout
But I did not see an answer to this.
I am using a text link pointing to
Code:

include/login.php?mode=logout&redirect=customer
to Log Out the user but it just kicks the user to the homepage, I would like it to go to a simple,
"You have been logged out " page.
Can anyone help me with that?

Thanks a lot.

balinor 08-17-2006 02:45 AM

login.php should have some redirect code for when the user logs out....

taltos1 08-17-2006 04:51 AM

Thank you, I will look into that

taltos1 08-17-2006 06:01 AM

One line 278 I see this:
Code:

if ($mode == "logout") {
        x_session_register("payment_cc_fields");
        $payment_cc_fields = array();

and on line 314 I see this:
Code:

func_header_location($redirect_to."/home.php");
but I am not sure how this is working together...

Any ideas...
Thanks

taltos1 08-20-2006 09:29 AM

This is still eluding me? Anyone..
Thanks a lot

neroag 08-20-2006 09:56 AM

If you look at /include/login.php

look for
Code:

# Insert entry into login_history
just below the line
Code:

$login_redirect = 1;

add
Code:

func_header_location($redirect_to."/mynewlogoutpage.php");

just change the mynewlogoutpage.php to whatever page you want to redirect too.

hope that helps

taltos1 08-29-2006 08:17 PM

Re: Make logout confirmation page? How to?
 
Thank you so much for your help!

ecommerce 09-12-2006 09:27 AM

Re: Make logout confirmation page? How to?
 
Nero...Thanks! this was a brain crusher for me! :lol:

taltos1 12-18-2006 12:14 PM

Re: Make logout confirmation page? How to?
 
Quote:

Originally Posted by neroag
If you look at /include/login.php

look for
Code:

# Insert entry into login_history
just below the line
Code:

$login_redirect = 1;

add
Code:

func_header_location($redirect_to."/mynewlogoutpage.php");

just change the mynewlogoutpage.php to whatever page you want to redirect too.

hope that helps


Thank you! But now can you tell me how to make the logout page look like the rest of my site. I know I should use home.tpl, and I got that working (the page) but all the images are gone and the page only displays the php etc.. coding?

Thanks so much

taltos1 12-19-2006 12:08 PM

Re: Make logout confirmation page? How to?
 
This is still eluding me? Anyone. Thanks a lot!

taltos1 02-15-2007 11:22 AM

Re: Make logout confirmation page? How to?
 
I tried a few more times to implement this and still no luck, I cannot get the logout confirmation page to work into/look like the rest of my site. Please help...

balinor 02-20-2007 10:56 AM

Re: Make logout confirmation page? How to?
 
Just make the logout page an embedded static page.

taltos1 02-20-2007 07:05 PM

Re: Make logout confirmation page? How to?
 
Smart! I cannot believe I did not think about that. You are great!

carpeperdiem 02-23-2007 05:55 PM

Re: Make logout confirmation page? How to?
 
Has anyone tried to make this work for 4.1.x ?

The code in post #6 (and #9) is not appropriate for 4.1

Any ideas? Thanks.

Jeremy

Ene 02-23-2007 06:08 PM

Re: Make logout confirmation page? How to?
 
Quote:

Originally Posted by carpeperdiem
Has anyone tried to make this work for 4.1.x ?

The code in post #6 (and #9) is not appropriate for 4.1

Any ideas? Thanks.

Jeremy


In include/login.php replace

PHP Code:

if ($old_login_type == 'C') {
    if (!empty(
$HTTP_REFERER) && (strncasecmp($HTTP_REFERER$http_locationstrlen($http_location)) == || strncasecmp($HTTP_REFERER$https_locationstrlen($https_location)) == 0)) {
        if (
strpos($HTTP_REFERER"mode=order_message") === false &&
            
strpos($HTTP_REFERER"mode=wishlist") === false &&
            
strpos($HTTP_REFERER"bonuses.php") === false &&
            
strpos($HTTP_REFERER"returns.php") === false &&
            
strpos($HTTP_REFERER"orders.php") === false &&
            
strpos($HTTP_REFERER"giftreg_manage.php") === false &&
            
strpos($HTTP_REFERER"order.php") === false &&
            
strpos($HTTP_REFERER"register.php?mode=delete") === false &&
            
strpos($HTTP_REFERER"register.php?mode=update") === false) {
            
func_header_location($redirect_to.strrchr($HTTP_REFERER"/"), false);
        }
    }



with the

PHP Code:

if ($old_login_type == 'C') {
func_header_location($redirect_to."/mynewlogoutpage.php");
/*
    if (!empty($HTTP_REFERER) && (strncasecmp($HTTP_REFERER, $http_location, strlen($http_location)) == 0 || strncasecmp($HTTP_REFERER, $https_location, strlen($https_location)) == 0)) {
        if (strpos($HTTP_REFERER, "mode=order_message") === false &&
            strpos($HTTP_REFERER, "mode=wishlist") === false &&
            strpos($HTTP_REFERER, "bonuses.php") === false &&
            strpos($HTTP_REFERER, "returns.php") === false &&
            strpos($HTTP_REFERER, "orders.php") === false &&
            strpos($HTTP_REFERER, "giftreg_manage.php") === false &&
            strpos($HTTP_REFERER, "order.php") === false &&
            strpos($HTTP_REFERER, "register.php?mode=delete") === false &&
            strpos($HTTP_REFERER, "register.php?mode=update") === false) {
            func_header_location($redirect_to.strrchr($HTTP_REFERER, "/"), false);
        }
    }
*/



carpeperdiem 02-23-2007 06:17 PM

Re: Make logout confirmation page? How to?
 
Hi Eugene,

Thanks for the code. I have a slight issue in that CDSEO is installed in my store, and there is CDSEO code all over this file. I have to tread lightly. But the idea of a logout confirmation page is a good one, and I'm going to try to make this happen. I'll report back if I get it working with CDSEO.

Thanks!

Jeremy

carpeperdiem 02-24-2007 04:33 AM

Re: Make logout confirmation page? How to?
 
Jon, if you're reading this, would this edit work with CDSEO?

Code:

if ($old_login_type == 'C') {
func_header_location($redirect_to."/mynewlogoutpage.php");
    // Check for a CDSEO url to redirect back to
    if (checkforcdseo_login($HTTP_REFERER) === TRUE) {
        func_header_location($HTTP_REFERER, false);
    }
/*
    elseif (!empty($HTTP_REFERER) && (strncasecmp($HTTP_REFERER, $http_location, strlen($http_location)) == 0 || strncasecmp($HTTP_REFERER, $https_location, strlen($https_location)) == 0)) {
        if (strpos($HTTP_REFERER, "mode=order_message") === false &&
            strpos($HTTP_REFERER, "mode=wishlist") === false &&
            strpos($HTTP_REFERER, "bonuses.php") === false &&
            strpos($HTTP_REFERER, "returns.php") === false &&
            strpos($HTTP_REFERER, "orders.php") === false &&
            strpos($HTTP_REFERER, "giftreg_manage.php") === false &&
            strpos($HTTP_REFERER, "order.php") === false &&
            strpos($HTTP_REFERER, "register.php?mode=delete") === false &&
            strpos($HTTP_REFERER, "register.php?mode=update") === false) {
               
        func_header_location($redirect_to.strrchr(func_qs_remove($HTTP_REFERER, $XCART_SESSION_NAME), "/"), false);
            }
    }
*/

}


I don't really understand why the "// Check for a CDSEO url to redirect back to" code is important, so I have no idea if this is going to help or hurt.

The reason I would like a logout confirmation: since I have "Rememebr Me" I want to make it clear to customers that may be on a public terminal, that if they logout, they are definitely logged out. A confirmation page is an obvious enhancement.

I was going to make a static embedded page, and exclude it from the help menu (by POS).

Any advice? Am I on the right track?

Thanks!

Jeremy

UPDATE: I did this edit and it seems to work. I added this line to pages_menu.tpl to exclude the static page:
Code:

{if $pages_menu[pg].orderby > 900}
{else}

Works as expected.

Jon: is this going to get in the way of CDSEO? Thanks!

Jeremy

Jon 02-24-2007 08:36 AM

Re: Make logout confirmation page? How to?
 
Hi Jeremy,

No problem. You may just want to add " exit;" after func_header_location($redirect_to."/mynewlogoutpage.php"); to ensure that no further processing is done.


The code I put in for "// Check for a CDSEO url to redirect back to" was because your logout was having difficulty with the http_referrer tag used by default, but the code you are now using makes all previous logout redirect processing irrelevant.

carpeperdiem 02-24-2007 08:52 AM

Re: Make logout confirmation page? How to?
 
Hi Jon,

Thanks for the heads up on the "exit;"

I just tried it and it works perfectly.

So the "// Check for a CDSEO url to redirect back to..." code was something you did just for me? Wow I feel special! So I can comment it out without harm?

This is my new favorite feature of the store. :)

Now, someday, we'll add a login to this "logout confirmation" page, so the customer could login again from here -- and of course, SOMEDAY ;) we'll put Remember Me code everywhere there's a potential login. Geez, I need to get a life.

How much fun is this? Thanks again.

Jeremy

Ene 02-24-2007 11:44 AM

Re: Make logout confirmation page? How to?
 
BTW you don't need to add exit(); after func_header_location(), because this function already has it:

PHP Code:

function func_header_location($location$keep_https true) {
    global 
$XCART_SESSION_NAME$XCARTSESSID$HTTP_COOKIE_VARS;

...

    
func_flush();
    exit();



carpeperdiem 02-24-2007 02:34 PM

Re: Make logout confirmation page? How to?
 
Hi Eugene,

Thanks for commenting on this code...

I searched my file
# $Id: login.php,v 1.120.2.20 2007/01/04 08:26:59 twice Exp $

And there are no instances of

func_flush
();

OR

exit();

anywhere in my login.php file --

I wonder if my file is modified from the original (or current) source. Hmmm...

Ene 02-24-2007 02:50 PM

Re: Make logout confirmation page? How to?
 
Quote:

Originally Posted by carpeperdiem
Hi Eugene,

Thanks for commenting on this code...

I searched my file
# $Id: login.php,v 1.120.2.20 2007/01/04 08:26:59 twice Exp $

And there are no instances of

func_flush
();

OR

exit();

anywhere in my login.php file --

I wonder if my file is modified from the original (or current) source. Hmmm...


Your file isn't modified from the original source. Search '<xcart_dir>/include/func/func.core.php' script, you'll find the posted code.

I.e. you use 'func_header_location()' function in the include/login.php file.
'func_header_location()' function is declared in the '<xcart_dir>/include/func/func.core.php' script and already has 'exit()' in it.

That's why you don't need to add exit() to include/login.php

carpeperdiem 02-24-2007 03:23 PM

Re: Make logout confirmation page? How to?
 
Got it. Thanks for your response on this. It is appreciated.


All times are GMT -8. The time now is 05:35 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.