MDL-61477 admin: sitepolicy handler API
- Define sitepolicy handler manager class, base class and the core handler - Allow to set a plugin as sitepolicyhandler that implements the sitepolicy API - Modify web services to return information from the 3rd party handler instead of core if needed
This commit is contained in:
@@ -88,8 +88,9 @@ class auth_email_external extends external_api {
|
||||
if (!empty($CFG->passwordpolicy)) {
|
||||
$result['passwordpolicy'] = print_password_policy();
|
||||
}
|
||||
if (!empty($CFG->sitepolicy)) {
|
||||
$result['sitepolicy'] = $CFG->sitepolicy;
|
||||
$manager = new \core_privacy\local\sitepolicy\manager();
|
||||
if ($sitepolicy = $manager->get_embed_url()) {
|
||||
$result['sitepolicy'] = $sitepolicy->out(false);
|
||||
}
|
||||
if (!empty($CFG->defaultcity)) {
|
||||
$result['defaultcity'] = $CFG->defaultcity;
|
||||
@@ -287,7 +288,8 @@ class auth_email_external extends external_api {
|
||||
$data = $params;
|
||||
$data['email2'] = $data['email'];
|
||||
// Force policy agreed if a site policy is set. The client is responsible of implementing the interface check.
|
||||
if (!empty($CFG->sitepolicy)) {
|
||||
$manager = new \core_privacy\local\sitepolicy\manager();
|
||||
if (!$manager->is_defined()) {
|
||||
$data['policyagreed'] = 1;
|
||||
}
|
||||
unset($data['recaptcharesponse']);
|
||||
|
||||
Reference in New Issue
Block a user