Browse Source

fix Auth bug

euromark 12 years ago
parent
commit
9d77bac7cb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Controller/Component/AuthExtComponent.php

+ 1 - 1
Controller/Component/AuthExtComponent.php

@@ -187,7 +187,7 @@ class AuthExtComponent extends AuthComponent {
 			if ($this->settings['multi'] || !isset($userArray['role_id'])) {
 				$parentModelAlias = $this->settings['parentModelAlias'];
 				$userArray[$parentModelAlias] = array(); # default: no roles!
-				$roles = $this->{$withModel}->find('list', array('fields' => array($withModel.'.role_id'), 'conditions' => array($withModel.'.user_id' => $user['id'])));
+				$roles = $this->{$withModel}->find('list', array('fields' => array($withModel.'.role_id'), 'conditions' => array($withModel.'.user_id' => $userArray['id'])));
 				if (!empty($roles)) {
 					//$primaryRole = $this->user($this->fieldKey);
 					// retrieve associated role that are not the primary one