public function SendInvite($InvitationID = '', $PostBackKey = '')
 {
     $this->Permission('Garden.SignIn.Allow');
     $InvitationModel = new InvitationModel();
     $Session = Gdn::Session();
     if ($Session->ValidateTransientKey($PostBackKey)) {
         try {
             $Email = new Gdn_Email();
             $InvitationModel->Send($InvitationID, $Email);
         } catch (Exception $ex) {
             $this->Form->AddError(strip_tags($ex->getMessage()));
         }
         if ($this->Form->ErrorCount() == 0) {
             $this->StatusMessage = T('The invitation was sent successfully.');
         }
     }
     $this->View = 'Invitations';
     $this->Invitations();
 }
예제 #2
0
 /**
  * Let user send an invitation.
  *
  * @since 2.0.0
  * @access public
  * @param int $InvitationID Unique identifier.
  */
 public function SendInvite($InvitationID = '')
 {
     if (!$this->Form->AuthenticatedPostBack()) {
         throw ForbiddenException('GET');
     }
     $this->Permission('Garden.SignIn.Allow');
     $InvitationModel = new InvitationModel();
     $Session = Gdn::Session();
     try {
         $Email = new Gdn_Email();
         $InvitationModel->Send($InvitationID, $Email);
     } catch (Exception $ex) {
         $this->Form->AddError(strip_tags($ex->getMessage()));
     }
     if ($this->Form->ErrorCount() == 0) {
         $this->InformMessage(T('The invitation was sent successfully.'));
     }
     $this->View = 'Invitations';
     $this->Invitations();
 }