Back to last page after logout

Author Message

Jeroen Sangers

Friday 20 October 2006 8:24:25 am

Is there a way to redirect a user back to the last visited page after logout? I know how to redirect to a fixed page using the LogoutRedirect parameter, but I haven't found a way to go back to the last visited page, just as happens when logging in.

Ɓukasz Serwatka

Tuesday 24 October 2006 12:01:27 am

Hi,

This is not possible currently. Feel free to submit enhancement request.
You can write your own enhanced logout module based on current.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Renaud Patrick

Thursday 09 August 2007 5:02:32 am

Hello there, it has been only ten months since you asked. :)

If you *really* want to do this, you can by hacking /kernel/user/logout.php

When login out, you call /user/logout. Add a parameter representing the URL of your current page (that which you want to be redirected to).

Modify /kernel/user/logout.php so that it gets this parameter in $redirectURL (with some testing before, of course), and the last line of the code will do the trick

return $Module->redirectTo( $redirectURL );

Heath

Thursday 09 August 2007 6:52:52 pm

Hello,

I think this feature is useful and worth submitting an enhancement request to http://issues.ez.no

While you could hack/patch the kernel 'user' module's 'logout' view php code.

I think it would be cleaner to create an extension, which contained a simple module view based on the stock logout view's php code modified to provide your enhancement.

The end result is the same except you would be simpler to upgrade your eZ publish without conflicts.

You might even use mod_rewrite to maintain the same logout url name to hide the fact that this uses a separate module extension to perform the custom logout. Example: '/user/logout' to '/customuser/customlogout'.

This extension would be worth contributing as well on http://projects.ez.no

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Kristof Coomans

Friday 10 August 2007 12:30:25 am

There's an enhancement request for this: http://issues.ez.no/9275

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Paul Forsyth

Tuesday 30 October 2007 5:00:37 am

Simple patch for this added:

http://issues.ez.no/9275

Paul

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 00:47:09
Script start
Timing: Jan 30 2025 00:47:09
Module start 'layout'
Timing: Jan 30 2025 00:47:09
Module start 'content'
Timing: Jan 30 2025 00:47:09
Module end 'content'
Timing: Jan 30 2025 00:47:09
Script end

Main resources:

Total runtime0.0161 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 588.1406151.2109
Module start 'layout' 0.00570.0027 739.351636.6641
Module start 'content' 0.00840.0063 776.015694.2656
Module end 'content' 0.01470.0014 870.281337.9922
Script end 0.0161  908.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002414.6795140.0002
Check MTime0.00106.1817140.0001
Mysql Total
Database connection0.00127.663210.0012
Mysqli_queries0.002314.299930.0008
Looping result0.00000.104910.0000
Template Total0.00116.810.0011
Template load0.00095.372210.0009
Template processing0.00021.449010.0002
Override
Cache load0.00053.351610.0005
General
dbfile0.00159.218680.0002
String conversion0.00000.044340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs