Made Auth component find conditions more explicit, closes #4680

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6936 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
the_undefined 2008-05-18 23:49:51 +00:00
parent 943ede837c
commit abe853a978

View file

@ -732,16 +732,16 @@ class AuthComponent extends Object {
return false; return false;
} }
$find = array( $find = array(
$this->fields['username'] => $user[$this->fields['username']], $this->userModel.'.'.$this->fields['username'] => $user[$this->fields['username']],
$this->fields['password'] => $user[$this->fields['password']] $this->userModel.'.'.$this->fields['password'] => $user[$this->fields['password']]
); );
} elseif (isset($user[$this->userModel . '.' . $this->fields['username']]) && !empty($user[$this->userModel . '.' . $this->fields['username']])) { } elseif (isset($user[$this->userModel . '.' . $this->fields['username']]) && !empty($user[$this->userModel . '.' . $this->fields['username']])) {
if (trim($user[$this->userModel . '.' . $this->fields['username']]) == '=' || trim($user[$this->userModel . '.' . $this->fields['password']]) == '=') { if (trim($user[$this->userModel . '.' . $this->fields['username']]) == '=' || trim($user[$this->userModel . '.' . $this->fields['password']]) == '=') {
return false; return false;
} }
$find = array( $find = array(
$this->fields['username'] => '= ' . $user[$this->userModel . '.' . $this->fields['username']], $this->userModel.'.'.$this->fields['username'] => '= ' . $user[$this->userModel . '.' . $this->fields['username']],
$this->fields['password'] => '= ' . $user[$this->userModel . '.' . $this->fields['password']] $this->userModel.'.'.$this->fields['password'] => '= ' . $user[$this->userModel . '.' . $this->fields['password']]
); );
} else { } else {
return false; return false;