/**
  * When a user clicks on the Accept Invite Link, this action is called.
  * After this the user should be member of this workspace.
  * Reputation id is 6 for inviter
  *
  *
  */
 public function actionInviteAccept()
 {
     $reputation_id = 6;
     $this->forcePostRequest();
     $space = $this->getSpace();
     // Load Pending Membership
     $membership = $space->getMembership();
     if ($membership == null) {
         throw new HttpException(404, Yii::t('SpaceModule.controllers_SpaceController', 'There is no pending invite!'));
     }
     // Check there are really an Invite
     if ($membership->status == Membership::STATUS_INVITED) {
         $space->addMember(Yii::$app->user->id);
         ReputationHistory::addReputation($membership->originator_user_id, $reputation_id);
     }
     return $this->redirect($space->getUrl());
 }