this should do the trick:
search for $qa_logged_in_userid_checked=true;
now you'll get automatically redirected to the login page - if you're not logged in...
There is just one problem: unfortunately I can't read out the parameter "qa" at this place -- so new users are not able to register - also they will be redirected to login instead of to register page...
...and I don't know why...
Any hints from other users?