PHP Class for checking user login and permission