[fix bug 976099] Redirect to current page after logging in.

I tried with the recommended lines(90-92) and the result was out of requirements. in particular i went to events page to login and after verification it redirected me back to dashboard. 

This is the purpose of else which redirects to the current page except you are in the main. So I leave that as it is except you have anything else to guide me through an alternative implementation.