Hello,
i'm trying to use this module and i have configured it to only allow a single local ip to be able to login:

192.168.1.123/32
And i have set a redirect url to: node/12
But when a user with another ip tries to login, the logins fails, but the redirect is not "fired".
I'm on Drupal 7.31
I have debugged the code, and variable_get('restrict_by_ip_error_page', '') returns the correct page.
What am i missing / doing wrong?
I can see these entries in the log:

Session closed for admin - Invalid IP. 192.168.1.124
Session opened for admin.
Login attempt failed for admin.

But user is not redirected.

Comments

jakobdo’s picture

I changed this code inside: function _restrict_by_ip_login;

if (isset($_REQUEST['destination'])) {
  unset($_REQUEST['destination']);
}

to:

if (isset($_GET['destination'])) {
  unset($_GET['destination']);
}

And now it works.

rocketeerbkw’s picture

Title: Can't get redirect to work » Login denied error page redirect broken
Version: 7.x-3.0-beta1 » 7.x-3.x-dev
Assigned: Unassigned » rocketeerbkw
Issue tags: -redirect, -drupal_goto
StatusFileSize
new1.27 KB

I've confirmed this is broken in the most recent version. It looks like this has been broken since the port to Drupal 7 unfortunately. I need to write some tests to make sure this doesn't break in the future and then I'll commit the fix.

In the meantime, here's a patch that should get this working for you right now.

rocketeerbkw’s picture

Assigned: rocketeerbkw » Unassigned
Status: Active » Needs review
StatusFileSize
new4.54 KB

Here's a patch with tests

  • rocketeerbkw committed 291e84d on 7.x-3.x
    Issue #2324503 by rocketeerbkw | jakobdo: Fixed Login denied error page...
rocketeerbkw’s picture

Status: Needs review » Fixed

Since there's no further comments and I'm pretty confident my tests are good, I committed this (with a small typo fix).

Status: Fixed » Closed (fixed)

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