diff --git a/appinfo/app.php b/appinfo/app.php index a5104c1..739a12f 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -1,15 +1,3 @@ getConfig()->getAppValue('bbb', 'api.url'); -$parsedApiUrl = @parse_url($apiUrl); - -if ($parsedApiUrl !== false) { - $manager = \OC::$server->getContentSecurityPolicyManager(); - $policy = new \OCP\AppFramework\Http\EmptyContentSecurityPolicy(); - - $policy->addAllowedFormActionDomain(($parsedApiUrl['scheme'] ?: 'https') . '://' . $parsedApiUrl['host']); - - $manager->addDefaultPolicy($policy); -} diff --git a/lib/Controller/JoinController.php b/lib/Controller/JoinController.php index 23708fb..2738e77 100644 --- a/lib/Controller/JoinController.php +++ b/lib/Controller/JoinController.php @@ -117,26 +117,19 @@ class JoinController extends Controller { 'wrongPassword' => $password !== $room->password && $password !== '', ], 'guest'); - $this->addFormActionDomain($response); - return $response; } $creationDate = $this->api->createMeeting($room, $presentation); $joinUrl = $this->api->createJoinUrl($room, $creationDate, $displayname, $userId); - return new RedirectResponse($joinUrl); - } + \OCP\Util::addHeader('meta', ['http-equiv' => 'refresh', 'content' => '3;url='.$joinUrl]); - private function addFormActionDomain($response) { - $apiUrl = $this->config->getAppValue($this->appName, 'api.url'); - $parsedApiUrl = parse_url($apiUrl); - - if ($parsedApiUrl === false) { - throw new \Exception('No valid api url provided'); - } - - $response->getContentSecurityPolicy()->addAllowedFormActionDomain(($parsedApiUrl['scheme'] ?: 'https') . '://' . $parsedApiUrl['host']); + return new TemplateResponse($this->appName, 'forward', [ + 'room' => $room->name, + 'url' => $joinUrl, + ], 'guest'); + ; } private function getRoom(): ?Room { diff --git a/templates/forward.php b/templates/forward.php new file mode 100644 index 0000000..7bb3dfb --- /dev/null +++ b/templates/forward.php @@ -0,0 +1,12 @@ + + +
t('You will be forwarded to the room in the next few seconds.')); ?>
+
+ t('Let\'s go!')); ?>