1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-04 18:29:39 +02:00
Oinktube/plugin/Meet/validateMeet.php
2022-03-17 11:43:59 -03:00

36 lines
1.1 KiB
PHP

<?php
$objM = AVideoPlugin::getObjectDataIfEnabled("Meet");
//_error_log(json_encode($_SERVER));
if (empty($objM)) {
die("Plugin disabled");
}
$meet_schedule_id = intval($_GET['meet_schedule_id']);
if (empty($meet_schedule_id)) {
forbiddenPage("meet schedule id cannot be empty");
}
$meet = new Meet_schedule($meet_schedule_id);
if (empty($meet->getCleanName())) {
forbiddenPage("meet not found");
}
$userCredentials = User::loginFromRequestToGet();
$meetDomain = Meet::getDomain();
if (empty($meetDomain)) {
header("Location: {$global['webSiteRootURL']}plugin/Meet/?error=The Server is Not ready");
exit;
}
$canJoin = Meet::canJoinMeetWithReason($meet_schedule_id);
if (!$canJoin->canJoin) {
header("Location: {$global['webSiteRootURL']}plugin/Meet/?error=" . urlencode($canJoin->reason));
exit;
}
if (empty($meet->getPublic()) && !User::isLogged()) {
header("Location: {$global['webSiteRootURL']}user?redirectUri=" . urlencode($meet->getMeetLink()) . "&msg=" . urlencode(__("Please, login before join a meeting")));
exit;
}