Login dependent Controller Action

There is a Find Button on User Interface which filters the results. But first time, when user clicks on Find button, he is forced to login. When Find button is pressed, an action is invoked of the Controller if user is logged in.

What should be the best way for doing this ?

I remember there is a simple check that can be added to any action so that it forces users to login first.

Take a look a Yii::app()->user->loginRequired

or the Access Control filter