* @category Community Framework
*/
abstract class AbstractAction implements IAction {
+ /**
+ * indicates if you need to be logged in to execute this action
+ * @var boolean
+ */
+ public $loginRequired = false;
+
/**
* needed modules to execute this action
* @var array<string>
* @see wcf\action\IAction::execute()
*/
public function execute() {
+ // check if active user is logged in
+ if ($this->loginRequired && !WCF::getUser()->userID) {
+ throw new PermissionDeniedException();
+ }
+
// check modules
if (count($this->neededModules)) {
foreach ($this->neededModules as $module) {
*/
public $action = '';
+ /**
+ * indicates if you need to be logged in to access this page
+ * @var boolean
+ */
+ public $loginRequired = false;
+
/**
* needed modules to view this page
* @var array<string>
* @see wcf\page\IPage::show()
*/
public function show() {
+ // check if active user is logged in
+ if ($this->loginRequired && !WCF::getUser()->userID) {
+ throw new PermissionDeniedException();
+ }
+
// check modules
$this->checkModules();