Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
3 May 2009 at 20:03 UTC
Updated:
21 Sep 2009 at 08:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
RobertPope commentedcan you create a page-logout.tpl.php and then direct it where you want to go?
Comment #2
aaronmchaleThanks, however I want the user to be redirected back to the page they were on when they clicked on the logout link?
Comment #3
RobertPope commentedisn't the reffering URL available as a variable? can't you just redirect back there? I thinks it's in the DOM
Comment #4
aaronmchaleSorry, In the what?
Comment #5
sunYes, that's an often needed customization. Let's add this simple bit to core.
Comment #6
aaronmchaleWhere about do I put that patch?
Comment #7
RobertPope commenteddocument object model - anyway the patch as I see it will allow you to select your logout page - but not necessarily have it be the last one they were on.
Comment #8
sun@roberttwobears: As mentioned in IRC, redirecting back to the originating page is not possible, because authenticated users usually log out from pages that are accessible to authenticated users only. So your users would get a "403 Access denied." page after logging out. There is no way in the current menu system that would allow conditional page redirects based on the requested path and the current user's permissions.
Comment #9
aaronmchaleThanks, I'm not new to Drupal, but I'm new to patches. Where exactly is that module located because I can't find it in the module directory (/module/)?
Comment #10
sunComment #11
aaronmchaleIn what directory should I put a patch file in (/)?
Comment #12
int commentedazz, no.. this patch is to patch one file(replace somes string in one file) and not to add this file to one directory..
See in de documentation in drupal.org you will have everything...
http://drupal.org/patch
http://drupal.org/node/367392
http://drupal.org/node/323498
Comment #13
aaronmchaleOh, ok, sorry i'm new to patches.
Comment #14
aaronmchaleWindows doesn't support patch files so the command prompt won't let me do what I need to do to get the patch to work. What can I do?
Comment #15
int commentedApply patches on Windows
http://drupal.org/node/60179
Comment #16
aaronmchaleThanks
Comment #17
aaronmchaleComment #18
sunWell, was that a confirmation of the type "cool, it works"? If so, "reviewed & tested by community" is the proper status.
Comment #19
calebgilbert commentedReviewed:
1. Patch apples
2. Patch code appears up to Drupal coding standards
3. Manual functionality testing passes - works as advertised
4. Simpltest that was added via patch also works as advertised
5. +1 on the functionality
Comment #20
moshe weitzman commentedPersonally, I think this is a bit specialized for core. Soon well have "page after registration" and "page after profile edit and so on". This is trivial to do in contrib - thats my preference.
Comment #21
dries commentedI agree with Moshe. Either we extend this functionality to some additional pages (e.g. registration) or we do this in contrib. I'd vote for the latter.
Comment #22
tstoecklerCouldn't this be done by modifying actions & triggers?
I have always wondered why the redirect action is not available to the logout trigger. If you set a page which gives the freshly logged out user a 403, well then it's your fault. I really don't see any reason not to. Anything else proposed (upon registration, upon update of user profile) is already possible with actions and triggers (although I didn't actually test to see if it works, but I'm assuming that).
Comment #23
catchIf triggers and actions could be used for this, that'd be a lot more flexible for the other feature requests. Moving back to CNR since this needs more discussion.
Comment #24
sunSorry, I obviously forgot to follow up in this issue. #43483: Add trigger/action for custom after-register, after-login and after-logout events dates back to 2006, and asks not only for a configurable "after-logout" page, but also for configurable "after-register" and "after-login" pages. For that sake, those options would also be located on the user settings page (instead of the site information settings as in this patch).
Doing this via triggers/actions sounds like awesome voodoo to me, especially, because one could add all sorts of other stuff.
Thanks for the reviews. See you over there.
Comment #25
aaronmchaleSorry, I'v been away from this issue for a long time. I worked out that you can set a URL Alias from logout to user/logout in Drupal-6 or earlier, but it has to be done in the database, however, this allows you to logout to a specific URL by using ?destination=... This is used in the logon block, so there would be some way of determining the URL of the page the user logs in from, this could be applied here, does anyone know the script that is used to achieve this on the logon block?
Comment #26
aaronmchaleI think this issue is closed now, one way around this problem, I discovered, is to give the path /logout a url /user/logout, this allows for the /user/logout?destination=/...