I make all module controllers inherit from an AdminController like the following:
class AdminController extends Controller
{
...
public function beforeAction()
{
$user = Yii::app()->user;
if($user->isGuest) {
$this->redirect(Yii::app()->user->loginUrl);
return false;
}
return true;
}
}
You can also implement the same logic in the beforeControllerAction method of protected/modules/admin/AdminModule.php (assuming that your module name is admin).