Skip to content

Commit

Permalink
Added override code for live streams or admin
Browse files Browse the repository at this point in the history
  • Loading branch information
almostengr committed Dec 24, 2023
1 parent 5f936f9 commit f5276c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions website/config.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
define('FRIDAY_CODE', '');
define('SATURDAY_CODE', '');
define('SUNDAY_CODE', '');
define('OVERRIDE_CODE', '');
6 changes: 4 additions & 2 deletions website/theme/jukeboxapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ public function getCodeForToday(): string
public function validateCode(): void
{
$validCodeForToday = strtoupper(trim($this->getCodeForToday()));
if ($this->code !== $validCodeForToday) {
throw new Exception("Invalid code. Please listen to the show announcement for the code.", 400);
if ($this->code === $validCodeForToday || $this->code === OVERRIDE_CODE) {
return;
}

throw new Exception("Invalid code. Please listen to the show announcement for the code.", 400);
}

public function validateRequestNotAlreadyInQueue(): void
Expand Down

0 comments on commit f5276c7

Please sign in to comment.