}
/**
- * @see wcf\action\IAction::execute()
+ * @see wcf\action\IAction::checkModules()
*/
- public function execute() {
- // check if active user is logged in
- if ($this->loginRequired && !WCF::getUser()->userID) {
- throw new PermissionDeniedException();
- }
+ public function checkModules() {
+ // call checkModules event
+ EventHandler::getInstance()->fireAction($this, 'checkModules');
// check modules
- if (!empty($this->neededModules)) {
- foreach ($this->neededModules as $module) {
- if (!defined($module) || !constant($module)) throw new IllegalLinkException();
+ foreach ($this->neededModules as $module) {
+ if (!defined($module) || !constant($module)) {
+ throw new IllegalLinkException();
}
}
+ }
+
+ /**
+ * @see wcf\action\IAction::checkPermissions()
+ */
+ public function checkPermissions() {
+ // call checkPermissions event
+ EventHandler::getInstance()->fireAction($this, 'checkPermissions');
// check permission
if (!empty($this->neededPermissions)) {
WCF::getSession()->checkPermissions($this->neededPermissions);
}
+ }
+
+ /**
+ * @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
+ $this->checkModules();
+
+ // check permissions
+ $this->checkPermissions();
// call execute event
EventHandler::getInstance()->fireAction($this, 'execute');