File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,7 @@ public function actionReject($id)
357357 if ($ tp ->player_id !==Yii::$ app ->user ->id && $ tp ->team_id !==Yii::$ app ->user ->identity ->teamLeader ->id )
358358 {
359359 Yii::$ app ->session ->setFlash ('error ' , \Yii::t ('app ' ,'You have no permission to cancel this membership. ' ));
360- return $ this ->redirect (['view ' , ' token ' => $ token ]);
360+ return $ this ->redirect (['index ' ]);
361361 }
362362
363363 if ($ tp ->delete ()===false )
@@ -371,8 +371,8 @@ public function actionReject($id)
371371 if (Yii::$ app ->user ->identity ->teamLeader )
372372 {
373373 $ this ->delete_with_extras ();
374- $ redir =['index ' ];
375374 }
375+ $ redir =['index ' ];
376376 Yii::$ app ->db ->createCommand ("CALL repopulate_team_stream(:tid) " )->bindValue (':tid ' ,$ tp ->team_id )->execute ();
377377 Yii::$ app ->session ->setFlash ('success ' , \Yii::t ('app ' ,'Your membership has been withdrawn. ' ));
378378 }
Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ public function notifyPartOwner()
107107
108108 public function notifyRejectPlayer ()
109109 {
110+ // Don't notify the players for deleting their own team
111+ if ($ this ->player_id ===$ this ->team ->owner_id ) return ;
110112 $ msg =\Yii::t ('app ' ,'Hi there, your team membership got rejected. Find another team to join. ' );
111113 return $ this ->sendNotification ($ this ->player_id ,$ msg );
112114 }
You can’t perform that action at this time.
0 commit comments