Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security group #896

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@

use Actions\Base as BaseAction;
use Actions\RequirePrivilegeTrait;
use Enum\Presets\Security;
use Enum\ResponseCode;
use Models\Preset;
use Utils\Password;

class EditSubcategories extends BaseAction
{
Expand All @@ -52,10 +54,16 @@ public function save($f3, $params): void
if (isset($categories->{$categoryName})) {
$subCategories = json_decode($categories->{$categoryName});
foreach ($form as $editedSubCategory) {
$subCategoryName = $editedSubCategory['name'];
$subCategoryName = $editedSubCategory['name'];

$subCategoryValue = $editedSubCategory['value'];
if (Security::PASSWORD_FOR_MODERATOR === $subCategoryName || Security::PASSWORD_FOR_ATTENDEE === $subCategoryName) {
$encryption_value = openssl_encrypt($subCategoryValue, Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY);

$subCategories->{$subCategoryName} = $subCategoryValue;
$subCategories->{$subCategoryName} = $encryption_value;
} else {
$subCategories->{$subCategoryName} = $subCategoryValue;
}
}

$categories->{$categoryName} = json_encode($subCategories);
Expand Down
33 changes: 22 additions & 11 deletions bbbeasy-backend/app/src/Actions/Rooms/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
use BigBlueButton\Parameters\GetMeetingInfoParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;
use Enum\Presets\General;
use Enum\Presets\Security;
use Enum\ResponseCode;
use Models\Preset;
use Models\Room;
use Utils\BigBlueButtonRequester;
use Utils\DataUtils;
use Utils\Password;
use Utils\PresetProcessor;

/**
Expand Down Expand Up @@ -71,6 +72,8 @@ public function execute($f3, $params): void
$form = $this->getDecodedBody();

$fullname = (null !== $this->session->get('user') ? $this->session->get('user.username') : $form['fullname']);
$password = $form['password'];

if (null !== $fullname) {
$room = new Room();
$room = $room->getById($id);
Expand All @@ -86,19 +89,19 @@ public function execute($f3, $params): void
if (null === $getMeetingInfoResponse) {
return;
}
$preset = new Preset();
$p = $preset->findById($room->getPresetID($room->id)['preset_id']);
$preset = new Preset();
$p = $preset->findById($room->getPresetID($room->id)['preset_id']);
$presetprocessor = new PresetProcessor();
$presetData = $presetprocessor->preparePresetData($p->getMyPresetInfos($p));

if (!$getMeetingInfoResponse->success()) {
// meeting not found

if ('notFound' === $getMeetingInfoResponse->getMessageKey()) {
// create new meeting with the same meetingId

$presetprocessor = new PresetProcessor();
$presetData = $presetprocessor->preparePresetData($p->getMyPresetInfos($p));

if ($room->getRoomInfos($room)['user_id'] === $this->session->get('user.id') || $presetData[General::GROUP_NAME][General::ANYONE_CAN_START]) {
$createResult = $this->createMeeting($meetingId, $bbbRequester, $room->short_link, $p->getMyPresetInfos($p), $presetprocessor);
$createResult = $this->createMeeting($meetingId, $bbbRequester, $room->short_link, $p->getMyPresetInfos($p), $presetprocessor, $password_moderator, $password_attendee);

if (null === $createResult) {
return;
Expand All @@ -109,7 +112,7 @@ public function execute($f3, $params): void
return;
}
} else {
$this->logger->error('Could not fetch a meeting due to an error.');
$this->logger->error('Could not start or join a meeting');
$this->renderJson(['meeting' => 'Could not start or join the meeting'], ResponseCode::HTTP_INTERNAL_SERVER_ERROR);

return;
Expand All @@ -119,7 +122,17 @@ public function execute($f3, $params): void
if ($room->getRoomInfos($room)['user_id'] === $this->session->get('user.id') || $presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]) {
$this->joinMeeting($meetingId, Role::MODERATOR, $bbbRequester, $p->getMyPresetInfos($p), $fullname);
} else {
$this->joinMeeting($meetingId, Role::VIEWER, $bbbRequester, $p->getMyPresetInfos($p), $fullname);
$password_moderator =$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]?openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY):null;
$password_attendee =$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]?openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY):null;

if ($password === $password_moderator || $password === $password_attendee) {
$this->joinMeeting($meetingId, $password ?: Role::VIEWER, $bbbRequester, $p->getMyPresetInfos($p), $fullname);
} else {
$this->logger->error('Could not join a meeting with a wrong password');
$this->renderJson(['password' => 'Could not join a meeting with a wrong password'], ResponseCode::HTTP_INTERNAL_SERVER_ERROR);

return;
}
}
} else {
$this->logger->error($errorMessage);
Expand Down Expand Up @@ -153,8 +166,6 @@ public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequ
$presetProcessor = new PresetProcessor();
$createParams = new CreateMeetingParameters($meetingId, 'meeting-' . $meetingId);
$createParams = $presetProcessor->toCreateMeetingParams($p, $createParams);
$createParams->setModeratorPassword(DataUtils::generateRandomString());
$createParams->setAttendeePassword(DataUtils::generateRandomString());
// @todo : set later via presets

$createParams->setModeratorOnlyMessage('to invite someone you can use this link ' . $this->f3->get('SERVER.HTTP_ORIGIN') . $this->f3->get('client.room_url_prefix') . $link);
Expand Down
20 changes: 14 additions & 6 deletions bbbeasy-backend/app/src/Actions/Rooms/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Actions\RequirePrivilegeTrait;
use BigBlueButton\Parameters\GetMeetingInfoParameters;
use Enum\Presets\General;
use Enum\Presets\Security;
use Enum\ResponseCode;
use Models\Preset;
use Models\Room;
Expand Down Expand Up @@ -80,15 +81,22 @@ public function show($f3, $params): void
if (!$meetingInfoResponse->success()) {
if ('notFound' === $meetingInfoResponse->getMessageKey()) {
$anyonestart = false;

if ($room->getRoomInfos($room)['user_id'] === $this->session->get('user.id') || $presetData[General::GROUP_NAME][General::ANYONE_CAN_START]) {
$canStart = true;
}
}
if ('checksumError' === $meetingInfoResponse->getMessageKey()) {
$joindisabled = true;
}
}
if ($room->getRoomInfos($room)['user_id'] === $this->session->get('user.id') || $presetData[General::GROUP_NAME][General::ANYONE_CAN_START]) {
$canStart = true;
}

$meeting = (array) $meetingInfoResponse->getRawXml();
$meeting['joinDisabled'] = $joindisabled;
$meeting['canStart'] = $canStart;

$meeting = (array) $meetingInfoResponse->getRawXml();
$meeting['canStart'] = $canStart;
$meeting['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]?:null;
$meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]?:null;
$meeting['all_join_as_moderator'] = $presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR];

$this->renderJson(['room' => $room->getRoomInfos($room), 'meeting' => $meeting]);
} else {
Expand Down
2 changes: 1 addition & 1 deletion bbbeasy-backend/app/src/Data/PresetData.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PresetData

public function setData($category, $subCategory, $value): void
{
if (null !== $value || (\is_string($value) && !empty($value))) {
if (null !== $value) {
$this->data[$category][$subCategory] = $value;
}
}
Expand Down
4 changes: 2 additions & 2 deletions bbbeasy-backend/app/src/Enum/Presets/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class Security extends Enum
public const PASSWORD_FOR_MODERATOR = 'password_for_moderator';
public const PASSWORD_FOR_ATTENDEE = 'password_for_attendee';

public const PASS_FOR_MODERATOR_TYPE = 'bool';
public const PASS_FOR_ATTENDEE_TYPE = 'bool';
public const PASS_FOR_MODERATOR_TYPE = 'password';
public const PASS_FOR_ATTENDEE_TYPE = 'password';
}
32 changes: 32 additions & 0 deletions bbbeasy-backend/app/src/Utils/Password.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

/*
* BBBEasy open source platform - https://riadvice.tn/
*
* Copyright (c) 2022-2023 RIADVICE SUARL and by respective authors (see below).
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Affero General Public License as published by the Free Software
* Foundation; either version 3.0 of the License, or (at your option) any later
* version.
*
* BBBeasy is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License along
* with BBBeasy. If not, see <https://www.gnu.org/licenses/>
*/

namespace Utils;

/**
* @codeCoverageIgnore
*/
class Password
{
public const ENCRYPTION_KEY = 'security_group';
public const CIPHERING_VALUE = 'AES-128-CTR';
}
19 changes: 15 additions & 4 deletions bbbeasy-backend/app/src/Utils/PresetProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use Enum\Presets\Presentation;
use Enum\Presets\Recording;
use Enum\Presets\Screenshare;
use Enum\Presets\Security;
use Enum\Presets\UserExperience;
use Enum\Presets\Webcams;
use Enum\Presets\Whiteboard;
Expand Down Expand Up @@ -75,10 +76,9 @@ public function toCreateMeetingParams($preset, $createParams)
$presetsData->setData(BreakoutRooms::GROUP_NAME, BreakoutRooms::RECORDING, $preparePresetData[BreakoutRooms::GROUP_NAME][BreakoutRooms::RECORDING]);
$presetsData->setData(BreakoutRooms::GROUP_NAME, BreakoutRooms::PRIVATE_CHAT, $preparePresetData[BreakoutRooms::GROUP_NAME][BreakoutRooms::PRIVATE_CHAT]);

$presetsData->setData(General::GROUP_NAME, General::DURATION, $preparePresetData[General::GROUP_NAME][General::DURATION]);

$presetsData->setData(General::GROUP_NAME, General::MAXIMUM_PARTICIPANTS, $preparePresetData[General::GROUP_NAME][General::MAXIMUM_PARTICIPANTS]);
$presetsData->setData(General::GROUP_NAME, General::DURATION, $preparePresetData[General::GROUP_NAME][General::DURATION] ?: null);

$presetsData->setData(General::GROUP_NAME, General::MAXIMUM_PARTICIPANTS, $preparePresetData[General::GROUP_NAME][General::MAXIMUM_PARTICIPANTS] ?: null);
$presetsData->setData(GuestPolicy::GROUP_NAME, GuestPolicy::POLICY, $preparePresetData[GuestPolicy::GROUP_NAME][GuestPolicy::POLICY]);

$presetsData->setData(LearningDashboard::GROUP_NAME, LearningDashboard::CONFIGURABLE, $preparePresetData[LearningDashboard::GROUP_NAME][LearningDashboard::CONFIGURABLE]);
Expand All @@ -96,11 +96,22 @@ public function toCreateMeetingParams($preset, $createParams)
$presetsData->setData(Recording::GROUP_NAME, Recording::AUTO_START, $preparePresetData[Recording::GROUP_NAME][Recording::AUTO_START]);
$presetsData->setData(Recording::GROUP_NAME, Recording::ALLOW_START_STOP, $preparePresetData[Recording::GROUP_NAME][Recording::ALLOW_START_STOP]);
$presetsData->setData(Recording::GROUP_NAME, Recording::RECORD, $preparePresetData[Recording::GROUP_NAME][Recording::RECORD]);

$password_moderator = $preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]?openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY):null;
$password_attendee = $preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]?openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY):null;

