Special:UserRights "you must login" link does not pass &returnto= on, so after logging in, the user ends up at the main page
@NeerajBattan: Can you elaborate why you "tried to look" instead of actually looking? :) I don't know what a "view file" is, but I guess that SpecialUserRights.php is indeed a good place to start.
Please explicitly explain what you have tried so far or which **specific** code lines are hard to understand and people might be able to help. You could also ask on IRC. Thanks!
That would be my naïve understanding after reading the task summary line but we will only know if that would be enough once someone has written code and tested it. :) No need to ping me personally though as I cannot help much here. :)