Your redirect is happening even if you are logged int. try this adjustment:
public function login() {
if($this->request->is('post')) {
if($this->Auth->login()) {
//User is authorized so see if they have an owner
//record
$results =
$this->User->findById($this->Auth->user('id'));
$this->set('results',$results);
}else{
$this->redirect($this->Auth->redirect());
}
} else {
$this->Session->setFlash(_('Invalid name or password,try
again'));
}
}
On Sunday, August 12, 2012 7:40:45 PM UTC-4, Toren Valone wrote:
>
> I know this is probably a simple answer, but i appear to be stumped, I
> have a user controller, which authorizes a user and then checks to see if
> they user has an owner record. Unfortuanltly my code just flies over the
> code and hits the redirect in the appcontroller. Here is the
> UserController.php code.
>
> public function login() {
> if($this->request->is('post')) {
> if($this->Auth->login()) {
> //User is authorized so see if they have an owner
> //record
> $results = $this->User->findById($this->Auth->user('id'));
> $this->set('results',$results);
>
> }
> $this->redirect($this->Auth->redirect());
> } else {
> $this->Session->setFlash(_('Invalid name or password,try
> again'));
> }
> }
>
> here is the view in Users/is_owner.ctp
>
> <? echo debug($results); ?>
> <? echo debug($results['User']); ?>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.