CakePHPのAuthComponent
第 1 版(2011-02-22 13:28:36 · 西小倉パンデイロ)を表示しています。 最新版に戻る
cake/libs/controller/components/auth.php
function user($key = null) {
$this->__setDefaults();
if (!$this->Session->check($this->sessionKey)) {
return null;
}
if ($key == null) {
$model =& $this->getModel();
return array($model->alias => $this->Session->read($this->sessionKey));
} else {
$user = $this->Session->read($this->sessionKey);
if (isset($user[$key])) {
return $user[$key];
}
return null;
}
}