if (bbb_session_running($_GET['meeting_id']) == false) { $mod_pw = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s", $_GET['meeting_id'])->mod_pw; create_meeting($_GET['title'], $_GET['meeting_id'], $mod_pw, $_GET['att_pw'], $_GET['record']); } if (isset($_GET['mod_pw'])) { header('Location: ' . bbb_join_moderator($_GET['meeting_id'], $_GET['mod_pw'], $_GET['att_pw'], $_SESSION['surname'], $_SESSION['givenname'])); } else { # Get session capacity $c = Database::get()->querySingle("SELECT sessionUsers FROM bbb_session where meeting_id=?s", $_GET['meeting_id']); $sess = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s", $_GET['meeting_id']); $serv = Database::get()->querySingle("SELECT * FROM bbb_servers WHERE id=?d", $sess->running_at); if ($c->sessionUsers > 0 && $c->sessionUsers < get_meeting_users($serv->server_key, $serv->api_url, $_GET['meeting_id'], $sess->mod_pw)) { $tool_content .= "<p class='noteit'><b>{$langNote}</b>:<br />{$langBBBMaxUsersJoinError}</p>"; break; } else { header('Location: ' . bbb_join_user($_GET['meeting_id'], $_GET['att_pw'], $_SESSION['surname'], $_SESSION['givenname'])); } } break; case 'import_video': publish_video_recordings($course_code, $_GET['id']); break; } } elseif (isset($_POST['new_bbb_session'])) { $startDate_obj = DateTime::createFromFormat('d-m-Y H:i', $_POST['start_session']); $start = $startDate_obj->format('Y-m-d H:i:s'); add_bbb_session($course_id, $_POST['title'], $_POST['desc'], $start, $_POST['type'], $_POST['status'], isset($_POST['notifyUsers']) ? '1' : '0', $_POST['minutes_before'], $_POST['external_users'], $_POST['record'], $_POST['sessionUsers']); Session::Messages($langBBBAddSuccessful, 'alert-success'); redirect_to_home_page("modules/bbb/index.php?course={$course_code}"); } else { bbb_session_details();
$title = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->title; $att_pw = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->att_pw; $record = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->record; $start_date = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->start_date; $active = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->active; $unlock_interval = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->unlock_interval; $r_group = explode(",",Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id'])->external_users); if ($active<>'1' || date_diff_in_minutes($start_date,date('Y-m-d H:i:s'))> $unlock_interval || date_diff_in_minutes(date('Y-m-d H:i:s'),$start_date) > 1440 || get_total_bbb_servers()=='0' || !in_array($_GET['username'],$r_group)) { echo $langBBBNoteEnableJoin; exit; } if(bbb_session_running($_GET['meeting_id']) == false) { //echo $title; create_meeting($title,$_GET['meeting_id'],$mod_pw,$att_pw,$record); } # Get session capacity $c = Database::get()->querySingle("SELECT sessionUsers FROM bbb_session where meeting_id=?s",$_GET['meeting_id']); $sess = Database::get()->querySingle("SELECT * FROM bbb_session WHERE meeting_id=?s",$_GET['meeting_id']); $serv = Database::get()->querySingle("SELECT * FROM bbb_servers WHERE id=?d", $sess->running_at); if( ($c->sessionUsers > 0) && ($c->sessionUsers < get_meeting_users($serv->server_key,$serv->api_url,$_GET['meeting_id'],$sess->mod_pw))) { $tool_content .= "<div class='alert alert-warning'>$langBBBMaxUsersJoinError</div>"; } else { header('Location: ' . bbb_join_user($_GET['meeting_id'],$att_pw,$_GET['username'],"")); }