浏览代码

fix Auth bug

euromark 12 年之前
父节点
当前提交
9d77bac7cb
共有 1 个文件被更改,包括 1 次插入1 次删除
  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'])) {
 			if ($this->settings['multi'] || !isset($userArray['role_id'])) {
 				$parentModelAlias = $this->settings['parentModelAlias'];
 				$parentModelAlias = $this->settings['parentModelAlias'];
 				$userArray[$parentModelAlias] = array(); # default: no roles!
 				$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)) {
 				if (!empty($roles)) {
 					//$primaryRole = $this->user($this->fieldKey);
 					//$primaryRole = $this->user($this->fieldKey);
 					// retrieve associated role that are not the primary one
 					// retrieve associated role that are not the primary one