aboutsummaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
Diffstat (limited to 'view')
-rw-r--r--view/embed.php17
-rw-r--r--view/room.php10
2 files changed, 23 insertions, 4 deletions
diff --git a/view/embed.php b/view/embed.php
index eb7caee..97df148 100644
--- a/view/embed.php
+++ b/view/embed.php
@@ -1,11 +1,24 @@
<?php
$room = $conference->getRoom($_GET['room']);
+
if(!$room->hasEmbed())
throw new NotFoundException('Embedding is not enabled in this room');
-$stream = $room->selectStream(
- $_GET['selection'], $_GET['language']);
+$selection = $_GET['selection'];
+$language = $_GET['language'];
+
+if ($language !== 'native' && $language !== 'stereo') {
+ if (! $room->hasTranslation()) {
+ throw new NotFoundException('Not translated');
+ }
+
+ if (! $room->isValidLanguage($language)) {
+ throw new NotFoundException('Language not found');
+ }
+}
+
+$stream = $room->selectStream($selection, $language);
echo $tpl->render(array(
'page' => 'embed',
diff --git a/view/room.php b/view/room.php
index d586248..d035219 100644
--- a/view/room.php
+++ b/view/room.php
@@ -1,8 +1,14 @@
<?php
$room = $conference->getRoom($_GET['room']);
-$stream = $room->selectStream(
- $_GET['selection'], $_GET['language']);
+$selection = $_GET['selection'];
+$language = $_GET['language'];
+
+if (! $room->isValidLanguage($language)) {
+ throw new NotFoundException('Language not found');
+}
+
+$stream = $room->selectStream($selection, $language);
echo $tpl->render(array(
'page' => 'room',