/**
  * Shows the page to the user.
  * @param string $sub: The subpage string argument (if any).
  *  [[Special:HelloWorld/subpage]].
  */
 public function execute($sub)
 {
     $out = $this->getOutput();
     $request = $this->getRequest();
     $user = $this->getUser();
     // Set the page title, robot policies, etc.
     $this->setHeaders();
     // If the user doesn't have the required 'SendToFollowers' permission, display an error
     if (!$user->isAllowed('getinvitationcode')) {
         $out->permissionRequired('getinvitationcode');
         return;
     }
     $out->setPageTitle($this->msg('huijimiddleware-invitationcode'));
     // Is the database locked?
     if (wfReadOnly()) {
         $out->readOnlyPage();
         return false;
     }
     // Blocked through Special:Block? No access for you!
     if ($user->isBlocked()) {
         $out->blockedPage(false);
         return false;
     }
     // Parses message from .i18n.php as wikitext and adds it to the
     // page output.
     $num = $request->getVal('num');
     if ($num == '') {
         $num = 1;
     }
     Invitation::generateInvCode($num);
     $code = Invitation::getInvList($num);
     $out->addHtml($code);
     // $out->addWikiMsg( 'huijimiddleware-helloworld-intro' );
 }