Skip to content

Commit

Permalink
Add check if there is no user to borrow license from
Browse files Browse the repository at this point in the history
  • Loading branch information
izendegi committed Jan 17, 2025
1 parent f6eb922 commit 710f8bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,11 @@ public function provide_license($zoomuserid) {
if ($this->paid_user_limit_reached()) {
$leastrecentlyactivepaiduserid = $this->get_least_recently_active_paid_user_id();
// Changes least_recently_active_user to a basic user so we can use their license.
$this->make_call("users/$leastrecentlyactivepaiduserid", ['type' => ZOOM_USER_TYPE_BASIC], 'patch');
if ($leastrecentlyactivepaiduserid) {
$this->make_call("users/$leastrecentlyactivepaiduserid", ['type' => ZOOM_USER_TYPE_BASIC], 'patch');
} else {
throw new moodle_exception('errornousersfound', 'mod_zoom');
}
}

// Changes current user to pro so they can make a meeting.
Expand Down
1 change: 1 addition & 0 deletions lang/en/zoom.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
$string['err_start_time_past_recurring'] = 'For recurring meetings, the date portion of this field is the earliest possible date for the next meeting. This date must be today or in the future.';
$string['err_weekly_days'] = 'Select day(s) for the recurring weekly meeting';
$string['erroraddinstance'] = 'Could not create new zoom meeting. Invalid options selected for a recurring meeting.';
$string['errornousersfound'] = 'There is no user to borrow license from.';
$string['errorwebservice'] = 'Zoom webservice error: {$a}.';
$string['errorwebservice_badrequest'] = 'Zoom received a bad request: {$a}';
$string['errorwebservice_notfound'] = 'The resource does not exists';
Expand Down

0 comments on commit 710f8bc

Please sign in to comment.