[drupal-devel] [feature] Easily persist destinations

jjeff drupal-devel at drupal.org
Tue Jul 19 03:30:37 UTC 2005


Issue status update for 
http://drupal.org/node/26467
Post a follow up: 
http://drupal.org/project/comments/add/26467

 Project:      Drupal
 Version:      cvs
 Component:    base system
 Category:     feature requests
 Priority:     normal
 Assigned to:  drumm
 Reported by:  drumm
 Updated by:   jjeff
 Status:       patch

Well it does not affect the default Drupal login process, but if a theme
wants to put a login *link* on its pages rather than the Drupal-esque
login form-on-every-page, then the appropriate way would be to use:



<?php
print l(t('Login/Register'), 'user/login', array(),
drupal_get_destination());
?>




The idea being that users would get sent to
http://www.example.com/user/login?destination=the_node_they_came_from
However, because the destination does not persist, they don't get sent
back to the node they came from. Instead they get sent to their user
page.


Unless I'm reading it wrong, this patch fixes drupal_get_destination()
so that everything works as it should and the user ends up logged in
and back at the original node.


-Jeff




jjeff



Previous comments:
------------------------------------------------------------------------

Wed, 06 Jul 2005 18:01:07 +0000 : drumm

Attachment: http://drupal.org/files/issues/common.inc_4.diff (1.44 KB)

I think drupal_get_destination() should keep track of the origionally
set destination. With this patch drupal_get_destination() will return
the current destination instead of the current page if it exists.




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

Wed, 06 Jul 2005 18:10:04 +0000 : drumm

setting status to patch




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

Wed, 06 Jul 2005 19:14:20 +0000 : drumm

Attachment: http://drupal.org/files/issues/common.inc_5.diff (1.47 KB)

More clear help text. Hopefully the patch is more self-explanatory now.




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

Thu, 07 Jul 2005 05:41:57 +0000 : Kobus

Not sure if I understand this correctly, but from my scan of the code it
seems like it. If I do understand correctly:


1. User clicks on an e-mail or web link to an article on a page.
2. Authentication is required.
3. User gets redirected to log in.
4. User logs in.
5. User gets redirected to the original article they requested.


If that is what this patch enables me to do, I am +20 for it :)


Regards,


Kobus




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

Mon, 18 Jul 2005 19:22:05 +0000 : drumm

I am updating this patch so that this API feature is used by the node
module.




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

Mon, 18 Jul 2005 22:08:54 +0000 : drumm

Attachment: http://drupal.org/files/issues/destination.patch (3.6 KB)

This patch includes going back to the right place when deleting nodes.




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

Mon, 18 Jul 2005 22:14:55 +0000 : drumm

Wrong status.




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

Mon, 18 Jul 2005 22:22:55 +0000 : chx

very nice idea.




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

Tue, 19 Jul 2005 00:51:40 +0000 : jjeff

I've been using a hack to get this functionality on my current site. It
should DEFINITELY be part of the core. If anyone wants to build a theme
that doesn't have a login box on every page, this is absolutely
necessary.


++1




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

Tue, 19 Jul 2005 01:03:41 +0000 : drumm

Just to be clear, this does not affect the login process.







More information about the drupal-devel mailing list