Lock down site for private beta (if site.locked=true)

Unauthorized users are shown the 404 page, which prompts to login.
Might need tweaking for logged-in but unauthorized users.