Hey Josh, that almost worked perfectly

It half works... When I add this code, if you are not logged in, or in the wrong group, you are correctly displayed with the not authorized message. Sweet I know

But when an authorized user does try to access the page, either a bunch of jumbled characters display on a white screen, or the browser prompts you to download a file.. which is just more jumbled text.
So, somehow this code isn't working friendly with the existing script. I tried changing positions of the threads authenticate code, and if you put it below one of the initial commands of the existing script.. the threads stuff doesn't even go into effect, yet produces no errors. So, it has to be at the very top to work.
Anyway, I'm just wondering if there has to be another greater if statement that encloses all of the threads code? Or there has to be some way to isolate it a bit.
I was also thinking, maybe put the threads script in a completely seperate file.. then call the file at the top of the existing script returning a do or don't proceed value?
I dunno which would work best for something like this
