so I changed the beforefilter of users controller to
if($this->action == 'add' || $this->action == 'edit') {
if(Configure::read('isLoggedIn') && $this->action == 'edit') {
$this->Auth->authenticate = $this->User;
}
}
I write the user vars etc in the beforefilter of app controller
additionally if the user is unable to resiger (a guest adding themselves as a user) I set the password fields to blank (user controller add if the save does not work)
if($this->validateErrors($this->User)) {
//die('we get here');
$this->data['User']['password'] = '';
$this->data['User']['password_confirmation'] = '';
}
5 Comments