1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-10-31 14:10:08 +00:00

Disallow direct access

This commit is contained in:
Tim Düsterhus 2012-08-12 20:30:08 +02:00
parent 1108d32ed3
commit f507070d20
5 changed files with 85 additions and 0 deletions

View File

@ -42,6 +42,23 @@ class ChatLeaveAction extends AbstractAction {
*/
public $userData = array();
/**
* shortcut for the active request
* @see wcf\system\request\Request::getRequestObject()
*/
public $request = null;
/**
* Disallows direct access.
*
* @see wcf\page\IPage::__run()
*/
public function __run() {
if (($this->request = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()) === $this) throw new IllegalLinkException();
parent::__run();
}
/**
* @see \wcf\action\IAction::execute()
*/

View File

@ -70,6 +70,23 @@ class ChatForm extends AbstractForm {
*/
public $useTemplate = false;
/**
* shortcut for the active request
* @see wcf\system\request\Request::getRequestObject()
*/
public $request = null;
/**
* Disallows direct access.
*
* @see wcf\page\IPage::__run()
*/
public function __run() {
if (($this->request = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()) === $this) throw new IllegalLinkException();
parent::__run();
}
/**
* @see \wcf\page\IPage::readData()
*/

View File

@ -22,6 +22,23 @@ class ChatCopyrightPage extends AbstractPage {
*/
public $neededPermissions = array('user.chat.canEnter');
/**
* shortcut for the active request
* @see wcf\system\request\Request::getRequestObject()
*/
public $request = null;
/**
* Disallows direct access.
*
* @see wcf\page\IPage::__run()
*/
public function __run() {
if (($this->request = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()) === $this) throw new IllegalLinkException();
parent::__run();
}
/**
* @see \wcf\page\IPage::readParameters()
*/

View File

@ -54,6 +54,23 @@ class ChatMessagePage extends AbstractPage {
*/
public $useTemplate = false;
/**
* shortcut for the active request
* @see wcf\system\request\Request::getRequestObject()
*/
public $request = null;
/**
* Disallows direct access.
*
* @see wcf\page\IPage::__run()
*/
public function __run() {
if (($this->request = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()) === $this) throw new IllegalLinkException();
parent::__run();
}
/**
* @see \wcf\page\Page::readData()
*/

View File

@ -36,6 +36,23 @@ class ChatRefreshRoomListPage extends AbstractPage {
*/
public $useTemplate = false;
/**
* shortcut for the active request
* @see wcf\system\request\Request::getRequestObject()
*/
public $request = null;
/**
* Disallows direct access.
*
* @see wcf\page\IPage::__run()
*/
public function __run() {
if (($this->request = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()) === $this) throw new IllegalLinkException();
parent::__run();
}
/**
* @see \wcf\page\IPage::readData()
*/