/** * @see Action::readParameters() */ public function readParameters() { parent::readParameters(); if (!MODULE_MODERATED_USER_GROUP || !MODULE_PM) { throw new IllegalLinkException(); } if (isset($_POST['groupID'])) { $this->groupID = intval($_POST['groupID']); } $this->group = new Group($this->groupID); if (!$this->group->groupID) { throw new IllegalLinkException(); } // check permission if (!GroupApplicationEditor::isGroupLeader(WCF::getUser(), $this->groupID)) { throw new PermissionDeniedException(); } if (isset($_POST['subject'])) { $this->subject = StringUtil::trim($_POST['subject']); } if (isset($_POST['text'])) { $this->text = StringUtil::trim($_POST['text']); } if (empty($this->subject) || empty($this->text)) { throw new IllegalLinkException(); } }
/** * @see Action::execute() */ public function execute() { AbstractAction::execute(); // check permission if (!GroupApplicationEditor::isGroupLeader(WCF::getUser(), $this->groupID)) { throw new PermissionDeniedException(); } if (MODULE_MODERATED_USER_GROUP != 1) { throw new IllegalLinkException(); } // remove users if (count($this->userIDs)) { $sql = "DELETE FROM\twcf" . WCF_N . "_user_to_groups\n\t\t\t\tWHERE\t\tuserID IN (" . implode(',', $this->userIDs) . ")\n\t\t\t\t\t\tAND groupID = " . $this->groupID; WCF::getDB()->sendQuery($sql); // reset sessions Session::resetSessions($this->userIDs); } $this->executed(); HeaderUtil::redirect('index.php?form=UserGroupAdministrate&groupID=' . $this->groupID . SID_ARG_2ND_NOT_ENCODED); exit; }
/** * @see Page::readParameters() */ public function readParameters() { AbstractForm::readParameters(); // get application if (isset($_REQUEST['applicationID'])) { $this->applicationID = intval($_REQUEST['applicationID']); } $this->application = new GroupApplicationEditor($this->applicationID); if (!$this->application->applicationID) { throw new IllegalLinkException(); } // get group $this->group = new Group($this->application->groupID); $this->groupID = $this->group->groupID; if ($this->application->applicationStatus > 0) { $this->reason = $this->application->reason; } // check permission if (!GroupApplicationEditor::isGroupLeader(WCF::getUser(), $this->application->groupID)) { throw new PermissionDeniedException(); } }
/** * @see Page::show() */ public function show() { // check permission if (!WCF::getUser()->userID || !GroupApplicationEditor::isGroupLeader(WCF::getUser(), $this->groupID)) { throw new PermissionDeniedException(); } if (MODULE_MODERATED_USER_GROUP != 1) { throw new IllegalLinkException(); } // set active tab UserCPMenu::getInstance()->setActiveMenuItem('wcf.user.usercp.menu.link.userGroups'); parent::show(); }