Problem/Motivation

We needed a way to modify the default $redirect_url in certain situations. In our example, site admins need to be redirected to an admin-only URL upon auto-logout, whereas "regular" authenticated users will continue to the default $redirect_url.

Proposed resolution

We propose adding a hook_autologout_redirect_url_alter to allow the customisation of the $redirect_url (and the $redirect_query, if necessary).

A patch to add this functionality is attached -- can someone please review, thank you.
This is my first patch in Drupal, so please let me know if I did anything wrong.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

44sunsets created an issue. See original summary.

geoffreyr’s picture

+1 for #2 - we've been using it for a while now and it works fine.

saurabh-chugh’s picture

I have tested and #2 is working fine. Thanks @44sunsets

DeaOm’s picture

Status: Needs review » Needs work

This line of code drupal_alter('autologout_redirect_url', $redirect_url, $redirect_query); breaks the login altogether. I applied the patch, it applies

My bad, did not notice this is for drupal 7. The patch applies.

DeaOm’s picture

Status: Needs work » Needs review
bzoks’s picture

Status: Needs review » Reviewed & tested by the community

I applied patch at #2 and successfully tested provided hook. Marking as RTBC.

  • boshtian committed 1a3763a on 7.x-4.x authored by 44sunsets
    Issue #2863161 by 44sunsets, DeaOm, geoffreyr, saurabh-chugh, bzoks: Add...
boshtian’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.