MDL-60038 moodlelib: ignore site policy if user auth type = 'webservice'

This commit is contained in:
Noemie Ariste
2022-12-23 10:03:41 +13:00
parent 089260dae2
commit 8cded7cd9f
+2 -1
View File
@@ -2879,7 +2879,8 @@ function require_login($courseorid = null, $autologinguest = true, $cm = null, $
// Check that the user has agreed to a site policy if there is one - do not test in case of admins.
// Do not test if the script explicitly asked for skipping the site policies check.
if (!$USER->policyagreed && !is_siteadmin() && !NO_SITEPOLICY_CHECK) {
// Or if the user auth type is webservice.
if (!$USER->policyagreed && !is_siteadmin() && !NO_SITEPOLICY_CHECK && $USER->auth !== 'webservice') {
$manager = new \core_privacy\local\sitepolicy\manager();
if ($policyurl = $manager->get_redirect_url(isguestuser())) {
if ($preventredirect) {