AppController:
function beforeFilter()
{
$this->Auth->autoRedirect = false;
...
}
UsersController:
(the login() method is run *after* a User has been authenticated
behind the scenes)
public function login()
{
/* Auth holds all fields from users table, which can be accessed with
user() method
*/
if (!$this->Auth->user('valid'))
{
/* I might be wrong about this next line. But you'll need to
undo
the positive authentication
* that Auth has granted up to this point
*/
$this->Session->del('Auth');
$this->Session->flash('naughty, naughty - your email has not
been
confirmed!');
$this->redirect(
array('controller/action where they should be
redirected to')
);
}
$this->redirect($this->Auth->loginRedirect);
}
On Thu, Sep 17, 2009 at 10:19 PM, Jas <[email protected]> wrote:
>
> I have a 'valid' field in the users table which will be set to 1 after
> the user confirms their email. I'm wondering how I'd check during
> login that this is 1?
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---