use wcf\util\JSON;
use wcf\util\StringUtil;
+/**
+ * Default implementation for AJAX-based method calls.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage action
+ * @category Community Framework
+ */
class AJAXInvokeAction extends AbstractSecureAction {
/**
* method name
*/
protected function invoke() {
// check for interface and inheritance of SingletonFactory
- if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
+ if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\IAJAXInvokeAction')) {
+ throw new SystemException("'".$this->className."' should implement 'wcf\system\IAJAXInvokeAction'");
+ }
+ else if (!ClassUtil::isInstanceOf($this->className, 'wcf\system\SingletonFactory')) {
throw new SystemException("'".$this->className."' should extend 'wcf\system\SingletonFactory'");
}
--- /dev/null
+<?php
+namespace wcf\system;
+
+/**
+ * Default interface for AJAX-based method calls.
+ *
+ * You SHOULD NOT implement this interface in generic classes, as each method is entirely
+ * responsible to verify parameters and permissions. Implementing this class in generic
+ * classes leads to a potential breach of security and unforseen side-effects.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2012 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system
+ * @category Community Framework
+ */
+interface IAJAXInvokeAction { }