You could group together a couple of IF commands at the start of the page, first see if they are logged in, if not display a message stating they need to be logged in to see the page, and if that requirement is met then continue to a second if command and use the totalflights variable out of $userinfo to check the number of flights filed. Maybe something like this…
<?php
if(!Auth::LoggedIn())
{
echo 'You must be logged in to view this page!';
return;
}
if (Auth::$userinfo->totalflights <= 5)
{
echo 'You must file over 5 flights before you can access this page!';
return;
}
?>
//Page content goes here