Yeah I tried that. Going with this as it seems to work.
if ($status == 0) {
//Account is Pending admin approval;
$this->redirect(array('controller' => 'users',
'action' => 'pending'));
exit();
}
Thanks,
Dave
-----Original Message-----
From: Jamie [mailto:[email protected]]
Sent: September-14-09 1:03 PM
To: CakePHP
Subject: Re: Stop queries from executing
Try throwing an "exit();" or "die();" after you render the 'pending'
view.
- Jamie
On Sep 14, 8:21 am, "Dave Maharaj :: WidePixels.com"
<[email protected]> wrote:
> I have a simple check in my beforeFilter
>
> function beforeFilter() {
> parent::beforeFilter();
> $this->Auth->autoRedirect = false;
> $status = $this->Session->read('Auth.User.status');
>
> if ($status == 0) {
> //echo 'Account is Pending';
> $this->render('pending');
>
> }
>
> }
>
> But all the queries for the page trying to be viewed are still being
> run when I turn debug to 2. I just want a simple page to display
> saying pending which it does without any queries being executed.
>
> How can I kill the queries if the status == 0?
>
> Thanks,
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---