@@ -79,6 +79,9 @@ public function __construct(){
7979 $ this ->addBeforeFilter ('deleteInvitation ' ,'check_delete_invitation ' ,function () use ($ this_var ){
8080 return $ this_var ->checkCCLAdmin ();
8181 });
82+ $ this ->addBeforeFilter ('resendInvitation ' ,'check_resend_invitation ' ,function () use ($ this_var ){
83+ return $ this_var ->checkCCLAdmin ();
84+ });
8285 }
8386
8487 /**
@@ -119,6 +122,7 @@ protected function authorize()
119122 'POST teams ' => 'addTeam ' ,
120123 'DELETE teams/$TEAM_ID ' => 'deleteTeam ' ,
121124 'PUT teams/$TEAM_ID ' => 'updateTeamName ' ,
125+ 'PUT invitations/$ID ' => 'resendInvitation ' ,
122126 );
123127
124128 /**
@@ -134,6 +138,7 @@ protected function authorize()
134138 'addTeam ' ,
135139 'deleteTeam ' ,
136140 'updateTeamName ' ,
141+ 'resendInvitation ' ,
137142 );
138143
139144 public function addInvitation (){
@@ -165,6 +170,28 @@ public function addInvitation(){
165170 if (!$ data ) return $ this ->serverError ();
166171 }
167172
173+ public function resendInvitation (){
174+ $ id = (int )$ this ->request ->param ('ID ' );
175+
176+ try {
177+ $ invitation = $ this ->team_manager ->resendInvitation ($ id , new TeamInvitationEmailSender ());
178+ return $ this ->created (date ('M jS Y ' , strtotime ($ invitation ->Created )));
179+ }
180+ catch (NotFoundEntityException $ ex1 ){
181+ SS_Log::log ($ ex1 ,SS_Log::NOTICE );
182+ return $ this ->notFound ($ ex1 ->getMessage ());
183+ }
184+ catch (TeamMemberAlreadyExistsException $ ex3 ){
185+ SS_Log::log ($ ex3 ,SS_Log::NOTICE );
186+ return $ this ->validationError (array ( array ('attribute ' =>'error ' , 'message ' => $ ex3 ->getMessage ())));
187+ }
188+ catch (Exception $ ex ){
189+ SS_Log::log ($ ex ,SS_Log::ERR );
190+ return $ this ->serverError ();
191+ }
192+ if (!$ data ) return $ this ->serverError ();
193+ }
194+
168195 public function resignMembership (){
169196
170197 $ id = (int )$ this ->request ->param ('ID ' );
0 commit comments