From acf430fc7f3f0a3280dc16f907bb3928a3075133 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Tue, 29 Aug 2023 14:18:19 +0100 Subject: [PATCH 01/10] apply security group to join & create --- .../src/Actions/Presets/EditSubcategories.php | 2 + .../app/src/Actions/Rooms/Start.php | 52 ++++++++--- .../app/src/Actions/Rooms/View.php | 4 + .../app/src/Enum/Presets/Security.php | 4 +- .../app/src/Utils/PresetProcessor.php | 8 ++ bbbeasy-frontend/src/components/Presets.tsx | 8 +- .../src/components/RoomDetails.tsx | 91 +++++++++++++++++-- .../src/components/auth/ResetPassword.tsx | 3 +- bbbeasy-frontend/src/locale/ar-TN.json | 10 ++ bbbeasy-frontend/src/locale/en-US.json | 9 ++ bbbeasy-frontend/src/locale/fr-FR.json | 10 +- .../src/services/rooms.service.ts | 4 +- 12 files changed, 178 insertions(+), 27 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php b/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php index 9be80af6..b0202c40 100644 --- a/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php +++ b/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php @@ -24,6 +24,7 @@ use Actions\Base as BaseAction; use Actions\RequirePrivilegeTrait; +use Enum\Presets\Security; use Enum\ResponseCode; use Models\Preset; @@ -53,6 +54,7 @@ public function save($f3, $params): void $subCategories = json_decode($categories->{$categoryName}); foreach ($form as $editedSubCategory) { $subCategoryName = $editedSubCategory['name']; + $subCategoryValue = $editedSubCategory['value']; $subCategories->{$subCategoryName} = $subCategoryValue; diff --git a/bbbeasy-backend/app/src/Actions/Rooms/Start.php b/bbbeasy-backend/app/src/Actions/Rooms/Start.php index 94d26132..fd4156d0 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/Start.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/Start.php @@ -29,6 +29,7 @@ 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; @@ -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); @@ -88,17 +91,19 @@ public function execute($f3, $params): void } $preset = new Preset(); $p = $preset->findById($room->getPresetID($room->id)['preset_id']); - + $presetprocessor = new PresetProcessor(); + $presetData = $presetprocessor->preparePresetData($p->getMyPresetInfos($p)); + // var_dump($presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]); 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; @@ -109,7 +114,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; @@ -117,10 +122,29 @@ 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); - } + /* var_dump($password); + die;*/ + + if($password == $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE] || $password== $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]){ + /* var_dump($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); + var_dump(password_hash($password, PASSWORD_BCRYPT) == $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); + die;*/ + + /* var_dump($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); + die;*/ + + $this->joinMeeting($meetingId, $password?$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); $this->renderJson([], ResponseCode::HTTP_NOT_FOUND); @@ -148,13 +172,14 @@ public function getMeetingInfo(string $meetingId, BigBlueButtonRequester $bbbReq return $meetingInfoResponse; } - public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequester, $link, $p, $preetprocessor) + public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequester, $link, $p, $preetprocessor ) { $presetProcessor = new PresetProcessor(); $createParams = new CreateMeetingParameters($meetingId, 'meeting-' . $meetingId); $createParams = $presetProcessor->toCreateMeetingParams($p, $createParams); - $createParams->setModeratorPassword(DataUtils::generateRandomString()); - $createParams->setAttendeePassword(DataUtils::generateRandomString()); + // $createParams->setModeratorPassword("1234567890"); + // $createParams->setAttendeePassword($password_attendee?$password_attendee:DataUtils::generateRandomString()); + // $createParams->setAttendeePassword("123456789"); // @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); @@ -181,7 +206,12 @@ public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequ public function joinMeeting(string $meetingId, string $role, BigBlueButtonRequester $bbbRequester, $p, $fullname): void { - $joinParams = new JoinMeetingParameters($meetingId, $fullname, $role); + /* var_dump($role); + var_dump($fullname);*/ + /* var_dump($meetingId);*/ + // die; + + $joinParams = new JoinMeetingParameters($meetingId, $fullname,$role); $presetProcessor = new PresetProcessor(); $joinParams = $presetProcessor->toJoinParameters($p, $joinParams); diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index 644a3b05..00ebd63f 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -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; @@ -89,6 +90,9 @@ public function show($f3, $params): void $meeting = (array) $meetingInfoResponse->getRawXml(); $meeting['canStart'] = $canStart; + $meeting['password_moderator']=$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; + $meeting['password_attendee']=$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; + $meeting['all_join_as_moderator']=$presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]; $this->renderJson(['room' => $room->getRoomInfos($room), 'meeting' => $meeting]); } else { diff --git a/bbbeasy-backend/app/src/Enum/Presets/Security.php b/bbbeasy-backend/app/src/Enum/Presets/Security.php index 3d699d48..162eb7e4 100644 --- a/bbbeasy-backend/app/src/Enum/Presets/Security.php +++ b/bbbeasy-backend/app/src/Enum/Presets/Security.php @@ -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'; } diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index 1aeb210b..c661a571 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -33,6 +33,7 @@ use Enum\Presets\LockSettings; use Enum\Presets\Presentation; use Enum\Presets\Recording; +use Enum\Presets\Security; use Enum\Presets\Webcams; class PresetProcessor @@ -93,10 +94,17 @@ public function toCreateMeetingParams($preset, $createParams) $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]); + $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR,($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR])); + $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE, $preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE] ); + + $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)?$presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR):DataUtils::generateRandomString()); + $createParams->setAttendeePassword($presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE)?$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)); diff --git a/bbbeasy-frontend/src/components/Presets.tsx b/bbbeasy-frontend/src/components/Presets.tsx index 3ad6c761..a32653b6 100644 --- a/bbbeasy-frontend/src/components/Presets.tsx +++ b/bbbeasy-frontend/src/components/Presets.tsx @@ -19,6 +19,7 @@ import React, { useEffect, useState } from 'react'; import { PageHeader } from '@ant-design/pro-layout'; +import { PasswordInput } from 'antd-password-input-strength'; import { Button, @@ -509,7 +510,12 @@ const PresetsCol: React.FC = ({ }} /> )} - + {item.type === 'password' && ( + { + item.value = event.target.value; + }}/> + + )} {item.type === 'color' && ( { const [isRunning, setIsRunning] = useState(false); const [canStart, setCanStart] = useState(false); const dataContext = React.useContext(DataContext); - + const [errors,setErrors]=React.useState(); const [errorsEdit, setErrorsEdit] = React.useState({}); const [showSocialMedia, setShowSocialMedia] = useState(false); const [showStartButton, setShowStartButton] = useState(true); @@ -101,6 +102,7 @@ const RoomDetails = () => { const [labels, setLabels] = React.useState(); const [presets, setPresets] = React.useState(); const prefixShortLink = '/r/'; + const [meeting,setMeeting]=React.useState(null); const [showRecodingAndPresenttaions, setShowRecodingAndPresenttaions] = React.useState(false); const [open, setOpen] = React.useState(false); const [roomRecordings, setRoomRecordings] = React.useState([]); @@ -128,17 +130,19 @@ const RoomDetails = () => { const startRoom = async () => { try { const values = await startForm.validateFields(); + console.log(values) - RoomsService.start_room(room.id, values.fullname) + RoomsService.start_room(room.id, values.fullname,values.password ) .then((result) => { window.open(result.data, '_self'); }) .catch((error) => { console.log(error.response.data); - Notifications.openNotificationWithIcon( + setErrors(error.response.data) + /*Notifications.openNotificationWithIcon( 'error', t(Object.keys(EN_US).filter((elem) => EN_US[elem] === error.response.data.meeting)) - ); + );*/ }); } catch (errInfo) { console.log('could not start or join the meeting :', errInfo); @@ -180,6 +184,7 @@ const RoomDetails = () => { const room: RoomType = response.data.room; const meeting = response.data.meeting; + setMeeting(meeting) console.log(currentUser?.role); setRoom(response.data.room); if (room != null) { @@ -194,6 +199,7 @@ const RoomDetails = () => { } if (meeting != null) { setCanStart(meeting.canStart); + console.log(meeting) setIsRunning(meeting.running); } @@ -391,6 +397,65 @@ const RoomDetails = () => { ); }; + const showErrors=(errors)=>{ + {errors && ( + EN_US[elem] == errors)} />} + showIcon + /> + )} + } + const renderPasswordModeratorOrAttendee=(errors,user,meeting )=>{ + console.log('meeting',meeting) + console.log("user",user) + console.log("errors",errors) + if(user ==null && !meeting.all_join_as_moderator){ + return ( + EN_US[elem] == errors['password'] + )} + /> + ), + validateStatus: 'error', + })} + rules={[ + { + required: true, + message: , + }, + ]} + > + + + ) + + } + /* else if(user ==null && meeting.password_attendee){ + return ( + , + }, + ]} + > + + + ) + }*/ + } const renderLinkOrUsername = (open) => { if (currentUser != null) { return ( @@ -406,8 +471,8 @@ const RoomDetails = () => { ); } else { return ( -
- {' '} + + { > -
+ ); } }; @@ -491,9 +556,17 @@ const RoomDetails = () => { ))} + ) : null} +
+ {showErrors(errors)} + + {renderPasswordModeratorOrAttendee(errors,currentUser,meeting)} - {renderLinkOrUsername(open)} + +{renderLinkOrUsername(open)} +
+ ) : ( diff --git a/bbbeasy-frontend/src/components/auth/ResetPassword.tsx b/bbbeasy-frontend/src/components/auth/ResetPassword.tsx index 8ef168b9..94da4e62 100644 --- a/bbbeasy-frontend/src/components/auth/ResetPassword.tsx +++ b/bbbeasy-frontend/src/components/auth/ResetPassword.tsx @@ -16,7 +16,8 @@ * with BBBEasy; if not, see . */ import React from 'react'; -import { Link } from 'react-router-dom'; +import +{ Link } from 'react-router-dom'; import AuthService from '../../services/auth.service'; import Notifications from '../Notifications'; diff --git a/bbbeasy-frontend/src/locale/ar-TN.json b/bbbeasy-frontend/src/locale/ar-TN.json index c71d3b0b..f73c76a4 100644 --- a/bbbeasy-frontend/src/locale/ar-TN.json +++ b/bbbeasy-frontend/src/locale/ar-TN.json @@ -46,6 +46,16 @@ "label": "الاسم الكامل", "required": "التسم الكامل مطلوب" }, + "password_moderator":{ + "label":"كلمة المرور للمشرف", + "required":"كلمة المرور للمشرف مطلوبة" + }, + "wrong-password-join-meeting":"تعذر الانضمام إلى اجتماع باستخدام كلمة مرور خاطئة", + + "password_attendee":{ + "label":"كلمة المرور للحضور", + "required":"كلمة المرور للحضور مطلوبة" + }, "empty-fullname": "الرجاء إدخال الاسم الكامل للانضمام إلى الاجتماع", "confirm-password": { "label": "تأكيد كلمة المرور", diff --git a/bbbeasy-frontend/src/locale/en-US.json b/bbbeasy-frontend/src/locale/en-US.json index 89656f00..3ebdf1e8 100644 --- a/bbbeasy-frontend/src/locale/en-US.json +++ b/bbbeasy-frontend/src/locale/en-US.json @@ -46,6 +46,15 @@ "label": "Full name", "required": "Full name is required" }, + "password_moderator":{ + "label":"Password for moderator", + "required":"Password for moderator is required" + }, + "wrong-password-join-meeting":"Could not join a meeting with a wrong password", + "password_attendee":{ + "label":"Password for attendee", + "required":"Password for attendee is required" + }, "empty-fullname": "Could not join a meeting with an empty fullname", "confirm-password": { "label": "Confirm password", diff --git a/bbbeasy-frontend/src/locale/fr-FR.json b/bbbeasy-frontend/src/locale/fr-FR.json index e564f1f8..b47235ac 100644 --- a/bbbeasy-frontend/src/locale/fr-FR.json +++ b/bbbeasy-frontend/src/locale/fr-FR.json @@ -46,7 +46,15 @@ "label": "Nom Complet", "required": "Le Nom complet est obligatoire" }, - + "password_moderator":{ + "label":"Mot de passe du modérateur", + "required":"Le mot de passe du modérateur est obligatoire" + }, + "password_attendee":{ + "label":"Mot de passe du Participant", + "required":"Mot de passe du Participant est obligatoire" + }, + "wrong-password-join-meeting":"Impossible de rejoindre une réunion avec un mot de passe erroné", "empty-fullname": "Veuillez entrer le Nom complet pour rejoindre la réunion", "confirm-password": { "label": "Confirmation du mot de passe", diff --git a/bbbeasy-frontend/src/services/rooms.service.ts b/bbbeasy-frontend/src/services/rooms.service.ts index cd78efe1..040213af 100644 --- a/bbbeasy-frontend/src/services/rooms.service.ts +++ b/bbbeasy-frontend/src/services/rooms.service.ts @@ -40,9 +40,9 @@ class RoomsService { delete_room(id: number) { return axiosInstance.delete(apiRoutes.DELETE_ROOM_URL + id); } - start_room(id: number, fullname) { + start_room(id: number, fullname,password ) { return axiosInstance.post(apiRoutes.START_ROOM_URL + id, { - fullname, + fullname,password }); } getRoomByLink(link: string) { From 7cd419ba5a00e26e47b677837f03742b9f18a103 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Wed, 30 Aug 2023 10:37:32 +0100 Subject: [PATCH 02/10] pass nullable values into bigbluebutton int parameters --- bbbeasy-backend/app/src/Actions/Rooms/Start.php | 2 +- bbbeasy-backend/app/src/Data/PresetData.php | 10 +++++++++- bbbeasy-backend/app/src/Utils/PresetProcessor.php | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Rooms/Start.php b/bbbeasy-backend/app/src/Actions/Rooms/Start.php index 94d26132..98c8cacc 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/Start.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/Start.php @@ -193,4 +193,4 @@ public function joinMeeting(string $meetingId, string $role, BigBlueButtonReques $this->renderJson($bbbRequester->joinMeeting($joinParams)->getUrl()); } -} +} \ No newline at end of file diff --git a/bbbeasy-backend/app/src/Data/PresetData.php b/bbbeasy-backend/app/src/Data/PresetData.php index 351354fb..c8d08dac 100644 --- a/bbbeasy-backend/app/src/Data/PresetData.php +++ b/bbbeasy-backend/app/src/Data/PresetData.php @@ -22,14 +22,22 @@ namespace Data; +use Enum\Presets\General; + class PresetData { private array $data = []; public function setData($category, $subCategory, $value): void { - if (null !== $value || (\is_string($value) && !empty($value))) { + + + if (null !== $value ) { + $this->data[$category][$subCategory] = $value; + + + } } diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index 1aeb210b..b2447705 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -33,6 +33,7 @@ use Enum\Presets\LockSettings; use Enum\Presets\Presentation; use Enum\Presets\Recording; +use Enum\Presets\Security; use Enum\Presets\Webcams; class PresetProcessor @@ -71,9 +72,10 @@ 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::DURATION , $preparePresetData[General::GROUP_NAME][General::DURATION]?:null); - $presetsData->setData(General::GROUP_NAME, General::MAXIMUM_PARTICIPANTS, $preparePresetData[General::GROUP_NAME][General::MAXIMUM_PARTICIPANTS]); + + $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]); @@ -93,10 +95,17 @@ public function toCreateMeetingParams($preset, $createParams) $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]); + $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR,($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR])); + $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE, $preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE] ); + + $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)?$presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR):DataUtils::generateRandomString()); + $createParams->setAttendeePassword($presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE)?$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)); @@ -125,7 +134,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)); From 3f8977d8130649950b784ce51432cf15486b6f81 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Thu, 31 Aug 2023 09:20:07 +0100 Subject: [PATCH 03/10] apply security group to create & join --- .../src/Actions/Presets/EditSubcategories.php | 10 +- .../app/src/Actions/Rooms/Start.php | 55 +++---- .../app/src/Actions/Rooms/View.php | 10 +- bbbeasy-backend/app/src/Utils/Password.php | 32 ++++ .../app/src/Utils/PresetProcessor.php | 11 +- bbbeasy-frontend/src/components/Presets.tsx | 12 +- .../src/components/RoomDetails.tsx | 146 ++++++++++-------- .../src/components/auth/ResetPassword.tsx | 3 +- bbbeasy-frontend/src/locale/ar-TN.json | 14 +- bbbeasy-frontend/src/locale/en-US.json | 14 +- bbbeasy-frontend/src/locale/fr-FR.json | 14 +- .../src/services/rooms.service.ts | 5 +- 12 files changed, 180 insertions(+), 146 deletions(-) create mode 100644 bbbeasy-backend/app/src/Utils/Password.php diff --git a/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php b/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php index b0202c40..801a824f 100644 --- a/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php +++ b/bbbeasy-backend/app/src/Actions/Presets/EditSubcategories.php @@ -27,6 +27,7 @@ use Enum\Presets\Security; use Enum\ResponseCode; use Models\Preset; +use Utils\Password; class EditSubcategories extends BaseAction { @@ -53,11 +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); diff --git a/bbbeasy-backend/app/src/Actions/Rooms/Start.php b/bbbeasy-backend/app/src/Actions/Rooms/Start.php index fd4156d0..0657a6bb 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/Start.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/Start.php @@ -34,7 +34,7 @@ use Models\Preset; use Models\Room; use Utils\BigBlueButtonRequester; -use Utils\DataUtils; +use Utils\Password; use Utils\PresetProcessor; /** @@ -72,7 +72,7 @@ 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'] ; + $password = $form['password']; if (null !== $fullname) { $room = new Room(); @@ -89,21 +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)); - // var_dump($presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]); + if (!$getMeetingInfoResponse->success()) { // meeting not found - if ('notFound' === $getMeetingInfoResponse->getMessageKey()) { // create new meeting with the same meetingId - 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,$password_moderator,$password_attendee); + $createResult = $this->createMeeting($meetingId, $bbbRequester, $room->short_link, $p->getMyPresetInfos($p), $presetprocessor, $password_moderator, $password_attendee); if (null === $createResult) { return; @@ -122,29 +120,20 @@ 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 { - /* var_dump($password); - die;*/ - - if($password == $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE] || $password== $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]){ - /* var_dump($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); - var_dump(password_hash($password, PASSWORD_BCRYPT) == $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); - die;*/ - - /* var_dump($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]); - die;*/ + $password_moderator = openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); + $password_attendee = openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); - $this->joinMeeting($meetingId, $password?$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; - } - } + 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); $this->renderJson([], ResponseCode::HTTP_NOT_FOUND); @@ -172,14 +161,11 @@ public function getMeetingInfo(string $meetingId, BigBlueButtonRequester $bbbReq return $meetingInfoResponse; } - public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequester, $link, $p, $preetprocessor ) + public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequester, $link, $p, $preetprocessor) { $presetProcessor = new PresetProcessor(); $createParams = new CreateMeetingParameters($meetingId, 'meeting-' . $meetingId); $createParams = $presetProcessor->toCreateMeetingParams($p, $createParams); - // $createParams->setModeratorPassword("1234567890"); - // $createParams->setAttendeePassword($password_attendee?$password_attendee:DataUtils::generateRandomString()); - // $createParams->setAttendeePassword("123456789"); // @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); @@ -206,12 +192,7 @@ public function createMeeting(string $meetingId, BigBlueButtonRequester $bbbRequ public function joinMeeting(string $meetingId, string $role, BigBlueButtonRequester $bbbRequester, $p, $fullname): void { - /* var_dump($role); - var_dump($fullname);*/ - /* var_dump($meetingId);*/ - // die; - - $joinParams = new JoinMeetingParameters($meetingId, $fullname,$role); + $joinParams = new JoinMeetingParameters($meetingId, $fullname, $role); $presetProcessor = new PresetProcessor(); $joinParams = $presetProcessor->toJoinParameters($p, $joinParams); diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index 00ebd63f..c7ad9919 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -88,11 +88,11 @@ public function show($f3, $params): void } } - $meeting = (array) $meetingInfoResponse->getRawXml(); - $meeting['canStart'] = $canStart; - $meeting['password_moderator']=$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; - $meeting['password_attendee']=$presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; - $meeting['all_join_as_moderator']=$presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]; + $meeting = (array) $meetingInfoResponse->getRawXml(); + $meeting['canStart'] = $canStart; + $meeting['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; + $meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; + $meeting['all_join_as_moderator'] = $presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]; $this->renderJson(['room' => $room->getRoomInfos($room), 'meeting' => $meeting]); } else { diff --git a/bbbeasy-backend/app/src/Utils/Password.php b/bbbeasy-backend/app/src/Utils/Password.php new file mode 100644 index 00000000..848cd449 --- /dev/null +++ b/bbbeasy-backend/app/src/Utils/Password.php @@ -0,0 +1,32 @@ +. + */ + +namespace Utils; + +/** + * @codeCoverageIgnore + */ +class Password +{ + public const ENCRYPTION_KEY = 'security_group'; + public const CIPHERING_VALUE = 'AES-128-CTR'; +} diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index c661a571..eeae4516 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -93,17 +93,18 @@ 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 = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); + $password_attendee = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); - $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR,($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR])); - $presetsData->setData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE, $preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE] ); - + $presetsData->setData(Security::GROUP_NAME, Security::PASSWORD_FOR_MODERATOR, $password_moderator); + $presetsData->setData(Security::GROUP_NAME, Security::PASSWORD_FOR_ATTENDEE, $password_attendee); $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)?$presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_MODERATOR):DataUtils::generateRandomString()); - $createParams->setAttendeePassword($presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE)?$presetsData->getData(Security::GROUP_NAME,Security::PASSWORD_FOR_ATTENDEE):DataUtils::generateRandomString()); + $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)); diff --git a/bbbeasy-frontend/src/components/Presets.tsx b/bbbeasy-frontend/src/components/Presets.tsx index a32653b6..2a131aff 100644 --- a/bbbeasy-frontend/src/components/Presets.tsx +++ b/bbbeasy-frontend/src/components/Presets.tsx @@ -510,11 +510,13 @@ const PresetsCol: React.FC = ({ }} /> )} - {item.type === 'password' && ( - { - item.value = event.target.value; - }}/> - + {item.type === 'password' && ( + { + item.value = event.target.value; + }} + /> )} {item.type === 'color' && ( { const [isRunning, setIsRunning] = useState(false); const [canStart, setCanStart] = useState(false); const dataContext = React.useContext(DataContext); - const [errors,setErrors]=React.useState(); + const [errors, setErrors] = React.useState(); const [errorsEdit, setErrorsEdit] = React.useState({}); const [showSocialMedia, setShowSocialMedia] = useState(false); const [showStartButton, setShowStartButton] = useState(true); @@ -102,7 +117,7 @@ const RoomDetails = () => { const [labels, setLabels] = React.useState(); const [presets, setPresets] = React.useState(); const prefixShortLink = '/r/'; - const [meeting,setMeeting]=React.useState(null); + const [meeting, setMeeting] = React.useState(null); const [showRecodingAndPresenttaions, setShowRecodingAndPresenttaions] = React.useState(false); const [open, setOpen] = React.useState(false); const [roomRecordings, setRoomRecordings] = React.useState([]); @@ -130,15 +145,15 @@ const RoomDetails = () => { const startRoom = async () => { try { const values = await startForm.validateFields(); - console.log(values) + console.log(values); - RoomsService.start_room(room.id, values.fullname,values.password ) + RoomsService.start_room(room.id, values.fullname, values.password) .then((result) => { window.open(result.data, '_self'); }) .catch((error) => { console.log(error.response.data); - setErrors(error.response.data) + setErrors(error.response.data); /*Notifications.openNotificationWithIcon( 'error', t(Object.keys(EN_US).filter((elem) => EN_US[elem] === error.response.data.meeting)) @@ -184,7 +199,7 @@ const RoomDetails = () => { const room: RoomType = response.data.room; const meeting = response.data.meeting; - setMeeting(meeting) + setMeeting(meeting); console.log(currentUser?.role); setRoom(response.data.room); if (room != null) { @@ -199,7 +214,7 @@ const RoomDetails = () => { } if (meeting != null) { setCanStart(meeting.canStart); - console.log(meeting) + console.log(meeting); setIsRunning(meeting.running); } @@ -397,49 +412,48 @@ const RoomDetails = () => { ); }; - const showErrors=(errors)=>{ - {errors && ( - EN_US[elem] == errors)} />} - showIcon - /> - )} - } - const renderPasswordModeratorOrAttendee=(errors,user,meeting )=>{ - console.log('meeting',meeting) - console.log("user",user) - console.log("errors",errors) - if(user ==null && !meeting.all_join_as_moderator){ - return ( - { + { + errors && ( + EN_US[elem] == errors)} />} + showIcon + /> + ); + } + }; + const renderPasswordModeratorOrAttendee = (errors, user, meeting) => { + console.log('meeting', meeting); + console.log('user', user); + console.log('errors', errors); + if (user == null && !meeting.all_join_as_moderator) { + return ( + EN_US[elem] == errors['password'] - )} + i18nKey={Object.keys(EN_US).filter((elem) => EN_US[elem] == errors['password'])} /> ), validateStatus: 'error', - })} - rules={[ - { - required: true, - message: , - }, - ]} - > - - - ) - - } - /* else if(user ==null && meeting.password_attendee){ + })} + rules={[ + { + required: true, + message: , + }, + ]} + > + + + ); + } + /* else if(user ==null && meeting.password_attendee){ return ( { ) }*/ - } + }; const renderLinkOrUsername = (open) => { if (currentUser != null) { return ( @@ -471,21 +485,18 @@ const RoomDetails = () => { ); } else { return ( - - - , - }, - ]} - > - - - + , + }, + ]} + > + + ); } }; @@ -556,17 +567,18 @@ const RoomDetails = () => { ))} - ) : null}
{showErrors(errors)} - - {renderPasswordModeratorOrAttendee(errors,currentUser,meeting)} + {renderPasswordModeratorOrAttendee( + errors, + currentUser, + meeting + )} -{renderLinkOrUsername(open)} + {renderLinkOrUsername(open)}
- ) : ( diff --git a/bbbeasy-frontend/src/components/auth/ResetPassword.tsx b/bbbeasy-frontend/src/components/auth/ResetPassword.tsx index 94da4e62..8ef168b9 100644 --- a/bbbeasy-frontend/src/components/auth/ResetPassword.tsx +++ b/bbbeasy-frontend/src/components/auth/ResetPassword.tsx @@ -16,8 +16,7 @@ * with BBBEasy; if not, see . */ import React from 'react'; -import -{ Link } from 'react-router-dom'; +import { Link } from 'react-router-dom'; import AuthService from '../../services/auth.service'; import Notifications from '../Notifications'; diff --git a/bbbeasy-frontend/src/locale/ar-TN.json b/bbbeasy-frontend/src/locale/ar-TN.json index f73c76a4..fe459fbf 100644 --- a/bbbeasy-frontend/src/locale/ar-TN.json +++ b/bbbeasy-frontend/src/locale/ar-TN.json @@ -46,15 +46,15 @@ "label": "الاسم الكامل", "required": "التسم الكامل مطلوب" }, - "password_moderator":{ - "label":"كلمة المرور للمشرف", - "required":"كلمة المرور للمشرف مطلوبة" + "password_moderator": { + "label": "كلمة المرور للمشرف", + "required": "كلمة المرور للمشرف مطلوبة" }, - "wrong-password-join-meeting":"تعذر الانضمام إلى اجتماع باستخدام كلمة مرور خاطئة", + "wrong-password-join-meeting": "تعذر الانضمام إلى اجتماع باستخدام كلمة مرور خاطئة", - "password_attendee":{ - "label":"كلمة المرور للحضور", - "required":"كلمة المرور للحضور مطلوبة" + "password_attendee": { + "label": "كلمة المرور للحضور", + "required": "كلمة المرور للحضور مطلوبة" }, "empty-fullname": "الرجاء إدخال الاسم الكامل للانضمام إلى الاجتماع", "confirm-password": { diff --git a/bbbeasy-frontend/src/locale/en-US.json b/bbbeasy-frontend/src/locale/en-US.json index 3ebdf1e8..cd5d2a3c 100644 --- a/bbbeasy-frontend/src/locale/en-US.json +++ b/bbbeasy-frontend/src/locale/en-US.json @@ -46,14 +46,14 @@ "label": "Full name", "required": "Full name is required" }, - "password_moderator":{ - "label":"Password for moderator", - "required":"Password for moderator is required" + "password_moderator": { + "label": "Password for moderator", + "required": "Password for moderator is required" }, - "wrong-password-join-meeting":"Could not join a meeting with a wrong password", - "password_attendee":{ - "label":"Password for attendee", - "required":"Password for attendee is required" + "wrong-password-join-meeting": "Could not join a meeting with a wrong password", + "password_attendee": { + "label": "Password for attendee", + "required": "Password for attendee is required" }, "empty-fullname": "Could not join a meeting with an empty fullname", "confirm-password": { diff --git a/bbbeasy-frontend/src/locale/fr-FR.json b/bbbeasy-frontend/src/locale/fr-FR.json index b47235ac..d4b14692 100644 --- a/bbbeasy-frontend/src/locale/fr-FR.json +++ b/bbbeasy-frontend/src/locale/fr-FR.json @@ -46,15 +46,15 @@ "label": "Nom Complet", "required": "Le Nom complet est obligatoire" }, - "password_moderator":{ - "label":"Mot de passe du modérateur", - "required":"Le mot de passe du modérateur est obligatoire" + "password_moderator": { + "label": "Mot de passe du modérateur", + "required": "Le mot de passe du modérateur est obligatoire" }, - "password_attendee":{ - "label":"Mot de passe du Participant", - "required":"Mot de passe du Participant est obligatoire" + "password_attendee": { + "label": "Mot de passe du Participant", + "required": "Mot de passe du Participant est obligatoire" }, - "wrong-password-join-meeting":"Impossible de rejoindre une réunion avec un mot de passe erroné", + "wrong-password-join-meeting": "Impossible de rejoindre une réunion avec un mot de passe erroné", "empty-fullname": "Veuillez entrer le Nom complet pour rejoindre la réunion", "confirm-password": { "label": "Confirmation du mot de passe", diff --git a/bbbeasy-frontend/src/services/rooms.service.ts b/bbbeasy-frontend/src/services/rooms.service.ts index 040213af..960ed624 100644 --- a/bbbeasy-frontend/src/services/rooms.service.ts +++ b/bbbeasy-frontend/src/services/rooms.service.ts @@ -40,9 +40,10 @@ class RoomsService { delete_room(id: number) { return axiosInstance.delete(apiRoutes.DELETE_ROOM_URL + id); } - start_room(id: number, fullname,password ) { + start_room(id: number, fullname, password) { return axiosInstance.post(apiRoutes.START_ROOM_URL + id, { - fullname,password + fullname, + password, }); } getRoomByLink(link: string) { From 39718a4c4a31c63590030453a8a43f2d018b33e7 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Thu, 31 Aug 2023 09:56:30 +0100 Subject: [PATCH 04/10] format code --- bbbeasy-backend/app/src/Actions/Rooms/Start.php | 2 +- bbbeasy-backend/app/src/Data/PresetData.php | 10 +--------- .../app/src/Utils/PresetProcessor.php | 16 ++++++---------- 3 files changed, 8 insertions(+), 20 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Rooms/Start.php b/bbbeasy-backend/app/src/Actions/Rooms/Start.php index d85968c1..0657a6bb 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/Start.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/Start.php @@ -204,4 +204,4 @@ public function joinMeeting(string $meetingId, string $role, BigBlueButtonReques $this->renderJson($bbbRequester->joinMeeting($joinParams)->getUrl()); } -} \ No newline at end of file +} diff --git a/bbbeasy-backend/app/src/Data/PresetData.php b/bbbeasy-backend/app/src/Data/PresetData.php index c8d08dac..cbca0919 100644 --- a/bbbeasy-backend/app/src/Data/PresetData.php +++ b/bbbeasy-backend/app/src/Data/PresetData.php @@ -22,22 +22,14 @@ namespace Data; -use Enum\Presets\General; - class PresetData { private array $data = []; public function setData($category, $subCategory, $value): void { - - - if (null !== $value ) { - + if (null !== $value) { $this->data[$category][$subCategory] = $value; - - - } } diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index f8f5d667..8e03ce81 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -8,16 +8,16 @@ * 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 + * terms of the GNU Lesser 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 + * 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. + * PARTICULAR PURPOSE. See the GNU Lesser 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 + * You should have received a copy of the GNU Lesser General Public License along + * with BBBEasy; if not, see . */ namespace Utils; @@ -33,12 +33,9 @@ use Enum\Presets\LockSettings; use Enum\Presets\Presentation; use Enum\Presets\Recording; - -use Enum\Presets\Security; - use Enum\Presets\Screenshare; +use Enum\Presets\Security; use Enum\Presets\UserExperience; - use Enum\Presets\Webcams; use Enum\Presets\Whiteboard; @@ -107,7 +104,6 @@ public function toCreateMeetingParams($preset, $createParams) $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]); From 704c9ed9e122f12038a8ff48ef67c711aeec4382 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Fri, 1 Sep 2023 10:32:20 +0100 Subject: [PATCH 05/10] disable the start&join button in case of sharedsecret is wrong --- .../app/src/Actions/Rooms/View.php | 10 ++- .../app/src/Enum/Presets/Whiteboard.php | 7 +- .../guides/user-guide/Administration.md | 17 +++++ bbbeasy-docs/guides/user-guide/Labels.md | 42 +++++++++++ bbbeasy-docs/guides/user-guide/Profile.md | 18 +++++ bbbeasy-docs/guides/user-guide/Recordings.md | 40 +++++++++++ .../guides/user-guide/Reset_password.md | 22 ++++++ bbbeasy-docs/guides/user-guide/Roles.md | 45 ++++++++++++ .../guides/user-guide/Rooms Details.md | 29 ++++++++ bbbeasy-docs/guides/user-guide/Users.md | 45 ++++++++++++ .../guides/user-guide/authentication.md | 13 ++++ .../user-guide/bigbluebutton settings.md | 18 +++++ bbbeasy-docs/guides/user-guide/branding.md | 19 +++++ bbbeasy-docs/guides/user-guide/faqs.md | 49 +++++++++++++ .../guides/user-guide/presets_management.md | 66 +++++++++++++++++ .../guides/user-guide/registration.md | 17 +++++ bbbeasy-docs/guides/user-guide/rooms.md | 57 +++++++++++++++ bbbeasy-docs/guides/user-guide/welcome.md | 70 +++++++++++++++++++ bbbeasy-frontend/src/App-webapp.css | 7 +- .../src/components/RoomDetails.tsx | 22 ++---- bigbluebutton-api-php | 1 + bigbluebutton.git | 1 + 22 files changed, 590 insertions(+), 25 deletions(-) create mode 100644 bbbeasy-docs/guides/user-guide/Administration.md create mode 100644 bbbeasy-docs/guides/user-guide/Labels.md create mode 100644 bbbeasy-docs/guides/user-guide/Profile.md create mode 100644 bbbeasy-docs/guides/user-guide/Recordings.md create mode 100644 bbbeasy-docs/guides/user-guide/Reset_password.md create mode 100644 bbbeasy-docs/guides/user-guide/Roles.md create mode 100644 bbbeasy-docs/guides/user-guide/Rooms Details.md create mode 100644 bbbeasy-docs/guides/user-guide/Users.md create mode 100644 bbbeasy-docs/guides/user-guide/authentication.md create mode 100644 bbbeasy-docs/guides/user-guide/bigbluebutton settings.md create mode 100644 bbbeasy-docs/guides/user-guide/branding.md create mode 100644 bbbeasy-docs/guides/user-guide/faqs.md create mode 100644 bbbeasy-docs/guides/user-guide/presets_management.md create mode 100644 bbbeasy-docs/guides/user-guide/registration.md create mode 100644 bbbeasy-docs/guides/user-guide/rooms.md create mode 100644 bbbeasy-docs/guides/user-guide/welcome.md create mode 160000 bigbluebutton-api-php create mode 160000 bigbluebutton.git diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index e20e1e33..69765b2a 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -81,14 +81,18 @@ public function show($f3, $params): void if (!$meetingInfoResponse->success()) { if ('notFound' === $meetingInfoResponse->getMessageKey()) { $anyonestart = false; - + } + 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['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; $meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; diff --git a/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php b/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php index 3315ddf3..431522aa 100644 --- a/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php +++ b/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php @@ -26,10 +26,11 @@ class Whiteboard extends Enum { - public const GROUP_NAME = 'Whiteboard'; + + public const GROUP_NAME = 'Whiteboard'; public const MULTI_USER_PEN_ONLY = 'multi_user_pen_only'; - public const PRESENTER_TOOLS = 'presenter_tools'; - public const MULTI_USER_TOOLS = 'multi_user_tools'; + public const PRESENTER_TOOLS = 'presenter_tools'; + public const MULTI_USER_TOOLS = 'multi_user_tools'; public const MULTI_USER_PEN_ONLY_TYPE = 'bool'; public const PRESENTER_TOOLS_TYPE = 'bool'; diff --git a/bbbeasy-docs/guides/user-guide/Administration.md b/bbbeasy-docs/guides/user-guide/Administration.md new file mode 100644 index 00000000..f9127790 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Administration.md @@ -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) diff --git a/bbbeasy-docs/guides/user-guide/Labels.md b/bbbeasy-docs/guides/user-guide/Labels.md new file mode 100644 index 00000000..203caa26 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Labels.md @@ -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) diff --git a/bbbeasy-docs/guides/user-guide/Profile.md b/bbbeasy-docs/guides/user-guide/Profile.md new file mode 100644 index 00000000..35dec74f --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Profile.md @@ -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) diff --git a/bbbeasy-docs/guides/user-guide/Recordings.md b/bbbeasy-docs/guides/user-guide/Recordings.md new file mode 100644 index 00000000..f53317f9 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Recordings.md @@ -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) diff --git a/bbbeasy-docs/guides/user-guide/Reset_password.md b/bbbeasy-docs/guides/user-guide/Reset_password.md new file mode 100644 index 00000000..20c21968 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Reset_password.md @@ -0,0 +1,22 @@ +# Reset password + +This feature allows you to change your password if you forget it before login + +___Reset password___ + + +`To reset your password , just follow these steps` + +1. Go to the login page +2. Click on `reset here ` link +3. Enter your email address then click on `Reset password ` button +4. An email will be sent to you that includes a change password link +5. Click through the link , that will redirect you to change password form +6. Enter your new password and submit the form +7. The password will be changed successfully + +![Reset password](/img/reset_password.png) + +![changepassword](/img/change_password.png) + + diff --git a/bbbeasy-docs/guides/user-guide/Roles.md b/bbbeasy-docs/guides/user-guide/Roles.md new file mode 100644 index 00000000..96745cca --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Roles.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 9 +--- + +# Roles configuration + +## Roles + +Through the Roles page, Administrators are able to add,edit,delete the roles of the application. +We have basically two roles Administrator and Lecturer but we can add another ones . + +![Roles](/img/roles.png) + +**_Creating a New Role_** + +`To create a new role click on the new role button. This will open the modal where you can specify the role details` + +1. Go to the Roles page +2. Click on the New Role button +3. Fill the form and check the role permissions needed then submit the form +4. A new role will be created with its permissions + + ![Roles](/img/New_roles.png) + +**_Rename the Role name_** + +`To Edit the role , you must follow the following steps` + +1. Go to the Roles page +2. Choose a role from the list then click on the rename button +3. Enter the new role name then save the changes +4. The role name will be changed successfully + +![Rename role](/img/role_rname.png) + +**_Edit the role permissions_** + +`To Edit the role permissions , you must follow the following steps` + +1. Go to the Roles page +2. Choose a role from the list then click on permissions +3. Edit the role permissions then click on save button +4. The role permissions will be changed + +![Rename role](/img/edit_permissions.png) diff --git a/bbbeasy-docs/guides/user-guide/Rooms Details.md b/bbbeasy-docs/guides/user-guide/Rooms Details.md new file mode 100644 index 00000000..c04abbf5 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Rooms Details.md @@ -0,0 +1,29 @@ + +## Rooms Details page + +Room details contains the entire room details (room informations , room presentations , room recordings) + + + +___Room details___ + +`In order to access to the room details page , you must follow these steps ` + +1. Go to the Rooms page +2. Choose a room and click on it to access to the room details page + +___Room Recordings section___ + +The room recordings contains all the recordings related to the specified room +This section after the end of the meeting + +___Room presentations section___ + +In the room presentations section , you can upload the desired documents for the room before starting it . +This section is available in case of the preupload setting is active on its related preset + +![Room details](/img/details_room.png) + + + + \ No newline at end of file diff --git a/bbbeasy-docs/guides/user-guide/Users.md b/bbbeasy-docs/guides/user-guide/Users.md new file mode 100644 index 00000000..ffce2d76 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/Users.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 10 +--- + +# Users Management + +## Users + +User management is a very important component of your application. +User management includes their profiles and account information. You can create a list of users and assign them different roles, +Each user is identified by username,email, role and state + +![Users](/img/Users.png) +**_New User_** + +`To create a new user , you must follow the following steps` + +1. Go to the Users page +2. Click on the New user button +3. Fill the user details and assign it a role then click on the create button +4. The user will be created with a default preset + +![Users](/img/new_user.png) + +**_Edit User_** + +`To Edit user , you must follow the following steps` + +1. Go to the Users page +2. Choose a user from the list and click on the edit button +3. Edit the user details then click on save button +4. The changes will be saved successfully + +![Users](/img/edit_user.png) + +**_Delete User_** + +`To delete user , you must follow the following steps` + +1. Go to the Users page +2. Choose a user from the list and click on the delete button +3. Confirm deletion +4. The user will be deleted . + + ![Users](/img/delete_user.png) diff --git a/bbbeasy-docs/guides/user-guide/authentication.md b/bbbeasy-docs/guides/user-guide/authentication.md new file mode 100644 index 00000000..5d31e332 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/authentication.md @@ -0,0 +1,13 @@ +--- +sidebar_position: 2 +--- + +# Authentication + +`To access to your account , just follow these steps` + +1. Open your browser, navigate to **[BBBeasy](https://meet.riadvice.ovh/)** +2. Click the login button +3. Enter your Email address and password , the click the login button + +![login](/img/login.png) diff --git a/bbbeasy-docs/guides/user-guide/bigbluebutton settings.md b/bbbeasy-docs/guides/user-guide/bigbluebutton settings.md new file mode 100644 index 00000000..1d209f54 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/bigbluebutton settings.md @@ -0,0 +1,18 @@ +--- +sidebar_position: 4 +--- + +# BigBlueButton Settings + +## Edit BigBlueButton settings : + +After already have the application installed , you can customize the BigBlueButton Room settings through the BigBlueButton view + +`To Edit BigBlueButton room settings` + +1. Go to the BigBlueButton page under the settings menu +2. Select one group from the preset setting groups +3. Enable/disable the BigBlueButton room settings needed for use then confirm the changes +4. The BigBlueButton room settings group will be updated with success + +![Audio](/img/Audio.png) diff --git a/bbbeasy-docs/guides/user-guide/branding.md b/bbbeasy-docs/guides/user-guide/branding.md new file mode 100644 index 00000000..84fe0118 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/branding.md @@ -0,0 +1,19 @@ +--- +sidebar_position: 3 +--- + +# Branding + +## Organization and branding + +You can customize the organization and branding information after the install , during using the application + +**_Update the Organization & Branding settings _** + +`To Edit the Organisation and branding settings , you must follow these steps ` + +1. Go to the Organization and branding page. +2. Edit the organization or branding settings then submit the changes. +3. the organization and branding settings will be saved. + + ![Organisation & Branding](/img/edit_branding.png) diff --git a/bbbeasy-docs/guides/user-guide/faqs.md b/bbbeasy-docs/guides/user-guide/faqs.md new file mode 100644 index 00000000..c0b58d64 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/faqs.md @@ -0,0 +1,49 @@ +--- +sidebar_position: 13 +id: introduction-faqs +title: "Frequently Asked Questions 🙋" +sidebar_label: "FAQs" +slug: "/user-guide/introduction/faqs" +--- + +## What is BigBlueButton? + +**[BigBlueButton](https://docs.bigbluebutton.org/)** is an open source web conferencing system for online learning. + +## What is a BigBlueButton integration? + +**[BigBlueButton](https://docs.bigbluebutton.org/)** is a platform. It can only be accessed via API +calls. For that reason an integration is required to use its features: schedule and create meetings, join, +invite and so on. + +## From where the name "BBBEasy" comes? + +The word **Hivevlet** is a combination of 2 words. **Hive** 🐝, structure for housing domesticated honeybees, which is +an +analogy to the conference rooms. **Velvet** 👘, a smoothness characteristic, an analogy to making a multipurpose rooms +manager experience easy behind the very wide choice of managing all the configurable features of BigBlueButton. + +## Why BBBEasy has been developed? + +**BBBEasy** has been developed to respond the following specific requirements: + +- Cover multiple business cases within a single integration: 1-to-1, hiring, exams, master class, pre-recorded + courses... +- An integration where all the features of BigBlueButton are configurable. +- Conference rooms configuration without redundancy. +- Rooms categorisation by labelling. +- Roles with customisable permissions' matrix. +- Easy to install with the minimum system command line knowledge. +- Full branding part of the experience. + +## Is BBBEasy open-source? + +**BBBEasy** is a fully open-sourced under **[AGPL v3.0](https://choosealicense.com/licenses/agpl-3.0/)**. There is no +commercial version, everything is open-sourced, however it is possible to get professional commercial support and +hosting +through **[RIADVICE](https://riadvice.tn)**. + +## Is BBBEasy a Learning Management System (LMS)? + +**BBBEasy** is not a Learning Management System (LMS), however its API can be used on top of an LMS to create +correlated LMS and Rooms Management system. diff --git a/bbbeasy-docs/guides/user-guide/presets_management.md b/bbbeasy-docs/guides/user-guide/presets_management.md new file mode 100644 index 00000000..e9c0e2aa --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/presets_management.md @@ -0,0 +1,66 @@ +--- +sidebar_position: 5 +--- + +# Presets Management + +## Configuration Presets: + +A preset is a set of configuration settings for BigBlueButton . +This means that if you create a rooms and give it a particular configuration, it will maintain the same during the session. You can also create multiple configurations presets and assign different presets to different rooms. + +**_New Presets_** + +`To create a new preset, follow these setps` + +1. Go to the presets page +2. Click on the New preset button +3. Enter the preset name then click on the Create button +4. A new preset will be created with the default preset settings + + ![presets](/img/new_preset.png) + +![presets](/img/presets.png) + +**_Rename Presets_** + +`To Rename presets , you must follow the following steps` + +1. Go to the Presets page +2. Choose a preset from the preset cards and click on the rename button +3. Rename the preset then click on the save button +4. The preset name will be changed successfully + +![rename preset](/img/rename_preset.png) + +**_Edit the Preset settings_** + +`To Edit the preset settings , you must follow the following steps` + +1. Go to the Presets page +2. Choose a preset from the preset cards and choose a preset configuration group (Audio,Branding,.......) +3. Edit the preset settings details then click on the save button +4. The preset settings will be changed successfully + +![edit preset settings](/img/edit_preset_settings.png) + +**_Copy the Preset_** + +`To Copy the preset , you must follow the following steps` + +1. Go to the Presets page +2. Choose preset from the preset cards then click on copy option +3. The preset will be copied successfully with its preset settings + +![copy preset](/img/copy_preset.png) + +**_Delete Presets_** + +`To delete Presets , you must follow the following steps` + +1. Go to the Presets page +2. Choose a preset from the preset cards and click on the delete option +3. Confirm deletion +4. The preset will be deleted . + + ![delete preset](/img/delete_presete.png) diff --git a/bbbeasy-docs/guides/user-guide/registration.md b/bbbeasy-docs/guides/user-guide/registration.md new file mode 100644 index 00000000..f1d8b520 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/registration.md @@ -0,0 +1,17 @@ +--- +sidebar_position: 1 +--- + +# Registration + +The register page allows you to create an account in order to use the application and discover its features. + +**_Register_** + +` To Register a new account , just follow these steps` + +1. Go to register page +2. Fill the account details then submit the form +3. A new user will be registered successfully with a pending state and a default preset will be created for each new registered user +4. The administrator should activate the new created account in order to use it . + ![Register](/img/register.png) diff --git a/bbbeasy-docs/guides/user-guide/rooms.md b/bbbeasy-docs/guides/user-guide/rooms.md new file mode 100644 index 00000000..dc274329 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/rooms.md @@ -0,0 +1,57 @@ +--- +sidebar_position: 7 +--- + +# Rooms Management + +The room is a communication tool between different users and through it moves to web conference. +A room is identified by name , unique link ,labels(optional) and assigned to one preset . + +**_New Room_** + +`To create a New room ,you must follow the following steps` + +1. Go to the Rooms page +2. Click on the New room button +3. Once the modal is opened , the link will be generated automatically (editable optionally) +4. Fill the rest of room details then click on the Create button +5. The room will be created successfully + +![Room](/img/new_room.png) + +![Rooms](/img/rooms.png) + +**_Edit Room_** + +`To Edit rooms , you must follow the following steps` + +1. Go to the Rooms page +2. Choose a room and click on it to access to the room details page +3. Click on edit button , make the needed changes and click on the save button +4. The room will be changed successfully + +![Rooms](/img/Edit_room.png) + +**_Start Room_** + +`To start rooms , you must follow the following steps` + +1. Go to the Rooms page +2. Choose a room and click on it to access to the room details page +3. Click on the start or join button +4. The meeting will be started with its own setting + +![Rooms](/img/start.png) + +![BigBlueButton](/img/join_bbb.png) + +**_Delete Room _** + +`To delete rooms , you must follow the following steps` + +1. Go to the rooms page +2. Choose a room from the cards and click on the delete option +3. Confirm deletion +4. The room will be deleted . + +![Delete](/img/delete-room.png) diff --git a/bbbeasy-docs/guides/user-guide/welcome.md b/bbbeasy-docs/guides/user-guide/welcome.md new file mode 100644 index 00000000..13a3aa68 --- /dev/null +++ b/bbbeasy-docs/guides/user-guide/welcome.md @@ -0,0 +1,70 @@ +--- +sidebar_position: 0 +id: introduction-welcome +title: "Welcome to BBBEasy 👋" +sidebar_label: "Introduction" +slug: "/user-guide/welcome" +--- + +**BBBEasy** is multipurpose rooms manager for the open-source web-conferencing platform +BigBlueButton. Technically, it is a complete and fully featured integration for BigBlueButton +developed to handle multiple web-conferencing use cases. + +**BBBEasy** is developed and maintained by **[RIADVICE](https://riadvice.tn)** to serve its own and +customers requirements regarding managing BigBlueButton rooms management. + +**BBBeasy** is unique because it facilitates communication. + +![BBBEasy Screenshots](/img/intro.png) + +## BBBEasy Overview ✨ + +**BBBEasy** is a standalone HTML5 web-application powered by a backend API. + +# Languages : + +The BBBeasy project consists of 3 languages + +- English +- French +- Arabic + +All the translations are made by crowdin tool + +**[Crowdin](https://crowdin.com/)** + +## Fast Track ⏱️ + +In **BBBEasy** a `room` is designed around 3 principles: + +`Room` : A web-conference or meeting room that has a name and a unique link. + +`Preset` : A configuration preset that contains multiple configuration parameters, linked to the room policy itself and +to BigBlueButton. + +`Label` : A room can be tagged by different labels to make it easily identifiable. + +## Features 🧱 + +- [Rooms](./rooms.md) +- [Users](./Users.md) +- [Users roles and permissions](./Roles.md) +- [Presets Management](./presets_management.md) +- [Label](./Labels.md) +- [Branding](./branding.md) +- [Recording](./Recordings.md) +- [Administration](./Administration.md) +- [Room details](./Rooms Details.md) +- [Authentication](./authentication.md) +- [Registration](./registration.md) +- [Profile](Profile.md) +- [Reset password](./Reset_password.md) +- [BigBlueButton settings](./bigbluebutton_settings.md) + +## Design principles 📜 + +... + +## Staying informed ℹ️ + +... diff --git a/bbbeasy-frontend/src/App-webapp.css b/bbbeasy-frontend/src/App-webapp.css index 73a15b3e..940b7f22 100644 --- a/bbbeasy-frontend/src/App-webapp.css +++ b/bbbeasy-frontend/src/App-webapp.css @@ -818,7 +818,7 @@ fieldset { font-weight: 600; clip-path: polygon(48% 0, 52% 0, 95% 25%, 95% 75%, 52% 100%, 48% 100%, 5% 75%, 5% 25%); border-radius: 50%; - background-color: #fbbc0b !important; + background-color: #fbbc0b ; } .room-presentations { border-radius: 5px !important; @@ -1369,7 +1369,10 @@ fieldset { .recording-formats .icon-disabled { color: var(--bbbeasy-medimum-gray) !important; } - +.btn-disabled{ + cursor: not-allowed; + background-color: var(--bbbeasy-medimum-gray) !important; +} .share-modal { padding: 0 30px !important; text-align: center !important; diff --git a/bbbeasy-frontend/src/components/RoomDetails.tsx b/bbbeasy-frontend/src/components/RoomDetails.tsx index 8c2fd28f..1258f009 100644 --- a/bbbeasy-frontend/src/components/RoomDetails.tsx +++ b/bbbeasy-frontend/src/components/RoomDetails.tsx @@ -461,23 +461,11 @@ const RoomDetails = () => { ); } - /* else if(user ==null && meeting.password_attendee){ - return ( - , - }, - ]} - > - - - ) - }*/ + }; + const disabled=(disabled)=>{ + return disabled?' btn-disabled':''; + } const renderLinkOrUsername = (open) => { if (currentUser != null) { return ( @@ -653,7 +641,7 @@ const RoomDetails = () => { diff --git a/bigbluebutton-api-php b/bigbluebutton-api-php new file mode 160000 index 00000000..226a6384 --- /dev/null +++ b/bigbluebutton-api-php @@ -0,0 +1 @@ +Subproject commit 226a6384add4fcd050f20b793fde73f1a7f7149b diff --git a/bigbluebutton.git b/bigbluebutton.git new file mode 160000 index 00000000..1a0cf1c7 --- /dev/null +++ b/bigbluebutton.git @@ -0,0 +1 @@ +Subproject commit 1a0cf1c78b1cf4a80257da231d3ac468f1c2b781 From 0b411f03ea03a11552294da7c801f2057603f000 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Fri, 1 Sep 2023 10:45:37 +0100 Subject: [PATCH 06/10] add size rule to fullname --- bbbeasy-frontend/src/components/RoomDetails.tsx | 4 ++++ bbbeasy-frontend/src/locale/ar-TN.json | 3 ++- bbbeasy-frontend/src/locale/en-US.json | 3 ++- bbbeasy-frontend/src/locale/fr-FR.json | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bbbeasy-frontend/src/components/RoomDetails.tsx b/bbbeasy-frontend/src/components/RoomDetails.tsx index 1258f009..5c736dc1 100644 --- a/bbbeasy-frontend/src/components/RoomDetails.tsx +++ b/bbbeasy-frontend/src/components/RoomDetails.tsx @@ -489,6 +489,10 @@ const RoomDetails = () => { required: true, message: , }, + { + min:2, + message: + } ]} > diff --git a/bbbeasy-frontend/src/locale/ar-TN.json b/bbbeasy-frontend/src/locale/ar-TN.json index fe459fbf..1e3080f5 100644 --- a/bbbeasy-frontend/src/locale/ar-TN.json +++ b/bbbeasy-frontend/src/locale/ar-TN.json @@ -44,7 +44,8 @@ }, "fullname": { "label": "الاسم الكامل", - "required": "التسم الكامل مطلوب" + "required": "التسم الكامل مطلوب", + "minSize":"يجب أن يحتوي الاسم على حرفين على الأقل" }, "password_moderator": { "label": "كلمة المرور للمشرف", diff --git a/bbbeasy-frontend/src/locale/en-US.json b/bbbeasy-frontend/src/locale/en-US.json index cd5d2a3c..cba52571 100644 --- a/bbbeasy-frontend/src/locale/en-US.json +++ b/bbbeasy-frontend/src/locale/en-US.json @@ -44,7 +44,8 @@ }, "fullname": { "label": "Full name", - "required": "Full name is required" + "required": "Full name is required", + "minSize":"Fullname must have at least 2 characters" }, "password_moderator": { "label": "Password for moderator", diff --git a/bbbeasy-frontend/src/locale/fr-FR.json b/bbbeasy-frontend/src/locale/fr-FR.json index d4b14692..14f15c6e 100644 --- a/bbbeasy-frontend/src/locale/fr-FR.json +++ b/bbbeasy-frontend/src/locale/fr-FR.json @@ -44,7 +44,8 @@ }, "fullname": { "label": "Nom Complet", - "required": "Le Nom complet est obligatoire" + "required": "Le Nom complet est obligatoire", + "minSize":"Le nom doit contenir au moins 2 caractères" }, "password_moderator": { "label": "Mot de passe du modérateur", From afe48990c818b7306d8837ba3143c691bbe8450f Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Fri, 1 Sep 2023 11:41:16 +0100 Subject: [PATCH 07/10] pass nullable values into bigbluebutton int parameters --- bbbeasy-backend/app/src/Utils/PresetProcessor.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index fa63b1b5..93713107 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -78,10 +78,10 @@ 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::DURATION , $preparePresetData[General::GROUP_NAME][General::DURATION]?:null); - $presetsData->setData(General::GROUP_NAME, General::MAXIMUM_PARTICIPANTS, $preparePresetData[General::GROUP_NAME][General::MAXIMUM_PARTICIPANTS]); + $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]); @@ -143,7 +143,8 @@ 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)); From 40a4bef60f9fb37909b1533f56e5616e44c04154 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Fri, 1 Sep 2023 11:57:57 +0100 Subject: [PATCH 08/10] fix sonar problems & format code --- .../app/src/Actions/Rooms/View.php | 13 ++++---- .../app/src/Enum/Presets/Whiteboard.php | 7 ++--- bbbeasy-backend/app/src/Utils/Password.php | 10 +++--- .../app/src/Utils/PresetProcessor.php | 14 +++------ .../src/components/RoomDetails.tsx | 31 +++++-------------- bbbeasy-frontend/yarn.lock | 4 +-- 6 files changed, 28 insertions(+), 51 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index 69765b2a..66078263 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -82,17 +82,16 @@ public function show($f3, $params): void if ('notFound' === $meetingInfoResponse->getMessageKey()) { $anyonestart = false; } - if("checksumError" == $meetingInfoResponse->getMessageKey()){ - $joindisabled=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; - } - + 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['joinDisabled'] = $joindisabled; $meeting['canStart'] = $canStart; $meeting['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; $meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; diff --git a/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php b/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php index 431522aa..3315ddf3 100644 --- a/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php +++ b/bbbeasy-backend/app/src/Enum/Presets/Whiteboard.php @@ -26,11 +26,10 @@ class Whiteboard extends Enum { - - public const GROUP_NAME = 'Whiteboard'; + public const GROUP_NAME = 'Whiteboard'; public const MULTI_USER_PEN_ONLY = 'multi_user_pen_only'; - public const PRESENTER_TOOLS = 'presenter_tools'; - public const MULTI_USER_TOOLS = 'multi_user_tools'; + public const PRESENTER_TOOLS = 'presenter_tools'; + public const MULTI_USER_TOOLS = 'multi_user_tools'; public const MULTI_USER_PEN_ONLY_TYPE = 'bool'; public const PRESENTER_TOOLS_TYPE = 'bool'; diff --git a/bbbeasy-backend/app/src/Utils/Password.php b/bbbeasy-backend/app/src/Utils/Password.php index 848cd449..9d2dc648 100644 --- a/bbbeasy-backend/app/src/Utils/Password.php +++ b/bbbeasy-backend/app/src/Utils/Password.php @@ -8,16 +8,16 @@ * 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 Lesser General Public License as published by the Free Software + * 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 + * 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 Lesser General Public License for more details. + * PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * - * You should have received a copy of the GNU Lesser General Public License along - * with BBBEasy; if not, see . + * You should have received a copy of the GNU Affero General Public License along + * with BBBeasy. If not, see */ namespace Utils; diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index 93713107..33d0516b 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -34,9 +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; @@ -78,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]?:null); + $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(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]); @@ -99,7 +96,7 @@ 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 = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); $password_attendee = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); @@ -107,7 +104,7 @@ public function toCreateMeetingParams($preset, $createParams) $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]); @@ -143,8 +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)?:null); - + $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)); diff --git a/bbbeasy-frontend/src/components/RoomDetails.tsx b/bbbeasy-frontend/src/components/RoomDetails.tsx index 5c736dc1..8732e6a2 100644 --- a/bbbeasy-frontend/src/components/RoomDetails.tsx +++ b/bbbeasy-frontend/src/components/RoomDetails.tsx @@ -153,8 +153,7 @@ const RoomDetails = () => { const startRoom = async () => { try { const values = await startForm.validateFields(); - console.log(values); - + RoomsService.start_room(room.id, values.fullname, values.password) .then((result) => { window.open(result.data, '_self'); @@ -162,10 +161,7 @@ const RoomDetails = () => { .catch((error) => { console.log(error.response.data); setErrors(error.response.data); - /*Notifications.openNotificationWithIcon( - 'error', - t(Object.keys(EN_US).filter((elem) => EN_US[elem] === error.response.data.meeting)) - );*/ + }); } catch (errInfo) { console.log('could not start or join the meeting :', errInfo); @@ -208,7 +204,7 @@ const RoomDetails = () => { const meeting = response.data.meeting; setMeeting(meeting); - console.log(currentUser?.role); + setRoom(response.data.room); if (room != null) { setRoom(room); @@ -222,7 +218,7 @@ const RoomDetails = () => { } if (meeting != null) { setCanStart(meeting.canStart); - console.log(meeting); + setIsRunning(meeting.running); } @@ -420,22 +416,9 @@ const RoomDetails = () => { ); }; - const showErrors = (errors) => { - { - errors && ( - EN_US[elem] == errors)} />} - showIcon - /> - ); - } - }; + const renderPasswordModeratorOrAttendee = (errors, user, meeting) => { - console.log('meeting', meeting); - console.log('user', user); - console.log('errors', errors); + if (user == null && !meeting.all_join_as_moderator) { return ( { ) : null}
- {showErrors(errors)} + {renderPasswordModeratorOrAttendee( errors, diff --git a/bbbeasy-frontend/yarn.lock b/bbbeasy-frontend/yarn.lock index ffa0e2c7..201b35d6 100644 --- a/bbbeasy-frontend/yarn.lock +++ b/bbbeasy-frontend/yarn.lock @@ -19010,11 +19010,11 @@ __metadata: "typescript@patch:typescript@^4.9.5#~builtin": version: 4.9.5 - resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=289587" + resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=23ec76" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 1f8f3b6aaea19f0f67cba79057674ba580438a7db55057eb89cc06950483c5d632115c14077f6663ea76fd09fce3c190e6414bb98582ec80aa5a4eaf345d5b68 + checksum: ab417a2f398380c90a6cf5a5f74badd17866adf57f1165617d6a551f059c3ba0a3e4da0d147b3ac5681db9ac76a303c5876394b13b3de75fdd5b1eaa06181c9d languageName: node linkType: hard From ab2ad98f5000c7071f7f16cee5c3ae85312deab1 Mon Sep 17 00:00:00 2001 From: Hana Zaraa Date: Fri, 1 Sep 2023 13:41:01 +0100 Subject: [PATCH 09/10] fix issues --- bbbeasy-backend/app/src/Actions/Rooms/Start.php | 4 ++-- bbbeasy-backend/app/src/Actions/Rooms/View.php | 1 + bbbeasy-backend/app/src/Utils/PresetProcessor.php | 4 ++-- bbbeasy-frontend/src/components/RoomDetails.tsx | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Rooms/Start.php b/bbbeasy-backend/app/src/Actions/Rooms/Start.php index ab39688a..54262057 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/Start.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/Start.php @@ -122,8 +122,8 @@ 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 { - $password_moderator = openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); - $password_attendee = openssl_decrypt($presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); + $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); diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index 66078263..a55c8b9a 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -93,6 +93,7 @@ public function show($f3, $params): void $meeting = (array) $meetingInfoResponse->getRawXml(); $meeting['joinDisabled'] = $joindisabled; $meeting['canStart'] = $canStart; + $meeting['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; $meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; $meeting['all_join_as_moderator'] = $presetData[General::GROUP_NAME][General::ALL_JOIN_AS_MODERATOR]; diff --git a/bbbeasy-backend/app/src/Utils/PresetProcessor.php b/bbbeasy-backend/app/src/Utils/PresetProcessor.php index 33d0516b..fc0f2b15 100644 --- a/bbbeasy-backend/app/src/Utils/PresetProcessor.php +++ b/bbbeasy-backend/app/src/Utils/PresetProcessor.php @@ -97,8 +97,8 @@ public function toCreateMeetingParams($preset, $createParams) $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 = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); - $password_attendee = openssl_decrypt($preparePresetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE], Password::CIPHERING_VALUE, Password::ENCRYPTION_KEY); + $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); diff --git a/bbbeasy-frontend/src/components/RoomDetails.tsx b/bbbeasy-frontend/src/components/RoomDetails.tsx index 8732e6a2..de3b71ca 100644 --- a/bbbeasy-frontend/src/components/RoomDetails.tsx +++ b/bbbeasy-frontend/src/components/RoomDetails.tsx @@ -419,7 +419,7 @@ const RoomDetails = () => { const renderPasswordModeratorOrAttendee = (errors, user, meeting) => { - if (user == null && !meeting.all_join_as_moderator) { + if (user == null && !meeting.all_join_as_moderator &&( meeting.password_moderator!=null || meeting.password_attendee!=null)) { return ( Date: Fri, 1 Sep 2023 15:00:44 +0100 Subject: [PATCH 10/10] add conditions in order to display password input --- bbbeasy-backend/app/src/Actions/Rooms/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bbbeasy-backend/app/src/Actions/Rooms/View.php b/bbbeasy-backend/app/src/Actions/Rooms/View.php index a55c8b9a..c451536e 100644 --- a/bbbeasy-backend/app/src/Actions/Rooms/View.php +++ b/bbbeasy-backend/app/src/Actions/Rooms/View.php @@ -94,8 +94,8 @@ public function show($f3, $params): void $meeting['joinDisabled'] = $joindisabled; $meeting['canStart'] = $canStart; - $meeting['password_moderator'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_MODERATOR]; - $meeting['password_attendee'] = $presetData[Security::GROUP_NAME][Security::PASSWORD_FOR_ATTENDEE]; + $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]);