From 0259934efdf362b3c91eaeadf5a5d89ca53ca8f1 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Thu, 6 Aug 2020 16:31:08 +0200 Subject: [PATCH] Minor - Plugins: Zoom - Remove unused config globalConferencePerUserAllowRoles globalConferencePerUser BT#17288 --- plugin/zoom/lib/ZoomPlugin.php | 55 ++-------------------------------- plugin/zoom/meetings.php | 2 +- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/plugin/zoom/lib/ZoomPlugin.php b/plugin/zoom/lib/ZoomPlugin.php index 1dca34f007..89e790ab97 100644 --- a/plugin/zoom/lib/ZoomPlugin.php +++ b/plugin/zoom/lib/ZoomPlugin.php @@ -54,7 +54,6 @@ class ZoomPlugin extends Plugin 'enableParticipantRegistration' => 'boolean', 'enableCloudRecording' => 'boolean', 'enableGlobalConference' => 'boolean', - 'enableGlobalConferencePerUser' => 'boolean', 'globalConferenceAllowRoles' => [ 'type' => 'select', 'options' => [ @@ -65,16 +64,6 @@ class ZoomPlugin extends Plugin ], 'attributes' => ['multiple' => 'multiple'], ], - 'globalConferencePerUserAllowRoles' => [ - 'type' => 'select', - 'options' => [ - PLATFORM_ADMIN => get_lang('Administrator'), - COURSEMANAGER => get_lang('Teacher'), - STUDENT => get_lang('Student'), - STUDENT_BOSS => get_lang('StudentBoss'), - ], - 'attributes' => ['multiple' => 'multiple'], - ], ] ); @@ -114,25 +103,6 @@ class ZoomPlugin extends Plugin ); } - /** - * @return bool - */ - public static function currentUserCanCreateUserMeeting() - { - $user = api_get_user_entity(api_get_user_id()); - - if (null === $user) { - return false; - } - - return - 'true' === api_get_plugin_setting('zoom', 'enableGlobalConferencePerUser') - && in_array( - (api_is_platform_admin() ? PLATFORM_ADMIN : $user->getStatus()), - (array) api_get_plugin_setting('zoom', 'globalConferencePerUserAllowRoles') - ); - } - /** * @return array */ @@ -144,10 +114,6 @@ class ZoomPlugin extends Plugin $addMeetingLink = true; } - if (self::currentUserCanCreateUserMeeting()) { - $addMeetingLink = true; - } - if ($addMeetingLink) { $elements[$this->get_lang('Meetings')] = api_get_path(WEB_PLUGIN_PATH).'zoom/meetings.php'; } @@ -716,16 +682,10 @@ class ZoomPlugin extends Plugin $durationNumeric = $form->addNumeric('duration', $this->get_lang('DurationInMinutes')); $form->setRequired($durationNumeric); - if (null === $course) { + if (null === $course && 'true' === $this->get('enableGlobalConference')) { $options = []; - if ('true' === $this->get('enableGlobalConference')) { - $options['everyone'] = $this->get_lang('ForEveryone'); - } - - if ('true' === $this->get('enableGlobalConferencePerUser')) { - $options['registered_users'] = $this->get_lang('SomeUsers'); - } - + $options['everyone'] = $this->get_lang('ForEveryone'); + $options['registered_users'] = $this->get_lang('SomeUsers'); if (!empty($options)) { if (1 === count($options)) { $form->addHidden('type', key($options)); @@ -1087,15 +1047,6 @@ class ZoomPlugin extends Plugin ); } - /*if ('true' === api_get_plugin_setting('zoom', 'enableGlobalConferencePerUser')) { - $actionsLeft .= - Display::url( - Display::return_icon('user.png', $this->get_lang('GlobalMeetingPerUser'), null, ICON_SIZE_MEDIUM), - api_get_path(WEB_PLUGIN_PATH).'zoom/meetings.php?type=user' - ) - ; - }*/ - if (!empty($returnUrl)) { $back = Display::url( Display::return_icon('back.png', get_lang('Back'), null, ICON_SIZE_MEDIUM), diff --git a/plugin/zoom/meetings.php b/plugin/zoom/meetings.php index 4fe5bb7348..a4059e3c74 100644 --- a/plugin/zoom/meetings.php +++ b/plugin/zoom/meetings.php @@ -7,7 +7,7 @@ $course_plugin = 'zoom'; // needed in order to load the plugin lang variables $cidReset = true; require_once __DIR__.'/config.php'; -if (!ZoomPlugin::currentUserCanCreateUserMeeting()) { +if (!ZoomPlugin::currentUserCanJoinGlobalMeeting()) { api_not_allowed(true); }