Skip to content

Commit

Permalink
Make protected group multilselect
Browse files Browse the repository at this point in the history
  • Loading branch information
izendegi committed Dec 20, 2024
1 parent 8d1e88d commit 5eee4e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class webservice {
* Zoom group to protect from licenses redefining
* @var array
*/
protected $protectedgroup;
protected $protectedgroups;

/**
* Maximum limit of paid users
Expand Down Expand Up @@ -157,7 +157,7 @@ public function __construct() {
if (!empty($config->utmost)) {
$this->recyclelicenses = $config->utmost;
$this->instanceusers = !empty($config->instanceusers);
$this->protectedgroup = $config->protectedgroup;
$this->protectedgroups = !empty($config->protectedgroups) ? explode(',', $config->protectedgroups) : [];
}

if ($this->recyclelicenses) {
Expand Down Expand Up @@ -473,7 +473,7 @@ private function get_least_recently_active_paid_user_id() {
continue;
}
// Skip the protected group.
if (!in_array($this->protectedgroup, $user->group_ids ?? [], true)) {
if (!empty($this->protectedgroups) && array_intersect($this->protectedgroups, $user->group_ids ?? [])) {
continue;
}
// We need the login time.
Expand Down
4 changes: 2 additions & 2 deletions lang/en/zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@
$string['privacy:metadata:zoom_meeting_participants:user_email'] = 'The email of the participant';
$string['privacy:metadata:zoom_meeting_view'] = 'The database table to track users that view the meeting recordings';
$string['privacy:metadata:zoom_meeting_view:userid'] = 'The id of the user that viewed the recording';
$string['protectedgroup'] = 'Protect group';
$string['protectedgroup_desc'] = 'Select a Zoom group to protect member users from license redefining';
$string['protectedgroups'] = 'Protect groups';
$string['protectedgroups_desc'] = 'Select Zoom groups to protect member users from license redefining';
$string['recording'] = 'Recording';
$string['recordingadd'] = 'Add Recording';
$string['recordingdate'] = 'Recording Date';
Expand Down
12 changes: 6 additions & 6 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@
}
}

$protectedgroup = new admin_setting_configselect(
'zoom/protectedgroup',
get_string('protectedgroup', 'mod_zoom'),
get_string('protectedgroup_desc', 'mod_zoom'),
0,
$protectedgroups = new admin_setting_configmultiselect(
'zoom/protectedgroups',
get_string('protectedgroups', 'mod_zoom'),
get_string('protectedgroups_desc', 'mod_zoom'),
[],
$zoomgrps);
$settings->add($protectedgroup);
$settings->add($protectedgroups);
}

// Global settings.
Expand Down

0 comments on commit 5eee4e5

Please sign in to comment.