/**
  * @see Action::execute()
  */
 public function execute()
 {
     parent::execute();
     // check permission
     WCF::getUser()->checkPermission('admin.invitation.canDeleteInvitation');
     // delete invitation
     $this->invitation->delete();
     $this->executed();
     // forward to list page
     HeaderUtil::redirect('index.php?page=InvitationList&deletedInvitationID=' . $this->invitationID . '&packageID=' . PACKAGE_ID . SID_ARG_2ND_NOT_ENCODED);
     exit;
 }
 /**
  * @see Page::readParameters()
  */
 public function readParameters()
 {
     parent::readParameters();
     if (isset($_GET['cancel'])) {
         $invitation = new InvitationEditor(intval($_GET['cancel']));
         if (!$invitation->invitationID) {
             throw new IllegalLinkException();
         }
         if ($invitation->senderID !== WCF::getUser()->userID) {
             throw new PermissionDeniedException();
         }
         if ($invitation->isSealed) {
             throw new NamedUserException(WCF::getLanguage()->get('wcf.user.invitation.error.sealed'));
         }
         $invitation->delete();
         WCF::getTPL()->assign(array('success' => 'cancel', 'invitation' => $invitation));
     } else {
         if (isset($_GET['add'])) {
             $this->emails = $_GET['add'];
             $this->submit();
         }
     }
 }