I would like to have the following feature:

1) anonymouse users try to view a page of some restricted content type.
2) some module (e.g. r4032login) redirects anonymous users to user/login.
3) ip_login shows the login link if the ip address matches the range.
4) autholized users by ip_login are redirected to the page which the user tried to view in (1).

The attached patch may resolve the issue in this scenario. The patch works as follows:

1) save the destination url in the session (_SESSION) if the destination (_GET) is given for user/login.
2) call drupal_goto with the saved destination, in ip_login_attempt_login().

Please note that the final destination is over written if other module (for example, login_destination) is enabled.

Moreover, drupal_get_destination() may be more suitable for this purpose. In this patch, since I'm not so sure about the query variable "q", I dare to use a direct way to get the destination.

Comments

Status: Needs review » Needs work

The last submitted patch, ip_login-destination.patch, failed testing.

josaku’s picture

StatusFileSize
new1.65 KB
josaku’s picture

ip_login-destination.patch queued for re-testing.

The last submitted patch, ip_login-destination.patch, failed testing.

josaku’s picture

josaku’s picture

StatusFileSize
new1.65 KB

I could not understand well the way to send the patch re-test.
Please avoid the recent my comments that were just tries from this point of view.

amateescu’s picture

Status: Needs work » Closed (outdated)

Closing old issues.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.