File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 5
5
use App \Entity \Contest ;
6
6
use App \Entity \ContestProblem ;
7
7
use App \Entity \Team ;
8
+ use App \Entity \TeamCategory ;
8
9
use App \Service \ConfigurationService ;
9
10
use App \Service \DOMJudgeService ;
10
11
use App \Service \ScoreboardService ;
@@ -41,9 +42,16 @@ public function scoreboardAction(
41
42
#[MapQueryParameter]
42
43
?bool $ static = false ,
43
44
): Response {
44
- $ response = new Response ();
45
- $ refreshUrl = $ this ->generateUrl ('public_index ' );
46
- $ contest = $ this ->dj ->getCurrentContest (onlyPublic: true );
45
+ $ response = new Response ();
46
+ $ refreshUrl = $ this ->generateUrl ('public_index ' );
47
+ $ contest = $ this ->dj ->getCurrentContest (onlyPublic: true );
48
+ $ nonPublicContest = $ this ->dj ->getCurrentContest (onlyPublic: false );
49
+ if (!$ contest && $ nonPublicContest && $ this ->em ->getRepository (TeamCategory::class)->count (['allow_self_registration ' => 1 ])) {
50
+ // This leaks a little bit of information about the existence of the non-public contest,
51
+ // but since self registration is enabled, it's not a big deal.
52
+ return $ this ->redirectToRoute ('register ' );
53
+ }
54
+
47
55
48
56
if ($ static ) {
49
57
$ refreshParams = [
You can’t perform that action at this time.
0 commit comments