how do you force login to see or do anything?

How do you create a closed site that doesn’t let you see or do anything until you are logged in? Also need to redirect all anonymous users to the login page.

create a base controller and extend from it all protected controllers. In the init method or before the controller is run, check the state of CWebUser::isGuest, if true then redirect to login controller::action.

Of course there or many other ways of doing it that you can explore.

     I dont want to force my user to search something but when they go to search system force to login first how to solve this problem