Public pages authentication
<p>I use same header for all pages, which include:</p>

<ul>
<li>user authentication code,</li>
<li>logo &amp; main menu html,</li>
<li>login information (username, logout button / login-register buttons when not logged in).</li>
</ul>

<p>Now to the question. </p>

<p>How to check if pages are public (accessible for non-registered users) or not? 
I usually redirected the non-registered users to login page, but how to handle it when some pages are public and some are not?
I obviously cant use header since it is page independent. Is putting the public condition to every single page a good idea?</p>
