LoginSignup
0
0

More than 5 years have passed since last update.

CakePHPのSecurity->blackHoleCallBackの設定の基本

Last updated at Posted at 2016-09-10
public function beforeFilter(){
        $this->Security->blackHoleCallback = 'blackhole';
        parent::beforeFilter();
    }
public function blackhole($type){
        switch($type){
            case 'csrf' :
                $this->Session->setFlash(__('不正な送信が行われました'));
                $this->redirect(array('controller' => 'topics', 'action' => $this->action));
                break;
            default :
                $this->redirect(array('controller' => 'topics', 'action' => 'index'));
                break;
        }
    }

参考:http://junichi11.com/?p=1555

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0