You can use the following module.
1) You want to restrict your entire site to authenticated users. Simply enter "*" as the only path to redirect and all anonymous traffic will be redirected to the login page.
2) Your website sends out emails that contain links that only authenticated users can reach (edit your account, edit a node, view a private message, etc). If the user clicks the link from the email and they are not currently logged in they will reach an "Access denied" page; which is horrible for usability. With this module enabled and configured to act on node/*/edit paths, if a user clicks a link to site.com/node/123/edit, they will be redirected to site.com/user/login?destination=node/123/edit, so they can log in, then be brought to the page originally requested.