From f0816126bffcc602be31a4ced9b66e7ffaff76fe Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Fri, 21 Jan 2022 14:04:59 +0100 Subject: [PATCH] MDL-73608 tool_mobile: Return support page for not logged-in users --- admin/tool/mobile/classes/api.php | 1 + admin/tool/mobile/classes/external.php | 1 + admin/tool/mobile/tests/externallib_test.php | 1 + 3 files changed, 3 insertions(+) diff --git a/admin/tool/mobile/classes/api.php b/admin/tool/mobile/classes/api.php index adb8904bcbc..e57242572d5 100644 --- a/admin/tool/mobile/classes/api.php +++ b/admin/tool/mobile/classes/api.php @@ -198,6 +198,7 @@ class api { 'tool_mobile_androidappid' => get_config('tool_mobile', 'androidappid'), 'tool_mobile_setuplink' => clean_param(get_config('tool_mobile', 'setuplink'), PARAM_URL), 'tool_mobile_qrcodetype' => clean_param(get_config('tool_mobile', 'qrcodetype'), PARAM_INT), + 'supportpage' => clean_param($CFG->supportpage, PARAM_URL), ); $typeoflogin = get_config('tool_mobile', 'typeoflogin'); diff --git a/admin/tool/mobile/classes/external.php b/admin/tool/mobile/classes/external.php index 04c2b0bcf32..7d5120c4969 100644 --- a/admin/tool/mobile/classes/external.php +++ b/admin/tool/mobile/classes/external.php @@ -174,6 +174,7 @@ class external extends external_api { (only if age verification is enabled).', VALUE_OPTIONAL), 'supportemail' => new external_value(PARAM_EMAIL, 'Site support contact email (only if age verification is enabled).', VALUE_OPTIONAL), + 'supportpage' => new external_value(PARAM_URL, 'Site support page link.', VALUE_OPTIONAL), 'autolang' => new external_value(PARAM_INT, 'Whether to detect default language from browser setting.', VALUE_OPTIONAL), 'lang' => new external_value(PARAM_LANG, 'Default language for the site.', VALUE_OPTIONAL), diff --git a/admin/tool/mobile/tests/externallib_test.php b/admin/tool/mobile/tests/externallib_test.php index a4a730c1e99..1e96562a5a9 100644 --- a/admin/tool/mobile/tests/externallib_test.php +++ b/admin/tool/mobile/tests/externallib_test.php @@ -91,6 +91,7 @@ class externallib_test extends externallib_advanced_testcase { 'tool_mobile_androidappid' => get_config('tool_mobile', 'androidappid'), 'tool_mobile_setuplink' => get_config('tool_mobile', 'setuplink'), 'tool_mobile_qrcodetype' => get_config('tool_mobile', 'qrcodetype'), + 'supportpage' => $CFG->supportpage, 'warnings' => array() ); $this->assertEquals($expected, $result);