$presetsData->setData(Security::GROUP_NAME, Security::PASSWORD_FOR_MODERATOR, $password_moderator);
$presetsData->setData(Security::GROUP_NAME, Security::PASSWORD_FOR_ATTENDEE, $password_attendee);

$presetsData->setData(Screenshare::GROUP_NAME, Screenshare::CONFIGURABLE, $preparePresetData[Screenshare::GROUP_NAME][Screenshare::CONFIGURABLE]);

$presetsData->setData(Webcams::GROUP_NAME, Webcams::VISIBLE_FOR_MODERATOR_ONLY, $preparePresetData[Webcams::GROUP_NAME][Webcams::VISIBLE_FOR_MODERATOR_ONLY]);
$presetsData->setData(Webcams::GROUP_NAME, Webcams::MODERATOR_ALLOWED_CAMERA_EJECT, $preparePresetData[Webcams::GROUP_NAME][Webcams::MODERATOR_ALLOWED_CAMERA_EJECT]);

// Get preset data to create meeting parameters
$createParams->setModeratorPassword($presetsData->getData(Security::GROUP_NAME, Security::PASSWORD_FOR_MODERATOR) ?: DataUtils::generateRandomString());
$createParams->setAttendeePassword($presetsData->getData(Security::GROUP_NAME, Security::PASSWORD_FOR_ATTENDEE) ?: DataUtils::generateRandomString());

