The idea is pretty simple. If you are not logged in, you do not have access to any page next to the register and login page. If you are logged in, you have access to all pages except the registry page.
Now half of this is achieved with CakePHP Auth Component. This restricts access when not registered, and allows access during registration.
The problem that I stumbled upon when doing this was restricting access to the registration page when registering. I tried different methods, all with the same result: the registry page was still available.
Need help as I ran into this problem.
Here is part of my code (beforeFilter () in the UsersController; register () class will be an action from this controller):
function beforeFilter(){
parent::beforeFilter();
$this->Auth->allow("register");
if($this->Auth->user()){
$this->Auth->deny("register");
}
}