Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit 35df6f5

Browse files
committed
Disable login when setting a schedule for competition, it will be enabled when it starts
1 parent c053308 commit 35df6f5

File tree

5 files changed

+7
-3
lines changed

5 files changed

+7
-3
lines changed

src/controllers/AdminController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ class="fb--conf--language"
251251
$team = await MultiTeam::genTeam($token->getTeamId()); // TODO: Combine Awaits
252252
$token_status =
253253
<span class="highlighted--red">
254-
{tr('Used by')} {$team->getName()}
254+
{tr('Used by')}&nbsp;{$team->getName()}
255255
</span>;
256256
} else {
257257
$token_status =

src/controllers/IndexController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class="fb-cta cta--yellow">
131131
$next_game_text = tr('Soon');
132132
$countdown = array('--', '--', '--', '--');
133133
} else {
134-
$next_game_text = date(tr('date and time format'), $next_game);
134+
$next_game_text = date('H:i:s T D m/d/y', $next_game);
135135
$game_start = new DateTime();
136136
$game_start->setTimestamp(intval($next_game));
137137
$now = new DateTime('now');

src/controllers/ajax/IndexAjaxController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ protected function getActions(): array<string> {
252252
// Check if login is disabled and this isn't an admin
253253
if (($login->getValue() === '0') &&
254254
($team === null || $team->getAdmin() === false)) {
255-
return Utils::error_response('Login failed', 'login');
255+
return Utils::error_response('Login closed', 'login');
256256
}
257257

258258
// Otherwise let's login any valid attempt

src/models/Control.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class Control extends Model {
7474
self::genResetBases(), // Clear bases log
7575
self::genClearScriptLog(),
7676
Configuration::genUpdate('registration', '0'), // Disable registration
77+
Configuration::genUpdate('login', '1'), // Enable login
7778
);
7879

7980
await \HH\Asio\va(

src/static/js/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ function sendIndexRequest(request_data) {
130130
if (responseData.message === 'Login failed') {
131131
teamLoginFormError();
132132
}
133+
if (responseData.message === 'Login closed') {
134+
window.location.replace("/index.php?page=countdown");
135+
}
133136
if (responseData.message === 'Registration failed') {
134137
teamNameFormError();
135138
teamTokenFormError();

0 commit comments

Comments
 (0)