public function __construct() { parent::__construct(); if (!(new Framework\Security\CSRF\Token())->check('cache')) { exit(jsonMsg(0, Form::errorTokenMsg())); } $this->clearCache(); }
public function __construct() { parent::__construct(); if (!(new Framework\Security\CSRF\Token())->check('friend')) { exit(jsonMsg(0, Form::errorTokenMsg())); } $this->_oFriendModel = new FriendModel(); switch ($this->httpRequest->post('type')) { case 'add': $this->add(); break; case 'approval': $this->approval(); break; case 'delete': $this->delete(); break; default: Framework\Http\Http::setHeadersByCode(400); exit('Bad Request Error!'); } }