|
58 | 58 | $zoomuserid = zoom_get_user_id(false); |
59 | 59 |
|
60 | 60 | // Check if this user is the (real) host. |
61 | | -if (!is_role_switched($course->id)) { |
62 | | - $userisrealhost = ($zoomuserid === $zoom->host_id); |
63 | | -} |
| 61 | +$userisrealhost = ($zoomuserid === $zoom->host_id); |
64 | 62 |
|
65 | 63 | // Get the alternative hosts of the meeting. |
66 | 64 | $alternativehosts = zoom_get_alternative_host_array_from_string($zoom->alternative_hosts); |
|
97 | 95 |
|
98 | 96 | $stryes = get_string('yes'); |
99 | 97 | $strno = get_string('no'); |
100 | | -$strstart = get_string('start_meeting', 'mod_zoom'); |
101 | 98 | $strjoin = get_string('join_meeting', 'mod_zoom'); |
102 | 99 | $strregister = get_string('register', 'mod_zoom'); |
103 | 100 | $strtime = get_string('meeting_time', 'mod_zoom'); |
|
151 | 148 | // Only show if the admin did not disable this feature completely. |
152 | 149 | if (!$showrecreate && $config->showcapacitywarning == true) { |
153 | 150 | // Only show if the user viewing this is the host. |
154 | | - if ($userishost && $iszoommanager) { |
| 151 | + if ($iszoommanager) { |
155 | 152 | // Get meeting capacity. |
156 | 153 | $meetingcapacity = zoom_get_meeting_capacity($zoom->host_id, $zoom->webinar); |
157 | 154 |
|
|
204 | 201 |
|
205 | 202 | // Show join meeting button or unavailability note. |
206 | 203 | if (!$showrecreate) { |
207 | | - // If registration is required, check the registration. |
208 | | - if (!$userishost && $zoom->registration != ZOOM_REGISTRATION_OFF) { |
| 204 | + if ($userishost) { |
| 205 | + // Hosts are pre-registered. |
| 206 | + $userisregistered = true; |
| 207 | + } else if ($zoom->registration != ZOOM_REGISTRATION_OFF) { |
| 208 | + // If registration is required, check the registration. |
209 | 209 | $userisregistered = zoom_is_user_registered_for_meeting($USER->email, $zoom->meeting_id, $zoom->webinar); |
210 | 210 |
|
211 | 211 | // Unregistered users are allowed to register. |
|
216 | 216 |
|
217 | 217 | if ($available) { |
218 | 218 | // Show join meeting button. |
219 | | - if ($userishost && $iszoommanager) { |
220 | | - $buttonhtml = html_writer::tag('button', $strstart, ['type' => 'submit', 'class' => 'btn btn-success']); |
221 | | - } else { |
222 | | - $btntext = $strjoin; |
223 | | - // If user is not already registered, use register text. |
224 | | - if ($zoom->registration != ZOOM_REGISTRATION_OFF && !$userisregistered) { |
225 | | - $btntext = $strregister; |
226 | | - } |
| 219 | + $btntext = $strjoin; |
227 | 220 |
|
228 | | - $buttonhtml = html_writer::tag('button', $btntext, ['type' => 'submit', 'class' => 'btn btn-primary']); |
| 221 | + // If user is not already registered, use register text. |
| 222 | + if ($zoom->registration != ZOOM_REGISTRATION_OFF && !$userisregistered) { |
| 223 | + $btntext = $strregister; |
229 | 224 | } |
230 | 225 |
|
| 226 | + $buttonhtml = html_writer::tag('button', $btntext, ['type' => 'submit', 'class' => 'btn btn-primary']); |
| 227 | + |
231 | 228 | $aurl = new moodle_url('/mod/zoom/loadmeeting.php', ['id' => $cm->id]); |
232 | 229 | $buttonhtml .= html_writer::input_hidden_params($aurl); |
233 | 230 | $link = html_writer::tag('form', $buttonhtml, ['action' => $aurl->out_omit_querystring(), 'target' => '_blank']); |
|
449 | 446 | // Get passcode information. |
450 | 447 | $haspassword = (isset($zoom->password) && $zoom->password !== ''); |
451 | 448 | $strhaspass = ($haspassword) ? $stryes : $strno; |
452 | | - $canviewjoinurl = (($userishost && $iszoommanager) || has_capability('mod/zoom:viewjoinurl', $context)); |
| 449 | + $canviewjoinurl = has_capability('mod/zoom:viewjoinurl', $context); |
453 | 450 |
|
454 | 451 | // Show passcode status. |
455 | 452 | $rowhaspass = new html_table_row(); |
|
583 | 580 | if ( |
584 | 581 | !$showrecreate |
585 | 582 | && ($zoom->option_audio === ZOOM_AUDIO_BOTH || $zoom->option_audio === ZOOM_AUDIO_TELEPHONY) |
586 | | - && (($userishost && $iszoommanager) || has_capability('mod/zoom:viewdialin', $context)) |
| 583 | + && has_capability('mod/zoom:viewdialin', $context) |
587 | 584 | ) { |
588 | 585 | // Get meeting invitation from Zoom. |
589 | 586 | $meetinginvite = zoom_webservice()->get_meeting_invitation($zoom)->get_display_string($cm->id); |
|
0 commit comments