adding validation to AuthComponent::identify()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5692 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-09-25 11:27:00 +00:00
parent 603ed0e39c
commit c8d3fe4a4e

View file

@ -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;
}