/**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_REQUEST['groupID'])) {
         $this->groupID = intval($_REQUEST['groupID']);
     }
     $this->group = new Group($this->groupID);
     if (!$this->group->groupID || $this->group->groupType != 6 && $this->group->groupType != 7) {
         throw new IllegalLinkException();
     }
     // check if an application for this group already exist
     if (GroupApplicationEditor::getApplication(WCF::getUser()->userID, $this->group->groupID)) {
         throw new IllegalLinkException();
     }
 }
 /**
  * @see Action::execute()
  */
 public function execute()
 {
     AbstractAction::execute();
     // check permission
     if (!WCF::getUser()->userID || $this->group->groupType != 5 && $this->group->groupType != 6 || !in_array($this->group->groupID, WCF::getUser()->getGroupIDs())) {
         throw new PermissionDeniedException();
     }
     if (MODULE_MODERATED_USER_GROUP != 1) {
         throw new IllegalLinkException();
     }
     // remove user
     $editor = WCF::getUser()->getEditor();
     $editor->removeFromGroup($this->group->groupID);
     // reset session
     WCF::getSession()->resetUserData();
     // delete application if existing
     if ($application = GroupApplicationEditor::getApplication(WCF::getUser()->userID, $this->group->groupID)) {
         $application->delete();
     }
     $this->executed();
     HeaderUtil::redirect('index.php?page=UserGroups' . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }