|
24 | 24 |
|
25 | 25 | namespace filter_opencast\local;
|
26 | 26 |
|
27 |
| -use core\check\performance\debugging; |
28 | 27 | use oauth_helper;
|
29 | 28 | use tool_opencast\local\settings_api;
|
30 | 29 | use tool_opencast\local\api;
|
@@ -199,20 +198,22 @@ public static function get_filter_lti_launch_url(int $ocinstanceid, int $coursei
|
199 | 198 | * This function calls an api endpoint because the url of the engage.ui is different depending on
|
200 | 199 | * the installation (All-In-One or Multiple Servers).
|
201 | 200 | *
|
202 |
| - * @param int $ocinstancid |
| 201 | + * @param int $ocinstanceid |
203 | 202 | * @return string $url the url of the engage.ui of the opencast installation
|
204 | 203 | * @throws \moodle_exception
|
205 | 204 | */
|
206 |
| - public static function get_engage_url(int $ocinstancid) { |
207 |
| - $api = api::get_instance($ocinstancid); |
| 205 | + public static function get_engage_url(int $ocinstanceid) { |
| 206 | + $api = api::get_instance($ocinstanceid); |
208 | 207 | // Endpoint to call the engage.ui url of presentation node.
|
209 | 208 | // Make sure the api user has the rights to call that api endpoint.
|
210 |
| - $engageurlendpoint = '/api/info/organization/properties/engageuiurl'; |
211 |
| - $result = json_decode($api->oc_get($engageurlendpoint), true); |
212 |
| - $url = $result['org.opencastproject.engage.ui.url']; |
213 |
| - if (!$url) { |
214 |
| - throw new \moodle_exception('no_engageurl_error', 'filter_opencast'); |
| 209 | + $response = $api->opencastapi->baseApi->getOrgEngageUIUrl(); |
| 210 | + if ($response['code'] != 200) { |
| 211 | + global $CFG; |
| 212 | + $supportemail = $CFG->supportemail; |
| 213 | + throw new \moodle_exception('no_engageurl_error', 'filter_opencast', '', $supportemail); |
| 214 | + } else { |
| 215 | + $engageui = $response['body']; |
| 216 | + return $engageui->{'org.opencastproject.engage.ui.url'}; |
215 | 217 | }
|
216 |
| - return $url; |
217 | 218 | }
|
218 | 219 | }
|
0 commit comments