Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Could be a standalone patch, but designed as a follow-up to #2678666: User is directed back to "destination" and not the actual page they were on after login.
Don't have time to roll a patch at the moment, but here is the suggested approach:
autologout.admin.inc
function autologout_settings() {
...
$form['autologout_redirect_url'] = array(
...
);
+ $form['autologout_no_destination'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Do not preserve the destination'),
+ '#default_value' => variable_get('autologout_no_destination', FALSE),
+ '#description' => t('Enable this if you do not want users to return to the page they were previously on before being logged out.'),
+ );
+
...
}
autologout.module
function autologout_get_current_path_as_destination() {
+ if (variable_get('autologout_no_destination', FALSE)) {
+ return array();
+ }
+
...
}
autologout.install
function autologout_uninstall() {
...
variable_del('autologout_redirect_url');
+ variable_del('autologout_no_destination');
...
}
Comment | File | Size | Author |
---|---|---|---|
#7 | autologout-no_destination-2853545-12983042.patch | 2.22 KB | Fhey |
| |||
#4 | autologout-no_destination-2853545.patch | 3.08 KB | Fhey |
Comments
Comment #2
MustangGB CreditAttribution: MustangGB commentedCNR because the code is there, if someone would like to roll a patch.
Comment #3
MustangGB CreditAttribution: MustangGB commentedComment #4
Fhey CreditAttribution: Fhey commentedRan into the same issue so made a small patch for this issue.
Comment #5
Fhey CreditAttribution: Fhey commentedComment #7
Fhey CreditAttribution: Fhey as a volunteer commentedComment #8
Fhey CreditAttribution: Fhey as a volunteer commentedComment #9
MustangGB CreditAttribution: MustangGB commented#2678666: User is directed back to "destination" and not the actual page they were on after login has been committed so needs a reroll to take
autologout_get_current_path_as_destination()
into account.Also it looks like #7 would undesirably remove
autologout_timeout=1
, so perhaps it would be better to revert to the original code suggested in the issue summary.