Passing object path to redirect page if it is a login page

I was asked to allow people to login and then get redirected to the page they were trying to access when they goto pushed to the islandora_restricted redirect page.

This seems to have worked, so I submit it for your perusal as we will need this going forward. If there is a better way to do this with hooks, please just let me know.

cheers