西小倉事典
mindia › 西小倉事典 › 単語

CakePHPのAuthComponent

西小倉パンデイロ · 2011-02-22 更新 · 履歴(6)
第 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;
        }
    }

履歴

タグ