
I think as long as you are including main you should be fine.
One thing -
In the sidebar.php script there's this:
$config['reauth'] = '1';
This skips the step of setting the cookies needed during the authenticate function, as if you try to reset cookies on a page that's already been set, you can get the "headers already sent" error.
So on your non headers pages - there will be no authenticate function previously on the page.
You can either include the authenticate function in your regular pages. Or duplicate the sidebarpal.php to something like sidebarpal.php - change the above variable to 0 and use that copy on your pages where you're not authenticating or sending the headers.