$createParams->setMuteOnStart($presetsData->getData(Audio::GROUP_NAME, Audio::USERS_JOIN_MUTED));

$createParams->setAllowModsToUnmuteUsers($presetsData->getData(Audio::GROUP_NAME, Audio::MODERATORS_ALLOWED_TO_UNMUTE_USERS));
Expand Down Expand Up @@ -129,7 +140,7 @@ public function toCreateMeetingParams($preset, $createParams)
// layout: presentation,participants,chat,navigation_bar,actions_bar

$createParams->setLearningDashboardEnabled($presetsData->getData(LearningDashboard::GROUP_NAME, LearningDashboard::CONFIGURABLE));
$createParams->setLearningDashboardCleanupDelayInMinutes($presetsData->getData(LearningDashboard::GROUP_NAME, LearningDashboard::CLEANUP_DELAY));
$createParams->setLearningDashboardCleanupDelayInMinutes($presetsData->getData(LearningDashboard::GROUP_NAME, LearningDashboard::CLEANUP_DELAY) ?: null);

$createParams->setLockSettingsDisableCam($presetsData->getData(LockSettings::GROUP_NAME, LockSettings::WEBCAMS));
$createParams->setLockSettingsDisableMic($presetsData->getData(LockSettings::GROUP_NAME, LockSettings::MICROPHONES));
Expand Down
17 changes: 17 additions & 0 deletions bbbeasy-docs/guides/user-guide/Administration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
sidebar_position: 12
---

