Update BBB - Remove interface #3739

pull/3944/head
Julio 5 years ago
parent 1fe3d8bf21
commit 9a0522b6a7
  1. 8
      plugin/bbb/CHANGELOG.md
  2. 8
      plugin/bbb/README.md
  3. 17
      plugin/bbb/lib/bbb.lib.php
  4. 83
      plugin/bbb/lib/bbb_api.php
  5. 30
      plugin/bbb/lib/bbb_plugin.class.php
  6. 2
      plugin/bbb/listing.php
  7. 6
      plugin/bbb/start.php
  8. 87
      plugin/bbb/view/listing.tpl

@ -1,3 +1,11 @@
Version 2.9 - 2021-08
---------------------
* Remove interface option (HTML5/Flash)
Version 2.8 - 2019-07
---------------------
* Add rooms + internal meeting id
Version 2.7 - 2018-07
---------------------
* Add interface option (HTML5 or Flash)

@ -60,12 +60,18 @@ ALTER TABLE plugin_bbb_room MODIFY COLUMN out_at datetime;
```
For version 2.8
```sql
ALTER TABLE plugin_bbb_meeting ADD COLUMN internal_meeting_id VARCHAR(255) DEFAULT NULL;
ALTER TABLE plugin_bbb_room ADD close INT NOT NULL DEFAULT 0;
```
For version 2.9 (Optional, requires an update version of BBB)
```sql
ALTER TABLE plugin_bbb_room DROP COLUMN interface;
ALTER TABLE plugin_bbb_meeting DROP COLUMN interface;
```
## Improve access tracking in BBB
You need to configure the cron using the *cron_close_meeting.php* file.

@ -385,14 +385,6 @@ class bbb
$params['created_at'] = api_get_utc_datetime();
$params['access_url'] = $this->accessUrl;
// Check interface feature is installed
$interfaceFeature = $this->plugin->get('interface');
if ($interfaceFeature === false) {
if (isset($params['interface'])) {
unset($params['interface']);
}
}
$id = Database::insert($this->table, $params);
if ($id) {
@ -446,7 +438,6 @@ class bbb
}
$meeting = $this->joinMeeting($meetingName, true);
return $meeting;
}
}
@ -539,7 +530,6 @@ class bbb
*/
public function joinMeeting($meetingName)
{
if ($this->debug) {
error_log("joinMeeting: $meetingName");
}
@ -753,11 +743,10 @@ class bbb
*
* @param int $meetingId
* @param int $participantId
* @param int $interface
*
* @return false|int The last inserted ID. Otherwise return false
*/
public function saveParticipant($meetingId, $participantId, $interface = 0)
public function saveParticipant($meetingId, $participantId)
{
$meetingData = Database::select(
'*',
@ -802,10 +791,6 @@ class bbb
'close' => BBBPlugin::ROOM_OPEN,
];
if ($this->plugin->get('interface') !== false) {
$params['interface'] = $interface;
}
return Database::insert(
'plugin_bbb_room',
$params

@ -124,23 +124,27 @@ class BigBlueButtonBN
$creationUrl = $this->_bbbServerBaseUrl."api/create?";
// Add params:
$params =
'name='.urlencode($this->_meetingName).
'&meetingID='.urlencode($this->_meetingId).
'&attendeePW='.urlencode($creationParams['attendeePw']).
'&moderatorPW='.urlencode($creationParams['moderatorPw']).
'&dialNumber='.urlencode($creationParams['dialNumber']).
'&voiceBridge='.urlencode($creationParams['voiceBridge']).
'&webVoice='.urlencode($creationParams['webVoice']).
'&logoutURL='.urlencode($creationParams['logoutUrl']).
'&maxParticipants='.urlencode($creationParams['maxParticipants']).
'&record='.urlencode($creationParams['record']).
'&duration='.urlencode($creationParams['duration']);
'name='.urlencode($this->_meetingName).
'&meetingID='.urlencode($this->_meetingId).
'&attendeePW='.urlencode($creationParams['attendeePw']).
'&moderatorPW='.urlencode($creationParams['moderatorPw']).
'&dialNumber='.urlencode($creationParams['dialNumber']).
'&voiceBridge='.urlencode($creationParams['voiceBridge']).
'&webVoice='.urlencode($creationParams['webVoice']).
'&logoutURL='.urlencode($creationParams['logoutUrl']).
'&maxParticipants='.urlencode($creationParams['maxParticipants']).
'&record='.urlencode($creationParams['record']).
'&duration='.urlencode($creationParams['duration'])
;
//'&meta_category='.urlencode($creationParams['meta_category']);
$welcomeMessage = $creationParams['welcomeMsg'];
if(trim($welcomeMessage))
$params .= '&welcome='.urlencode($welcomeMessage);
if (trim($welcomeMessage)) {
$params .= '&welcome='.urlencode($welcomeMessage);
}
// Return the complete URL:
return ( $creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt) );
return ($creationUrl.$params.'&checksum='.sha1("create".$params.$this->_securitySalt));
}
public function createMeetingWithXmlResponseArray($creationParams)
@ -167,7 +171,7 @@ class BigBlueButtonBN
if ($xml) {
if ($xml->meetingID) {
return array(
return [
'returncode' => $xml->returncode->__toString(),
'message' => $xml->message->__toString(),
'messageKey' => $xml->messageKey->__toString(),
@ -176,21 +180,22 @@ class BigBlueButtonBN
'moderatorPw' => $xml->moderatorPW->__toString(),
'hasBeenForciblyEnded' => $xml->hasBeenForciblyEnded->__toString(),
'createTime' => $xml->createTime->__toString(),
'internalMeetingID' => $xml->internalMeetingID->__toString()
);
'internalMeetingID' => $xml->internalMeetingID->__toString(),
];
} else {
return array(
return [
'returncode' => $xml->returncode->__toString(),
'message' => $xml->message->__toString(),
'messageKey' => $xml->messageKey->__toString(),
);
];
}
} else {
return null;
}
}
public function getJoinMeetingURL($joinParams) {
public function getJoinMeetingURL($joinParams)
{
/*
NOTE: At this point, we don't use a corresponding joinMeetingWithXmlResponse here because the API
doesn't respond on success, but you can still code that method if you need it. Or, you can take the URL
@ -208,35 +213,38 @@ class BigBlueButtonBN
$this->_meetingId = $this->_requiredParam($joinParams['meetingId']);
$this->_username = $this->_requiredParam($joinParams['username']);
$this->_password = $this->_requiredParam($joinParams['password']);
// Establish the basic join URL:
$joinUrl = $this->_bbbServerBaseUrl."api/join?";
// Add parameters to the URL:
$params =
'meetingID='.urlencode($this->_meetingId).
'&fullName='.urlencode($this->_username).
'&password='.urlencode($this->_password).
'&userID='.urlencode($joinParams['userID']).
'&webVoiceConf='.urlencode($joinParams['webVoiceConf']);
'meetingID='.urlencode($this->_meetingId).
'&fullName='.urlencode($this->_username).
'&password='.urlencode($this->_password).
'&userID='.urlencode($joinParams['userID']).
'&webVoiceConf='.urlencode($joinParams['webVoiceConf'])
;
// Only use createTime if we really want to use it. If it's '', then don't pass it:
if (((isset($joinParams['createTime'])) && ($joinParams['createTime'] != ''))) {
if ((isset($joinParams['createTime']) && $joinParams['createTime'] != '')) {
$params .= '&createTime='.urlencode($joinParams['createTime']);
}
if (isset($joinParams['interface']) && (int) $joinParams['interface'] === BBBPlugin::INTERFACE_HTML5) {
/*if (isset($joinParams['interface']) && (int) $joinParams['interface'] === BBBPlugin::INTERFACE_HTML5) {
$bbbHost = api_remove_trailing_slash(CONFIG_SERVER_URL_WITH_PROTOCOL);
if (preg_match('#/bigbluebutton$#', $bbbHost)) {
$bbbHost = preg_replace('#/bigbluebutton$#', '', $bbbHost);
}
$params .= '&redirectClient=true&clientURL='.$bbbHost.'/html5client/join';
}
}*/
// Return the URL:
$url = $joinUrl.$params.'&checksum='.sha1('join'.$params.$this->_securitySalt);
return $url;
return $joinUrl.$params.'&checksum='.sha1('join'.$params.$this->_securitySalt);
}
public function getEndMeetingURL($endParams) {
public function getEndMeetingURL($endParams)
{
/* USAGE:
$endParams = array (
'meetingId' => '1234', -- REQUIRED - The unique id for the meeting
@ -247,8 +255,10 @@ class BigBlueButtonBN
$this->_password = $this->_requiredParam($endParams['password']);
$endUrl = $this->_bbbServerBaseUrl."api/end?";
$params =
'meetingID='.urlencode($this->_meetingId).
'&password='.urlencode($this->_password);
'meetingID='.urlencode($this->_meetingId).
'&password='.urlencode($this->_password)
;
return ($endUrl.$params.'&checksum='.sha1("end".$params.$this->_securitySalt));
}
@ -279,7 +289,6 @@ class BigBlueButtonBN
-- getMeetings
-- getMeetingInfo
*/
public function getIsMeetingRunningUrl($meetingId) {
/* USAGE:
$meetingId = '1234' -- REQUIRED - The unique id for the meeting
@ -305,7 +314,6 @@ class BigBlueButtonBN
else {
return null;
}
}
public function getGetMeetingsUrl() {
@ -317,7 +325,8 @@ class BigBlueButtonBN
return $getMeetingsUrl;
}
public function getMeetingsWithXmlResponseArray() {
public function getMeetingsWithXmlResponseArray()
{
/* USAGE:
We don't need to pass any parameters with this one, so we just send the query URL off to BBB
and then handle the results that we get in the XML response.

@ -9,18 +9,10 @@
*/
/**
* Class BBBPlugin
* Videoconference plugin with BBB
*/
class BBBPlugin extends Plugin
{
const INTERFACE_FLASH = 0;
const INTERFACE_HTML5 = 1;
const LAUNCH_TYPE_DEFAULT = 0;
const LAUNCH_TYPE_SET_BY_TEACHER = 1;
const LAUNCH_TYPE_SET_BY_STUDENT = 2;
const ROOM_OPEN = 0;
const ROOM_CLOSE = 1;
const ROOM_CHECK = 2;
@ -53,7 +45,7 @@ class BBBPlugin extends Plugin
protected function __construct()
{
parent::__construct(
'2.8.2',
'2.9',
'Julio Montoya, Yannick Warnier, Angel Fernando Quiroz Campos, Jose Angel Ruiz',
[
'tool_enable' => 'boolean',
@ -184,8 +176,7 @@ class BBBPlugin extends Plugin
voice_bridge INT NOT NULL DEFAULT 1,
access_url INT NOT NULL DEFAULT 1,
video_url TEXT NULL,
has_video_m4v TINYINT NOT NULL DEFAULT 0,
interface INT NOT NULL DEFAULT 0
has_video_m4v TINYINT NOT NULL DEFAULT 0
)";
Database::query($sql);
@ -196,7 +187,6 @@ class BBBPlugin extends Plugin
participant_id int(11) NOT NULL,
in_at datetime,
out_at datetime,
interface int NOT NULL DEFAULT 0,
close INT NOT NULL DEFAULT 0
);"
);
@ -375,22 +365,6 @@ class BBBPlugin extends Plugin
}
}
/**
* @param string $conferenceUrl
*
* @return array
*/
public function getHtmlUrl($conferenceUrl)
{
$data = [
'text' => $this->get_lang('EnterConferenceHTML5'),
'url' => $conferenceUrl.'&interface='.self::INTERFACE_HTML5,
'icon' => 'resources/img/64/videoconference_html5.png',
];
return $data;
}
/**
* Set the course setting in all courses
*

@ -460,8 +460,6 @@ $tpl->assign('show_join_button', $showJoinButton);
$tpl->assign('message', $message);
$tpl->assign('form', $formToString);
$tpl->assign('enter_conference_links', $urlList);
$tpl->assign('warning_interface_msg', $warningInterfaceMessage);
$tpl->assign('show_client_options', $showClientOptions);
$content = $tpl->fetch('bbb/view/listing.tpl');

@ -30,7 +30,6 @@ $tpl = new Template($tool_name);
$vmIsEnabled = false;
$host = '';
$salt = '';
$interface = isset($_GET['interface']) ? (int) $_GET['interface'] : 0;
$bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
$conferenceManager = $bbb->isConferenceManager();
@ -40,6 +39,7 @@ if ($bbb->isGlobalConference()) {
api_protect_course_script(true);
}
$message = null;
if ($bbb->pluginEnabled) {
if ($bbb->isServerConfigured()) {
if ($bbb->isServerRunning()) {
@ -69,7 +69,6 @@ if ($bbb->pluginEnabled) {
$meetingParams = [];
$meetingParams['meeting_name'] = $bbb->getCurrentVideoConferenceName();
$meetingParams['interface'] = $interface;
$url = null;
if ($bbb->meetingExists($meetingParams['meeting_name'])) {
$joinUrl = $bbb->joinMeeting($meetingParams['meeting_name']);
@ -84,7 +83,7 @@ if ($bbb->pluginEnabled) {
$meetingInfo = $bbb->findMeetingByName($meetingParams['meeting_name']);
if (!empty($meetingInfo) && $url) {
$bbb->saveParticipant($meetingInfo['id'], api_get_user_id(), $interface);
$bbb->saveParticipant($meetingInfo['id'], api_get_user_id());
$bbb->redirectToBBB($url);
} else {
Display::addFlash(
@ -108,5 +107,6 @@ if ($bbb->pluginEnabled) {
} else {
$message = Display::return_message(get_lang('ServerIsNotConfigured'), 'warning');
}
$tpl->assign('message', $message);
$tpl->display_one_col_template();

@ -15,84 +15,29 @@
<div class ="col-md-12" style="text-align:center">
{{ form }}
{% if show_join_button == true %}
{% if show_client_options %}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default conference">
<div class="panel-body">
<div class="url">
<a class="btn btn-default" href="{{ enter_conference_links.0.url }}">
<img src="{{ enter_conference_links.0.icon }}" /><br>
{{ enter_conference_links.0.text }}
</a>
</div>
<div class="share">
{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}
</div>
<div class="form-inline">
<div class="form-group">
<input id="share_button_flash" type="text"
style="width:300px"
class="form-control" readonly value="{{ conference_url }}&interface=0">
<button onclick="copyTextToClipBoard('share_button_flash');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-default conference">
<div class="panel-body">
<div class="url">
<a class="btn btn-default" href="{{ enter_conference_links.1.url }}">
<img src="{{ enter_conference_links.1.icon }}" /><br>
{{ enter_conference_links.1.text }}
</a>
</div>
<div class="share">
{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}
</div>
<div class="form-inline">
<div class="form-group">
<input id="share_button_html" type="text"
style="width:300px"
class="form-control" readonly value="{{ conference_url }}&interface=1">
<button onclick="copyTextToClipBoard('share_button_html');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
{% else %}
{{ enter_conference_links.0 }}
<br />
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
<div class="well">
<div class="form-inline">
<div class="form-group">
<input id="share_button"
type="text"
style="width:600px"
class="form-control" readonly value="{{ conference_url }}">
<button onclick="copyTextToClipBoard('share_button');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
{{ enter_conference_links.0 }}
<br />
<strong>{{ 'UrlMeetingToShare'| get_plugin_lang('BBBPlugin') }}</strong>
<div class="well">
<div class="form-inline">
<div class="form-group">
<input id="share_button"
type="text"
style="width:600px"
class="form-control" readonly value="{{ conference_url }}">
<button onclick="copyTextToClipBoard('share_button');" class="btn btn-default">
<span class="fa fa-copy"></span> {{ 'CopyTextToClipboard' | get_lang }}
</button>
</div>
</div>
{% endif %}
</div>
<p>
<span id="users_online" class="label label-warning">
{{ 'XUsersOnLine'| get_plugin_lang('BBBPlugin') | format(users_online) }}
</span>
</p>
{{ warning_interface_msg }}
{% if max_users_limit > 0 %}
{% if conference_manager == true %}
<p>{{ 'MaxXUsersWarning' | get_plugin_lang('BBBPlugin') | format(max_users_limit) }}</p>

Loading…
Cancel
Save