From c8d3fe4a4ed7c4eaa46c5b1583e1612eacf18824 Mon Sep 17 00:00:00 2001 From: gwoo Date: Tue, 25 Sep 2007 11:27:00 +0000 Subject: [PATCH] adding validation to AuthComponent::identify() git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5692 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/components/auth.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php index 3b6de0879..09dbff6e9 100644 --- a/cake/libs/controller/components/auth.php +++ b/cake/libs/controller/components/auth.php @@ -736,9 +736,10 @@ class AuthComponent extends Object { ); } $model =& $this->getModel(); - - $data = $model->find(am($find, $this->userScope), null, null, -1); - + $model->set($find); + if($model->validates()) { + $data = $model->find(am($find, $this->userScope), null, null, -1); + } if (empty($data) || empty($data[$this->userModel])) { return null; }