ログイン処理

Controller

Controller.phpdownload

public function login(){

	if ($this->request->isPost()) {

		$user = $this->Auth->identify();

		if(!empty($user)){

			$this->Auth->setUser($user);

			return $this->redirect($this->Auth->redirectUrl());
		}

		$this->Flash->error('ユーザー名またはパスワードが間違っています');
	}
}
© 2025 wayday