# Administration

The administration settings section is related to the registration method of users .The settings are set by default to inactive during the install , then we can modify them depending on the client requirements

**_Edit the administration settings_**

`To Edit the administration settings, you must follow the following steps`

1. Go to the Administration page.
2. Enable or disable the settings then save the changes .
3. The administration settings will be saved.

![Users](/img/administration.png)
42 changes: 42 additions & 0 deletions bbbeasy-docs/guides/user-guide/Labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
sidebar_position: 6
---

# Labels Management

## labels

Labels are used to distinguish the rooms and facilitate rooms identification by using different labels

**_New Label_**

`To create a new label , you must follow the following steps`

1. Go on labels page
2. Click on the New label button
3. Fill the Create Label form and submit the form

![labels](/img/new_labels.png)
![labels](/img/labels.png)

**_Edit Label_**

`To Edit labels ,you must follow the following steps `

1. Go to the labels page
2. Choose a label from the list and click on the edit button
3. Edit the label details then click on save button
4. The changes will be saved successfully

![labels](/img/Edit_labels.png)

**_Delete labels_**

`To delete labels , you must follow the following steps`

1. Go to the labels page
2. Choose a label from the list and click on the delete button
3. Confirm deletion
4. The label will be deleted .

![labels](/img/delete_label.png)
18 changes: 18 additions & 0 deletions bbbeasy-docs/guides/user-guide/Profile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
sidebar_position: 11
---

# User Profile

The profile page includes all your account details(Username,Email,Profile picture).
Also you can edit your profile informations

**_Edit Profile_**

`To Edit your profile informations , just follow these steps`

1. Go to the avatar profile in the right corner, a menu will be appeared , then click on profile
2. Edit your profile information , then enter your current password for confirmation and submit the form
3. your profile will be modified successfully

![profile](/img/profile.png)
40 changes: 40 additions & 0 deletions bbbeasy-docs/guides/user-guide/Recordings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
sidebar_position: 8
---

# Access to Recordings

## Recordings

The recording section represents all the meeting recordings and all the sharing options.

**_Recordings page_**

` To Go the recordings page , you must follow the following steps`

1. Go to the Recordings page.
2. You will find all the recording meetings

![Recordings](/img/save_recordings.png)

**_Edit Recording_**

`To Edit Recording Name , you must follow the following steps`

1. Go to the Recordings page
2. Choose a Recording from the list and click on the edit button
3. Edit the Recording Name then click on the save button
4. The changes will be saved successfully

![Recordings](/img/Edit_Recordings.png)

**_Delete Recording_**

`To delete Recording , you must follow the following steps`

1. Go to the Recordings page
2. Choose a Recording from the list and click on the delete button
3. Confirm deletion
4. The Recording will be deleted .

![Recordings](/img/delete_recordings.png)
Loading