So what kind of code would I have to put in?

Such as what defines a logged in person?

And just to be sure where would I find the exact files I need?

Finally (for this post anyway) would this be able to be toggled on and off, or should I just not worry about that?