Just a quick thing really.
Your first few lines states;
If the logged_in session variable is not empty, then $access = FALSE.
Then, slightly lower down, as part of the same 'if' part, you state:
else if the logged_in session variable is empty, ..... $access = FALSE!!!
So either...