i'm creating a user panel, and i want to allow methods depending on the user state, if is logged on or isn't, wich method is called by the url, for example:
funciton home () {...}
function create_account () {...}
the create_account method is only available if the user's off, and the home when he is on, what i'm doing individually is something like this:
function home () {
if(!$userLogged)
die('Ei, little satan, you can't enter here!');
}
How can i intercept all methods that have been called and make some rules?
function __interceptAll($method) {
$userOff = array('create_account'...);
$userOn = array('home','change'...);
if(in_array)....
}