Internal: Update from 1.11.x

pull/3544/head
Julio Montoya 4 years ago
parent c560fe95fd
commit 3245a3750e
  1. 9
      public/plugin/bbb/README.md
  2. 14
      public/plugin/bbb/lib/bbb.lib.php
  3. 2
      public/plugin/bbb/lib/bbb_plugin.class.php
  4. 64
      public/plugin/bbb/listing.php
  5. 9
      public/plugin/bbb/start.php
  6. 3
      public/plugin/zoom/endpoint.php
  7. 14
      public/plugin/zoom/lib/ZoomPlugin.php

@ -63,8 +63,15 @@ 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
ALTER TABLE plugin_bbb_room ADD close INT NOT NULL DEFAULT 0;
```
## Improve access tracking in BBB
You need to configure the cron using the *cron_close_meeting.php* file.
# Digital ocean VM
In order to use DigitalOceanVM classes a new package is required:
```
composer requires toin0u/digitalocean
```

@ -1221,7 +1221,7 @@ class bbb
// Update users with in_at y ou_at field equal
$roomTable = Database::get_main_table('plugin_bbb_room');
$conditions['where'] = ['meeting_id=? AND in_at=out_at' => [$id]];
$conditions['where'] = ['meeting_id=? AND in_at=out_at AND close=?' => [$id, BBBPlugin::ROOM_OPEN]];
$roomList = Database::select(
'*',
$roomTable,
@ -1230,11 +1230,13 @@ class bbb
foreach ($roomList as $roomDB) {
$roomId = $roomDB['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE],
['id = ? ' => $roomId]
);
if (!empty($roomId)) {
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE],
['id = ? ' => $roomId]
);
}
}
// Close all meeting rooms with meeting ID

@ -214,7 +214,7 @@ class BBBPlugin extends Plugin
);
$fieldLabel = 'plugin_bbb_course_users_limit';
$fieldType = ExtraField::FIELD_TYPE_INTEGER;
$fieldTitle = 'MaxUsersInConferenceRoom';
$fieldTitle = $this->get_lang('MaxUsersInConferenceRoom');
$fieldDefault = '0';
$extraField = new ExtraField('course');
$fieldId = CourseManager::create_course_extra_field(

@ -6,6 +6,13 @@
* This script initiates a video conference session, calling the BigBlueButton API.
*/
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
// If global setting is used then we delete the course sessions (cidReq/id_session)
if ($isGlobalPerUser || $isGlobal) {
$cidReset = true;
}
require_once __DIR__.'/config.php';
$plugin = BBBPlugin::create();
@ -14,8 +21,6 @@ $roomTable = Database::get_main_table('plugin_bbb_room');
$htmlHeadXtra[] = api_get_js_simple(api_get_path(WEB_PLUGIN_PATH).'bbb/resources/utils.js');
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
$action = isset($_GET['action']) ? $_GET['action'] : '';
$userId = api_get_user_id();
@ -212,11 +217,13 @@ if ($conferenceManager) {
if (!empty($roomData)) {
$roomId = $roomData['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
if (!empty($roomId)) {
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
}
}
$i++;
}
@ -239,11 +246,13 @@ if ($conferenceManager) {
if (!empty($roomData)) {
$roomId = $roomData['id'];
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE],
['id = ? ' => $roomId]
);
if (!empty($roomId)) {
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE],
['id = ? ' => $roomId]
);
}
}
$message = Display::return_message(
@ -293,17 +302,19 @@ if ($conferenceManager) {
$i = 0;
foreach ($roomData as $item) {
$roomId = $roomData['id'];
if (0 == $i) {
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime()],
['id = ? ' => $roomId]
);
} else {
Database::update($roomTable, ['close' => BBBPlugin::ROOM_CLOSE], ['id = ? ' => $roomId]);
}
$roomId = $item['id'];
if (!empty($roomId)) {
if ($i == 0) {
Database::update(
$roomTable,
['out_at' => api_get_utc_datetime(), 'close' => BBBPlugin::ROOM_CLOSE],
['id = ? ' => $roomId]
);
} else {
Database::update($roomTable, ['close' => BBBPlugin::ROOM_CLOSE], ['id = ? ' => $roomId]);
}
$i++;
}
}
$message = Display::return_message(
@ -367,6 +378,15 @@ if (false === $bbb->isGlobalConference() &&
if ($conferenceManager) {
$groups = GroupManager::get_groups();
} else {
if (!empty($groupId)) {
$groupInfo = GroupManager::get_group_properties($groupId);
if ($groupInfo) {
$isSubscribed = GroupManager::is_user_in_group(api_get_user_id(), $groupInfo);
if (false === $isSubscribed) {
api_not_allowed(true);
}
}
}
$groups = GroupManager::getAllGroupPerUserSubscription(
api_get_user_id(),
api_get_course_int_id(),

@ -7,6 +7,13 @@
require_once __DIR__.'/../../vendor/autoload.php';
$course_plugin = 'bbb'; //needed in order to load the plugin lang variables
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
// If global setting is used then we delete the course sessions (cidReq/id_session)
if ($isGlobalPerUser || $isGlobal) {
$cidReset = true;
}
require_once __DIR__.'/config.php';
$logInfo = [
@ -20,8 +27,6 @@ $tpl = new Template($tool_name);
$vmIsEnabled = false;
$host = '';
$salt = '';
$isGlobal = isset($_GET['global']) ? true : false;
$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
$interface = isset($_GET['interface']) ? (int) $_GET['interface'] : 0;
$bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);

@ -8,6 +8,7 @@ use Chamilo\PluginBundle\Zoom\MeetingActivity;
use Chamilo\PluginBundle\Zoom\Recording;
use Symfony\Component\HttpFoundation\Response;
require_once __DIR__.'/config.php';
if ('POST' !== $_SERVER['REQUEST_METHOD']) {
http_response_code(Response::HTTP_NOT_FOUND); // Not found
exit;
@ -16,9 +17,9 @@ if ('POST' !== $_SERVER['REQUEST_METHOD']) {
// @todo handle non-apache installations
$authorizationHeaderValue = apache_request_headers()['Authorization'];
require_once __DIR__.'/config.php';
if (api_get_plugin_setting('zoom', 'verificationToken') !== $authorizationHeaderValue) {
error_log('verificationToken not valid, please check your zoom configuration');
http_response_code(Response::HTTP_UNAUTHORIZED);
exit;
}

@ -180,6 +180,20 @@ class ZoomPlugin extends Plugin
*/
public function install()
{
$schemaManager = Database::getManager()->getConnection()->getSchemaManager();
$tablesExists = $schemaManager->tablesExist(
[
'plugin_zoom_meeting',
'plugin_zoom_meeting_activity',
'plugin_zoom_recording',
'plugin_zoom_registrant',
]
);
if ($tablesExists) {
return;
}
(new SchemaTool(Database::getManager()))->createSchema(
[
Database::getManager()->getClassMetadata(Meeting::class),

Loading…
Cancel
Save