$this->AuthPlus->actionPath = 'controllers/';
$this->AuthPlus->authorize = 'crud';
// 認証済みユーザ情報のセット
- $this->user = $this->getUser($this->AuthPlus->user('id'));
+ $this->user = $this->AuthPlus->user();
if (in_array($this->AuthPlus->user('group_id'), array(1,2,3))) {
$this->isAdministrator = true;
}
parent::beforeRender();
}
+ /* 共通関数 */
/*
* 不正な$this->dataセットを削除
*/
}
}
-
}
// AppControllerを携帯とPCで振り分け
parent::beforeRender();
}
-
- /* 共通関数 */
- function getUser($id) {
- if (!$id) {
- return $this->user;
- }
- $user = $this->User->read(null, $id);
- if (!$user['User']) {
- $this->Session->setFlash(__('Invalid User.', true));
- return $this->user;
- }
- return $user;
- }
-
}
}
}
+ /* ユーザ情報取得 */
+ function getUser($id) {
+ if (!$id) {
+ return $this->user;
+ }
+ $user = $this->User->read(null, $id);
+ if (!$user['User']) {
+ $this->Session->setFlash(__('Invalid User.', true));
+ return $this->user;
+ }
+ return $user;
+ }
+
}