aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.php3
-rw-r--r--view/program-json.php4
2 files changed, 4 insertions, 3 deletions
diff --git a/index.php b/index.php
index 004716e..43fb9ce 100644
--- a/index.php
+++ b/index.php
@@ -46,9 +46,6 @@ try {
else if(preg_match('@^program.json$@', $route, $m))
{
- if(!has('SCHEDULE'))
- return include('view/404.php');
-
include('view/program-json.php');
}
diff --git a/view/program-json.php b/view/program-json.php
index 4cce716..08f4289 100644
--- a/view/program-json.php
+++ b/view/program-json.php
@@ -1,4 +1,8 @@
<?php
+$schedule = new Schedule();
+if(!$schedule->isEnabled())
+ throw new NotFoundException('Schedule is disabled');
+
header('Content-Type: application/json');
echo json_encode(program());