タグ

ブックマーク / log.miraoto.com (1)

  • CakePHP2.0のAuthComponent

    1.X系の感じで使おうと思ったら、結構ハマったのでメモ。 Authコンポーネントは、2.0で大きく変わっていた。 1.ログイン処理部分を自作しなければならないこと CakePHP1.X系ではloginのメソッドを用意しておけば他の処理は不要だったのだが、CakePHP2.0からは自前で用意しなければならないらしい <1.0系の時> public function login() {} <2.0系の時> public function login() { if ($this->request->is('post')) { if ($this->Auth->login()) { return $this->redirect($this->Auth->redirect()); } else { $this->Session->setFlash(__('IDがパスワードが違います。'), 'def

    CakePHP2.0のAuthComponent
  • 1