while ($row = mssql_fetch_array($rs, MSSQL_ASSOC)) { $moderator[] = $row["PERSONAL_FNAME_THA"] . " " . $row["PERSONAL_LNAME_THA"]; } $moderator = join(", ", $moderator); $sql = "select user_name from room_user_moderator where room_id = " . $room_id; $rs = mssql_query($sql); $room_user_moderator = array(); while ($row = mssql_fetch_array($rs, MSSQL_ASSOC)) { $room_user_moderator[] = $row["user_name"]; } mssql_close($conn); // BigBlueButton $bbb = new BigBlueButton(); $infoParams = array('meetingId' => $room_id, 'password' => 'mp'); $room_status = false; $result = $bbb->getMeetingInfoWithXmlResponseArray($infoParams); if (!isset($result['messageKey'])) { $room_status = true; } $room_is_running = $bbb->isMeetingRunningWithXmlResponseArray($room_id); ?> <!DOCTYPE html> <!-- Template Name: Clip-One - Responsive Admin Template build with Twitter Bootstrap 3.x Version: 1.3 Author: ClipTheme --> <!--[if IE 8]><html class="ie8 no-js" lang="en"><![endif]--> <!--[if IE 9]><html class="ie9 no-js" lang="en"><![endif]--> <!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]--> <!-- start: HEAD --> <head> <title>ห้องประชุมเสมือน</title>
$tpl = $modx->getOption('tpl', $scriptProperties, null, true); $id_meeting = $modx->getOption('id_meeting', $scriptProperties, null, true); $moderatorPw = $modx->getOption('moderatorPw', $scriptProperties, null, true); if ($meeting = $modx->getObject('Meetings', array('id_meeting' => $id_meeting))) { if ($meeting->get('moderatorPw') != $moderatorPw) { $modx->log(xPDO::LOG_LEVEL_ERROR, 'Ошибка! Указан неверный пароль модератора для встречи'); return '*'; return false; } return '#'; require_once $include_path . 'bbb-api.php'; //Подключаем api BigBlueButton $bbb_server = new BigBlueButton(); $itsAllGood = true; try { $answer = $bbb_server->getMeetingInfoWithXmlResponseArray(array('meetingId' => $id_meeting, 'password' => $moderatorPw)); } catch (Exception $e) { $modx->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage()); $itsAllGood = false; return false; } if ($itsAllGood == true) { if ($answer == null) { // Если в ответ получен null, то возможно не откликается сервер BBB $modx->log(xPDO::LOG_LEVEL_ERROR, 'Не получен никакой ответ от сервера BBB в ответ на getMeetingInfoWithXmlResponseArray, Возможно, нет соединения с сервером BBB '); return false; } else { // We got an XML response, so let's see what it says: if (!isset($answer['messageKey'])) { $modx->log(xPDO::LOG_LEVEL_ERROR, 'Встреча с такими параметрами не найдена на сервере BBB (idmeeting=' . $id_meeting . ')'); return false;
/** * @brief get number of meeting users * @global type $langBBBGetUsersError * @global type $langBBBConnectionError * @param type $salt * @param type $bbb_url * @param type $meeting_id * @param type $pw * @return type */ function get_meeting_users($salt,$bbb_url,$meeting_id,$pw) { global $langBBBGetUsersError, $langBBBConnectionError; // Instatiate the BBB class: $bbb = new BigBlueButton($salt,$bbb_url); $infoParams = array( 'meetingId' => $meeting_id, // REQUIRED - We have to know which meeting. 'password' => $pw, // REQUIRED - Must match moderator pass for meeting. ); // Now get meeting info and display it: $result = $bbb->getMeetingInfoWithXmlResponseArray($bbb,$bbb_url,$salt,$infoParams); // If it's all good, then we've interfaced with our BBB php api OK: if ($result == null) { // If we get a null response, then we're not getting any XML back from BBB. echo "<div class='alert-danger'>$langBBBConnectionError</div>"; } else { // We got an XML response, so let's see what it says: if (!isset($result['messageKey'])) { } else { echo "<div class='alert alert-danger'>$langBBBGetUsersError.</div>"; exit; } } return (int)$result['participantCount']; }