Skip to content

Commit

Permalink
Merge branch 'MDL-75415-master' of https://github.com/ssj365/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Nov 16, 2022
2 parents 8db40f9 + 3bd76ae commit 38fcf6a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/bigbluebuttonbn/classes/meeting.php
Expand Up @@ -275,7 +275,8 @@ protected function do_get_meeting_info(bool $updatecache = false): stdClass {
!$instance->has_user_limit_been_reached($participantcount)
|| !$instance->does_current_user_count_towards_user_limit()
);
$canjoin = $canjoin && ($instance->is_currently_open() || $instance->user_can_force_join());
// User should only join during scheduled session start and end time, if defined.
$canjoin = $canjoin && ($instance->is_currently_open());
// Double check that the user has the capabilities to join.
$canjoin = $canjoin && $instance->can_join();
$meetinginfo->canjoin = $canjoin;
Expand Down
5 changes: 5 additions & 0 deletions mod/bigbluebuttonbn/tests/meeting_test.php
Expand Up @@ -217,10 +217,15 @@ public function test_can_join_with_dates(int $type, ?string $groupname, int $gro
$this->setUser($useringroup);
$meeting->update_cache();
$this->assertEquals($canjoin['useringroup'], $meeting->can_join());
// We check that admin can not join outside opening/closing times either.
$this->setAdminUser();
$this->assertEquals(false, $meeting->can_join());
if ($groupname) {
$this->setUser($usernotingroup);
$meeting->update_cache();
$this->assertEquals($canjoin['usernotingroup'], $meeting->can_join());
$this->setAdminUser();
$this->assertEquals(false, $meeting->can_join());
}
}

Expand Down

0 comments on commit 38fcf6a

Please sign in to comment.