Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #20 from t1mmen/master
Browse files Browse the repository at this point in the history
Fixed 'contain' option not working.
  • Loading branch information
ceeram committed Jul 16, 2014
2 parents 39c9704 + 687c97f commit 9e6e500
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Controller/Component/Auth/MultiColumnAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class MultiColumnAuthenticate extends FormAuthenticate {
),
'columns' => array(),
'userModel' => 'User',
'scope' => array()
'scope' => array(),
'contain' => null
);

/**
Expand Down Expand Up @@ -72,13 +73,16 @@ protected function _findUser($username, $password = null) {
}
$result = ClassRegistry::init($userModel)->find('first', array(
'conditions' => $conditions,
'recursive' => 0
'recursive' => 0,
'contain' => $this->settings['contain'],
));
if (empty($result) || empty($result[$model])) {
return false;
}
unset($result[$model][$fields['password']]);
return $result[$model];
$user = $result[$model];
unset($user[$fields['password']]);
unset($result[$model]);
return array_merge($user, $result);
}

}

0 comments on commit 9e6e500

Please sign in to comment.