mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-73008 ws: Return current policy acceptance status
This commit is contained in:
parent
abba174fe1
commit
f40c196e51
@ -210,6 +210,8 @@ class core_webservice_external extends \core_external\external_api {
|
||||
$siteinfo['usersessionscount'] = $DB->count_records('sessions', ['userid' => $USER->id]);
|
||||
}
|
||||
|
||||
$siteinfo['policyagreed'] = $USER->policyagreed;
|
||||
|
||||
return $siteinfo;
|
||||
}
|
||||
|
||||
@ -282,6 +284,7 @@ class core_webservice_external extends \core_external\external_api {
|
||||
'limitconcurrentlogins' => new external_value(PARAM_INT, 'Number of concurrent sessions allowed', VALUE_OPTIONAL),
|
||||
'usersessionscount' => new external_value(PARAM_INT, 'Number of active sessions for current user.
|
||||
Only returned when limitconcurrentlogins is used.', VALUE_OPTIONAL),
|
||||
'policyagreed' => new external_value(PARAM_INT, 'Whether user accepted all the policies.', VALUE_OPTIONAL),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -141,6 +141,7 @@ class externallib_test extends externallib_advanced_testcase {
|
||||
$this->assertFalse($siteinfo['userissiteadmin']);
|
||||
$this->assertEquals($CFG->calendartype, $siteinfo['sitecalendartype']);
|
||||
$this->assertEquals($user['theme'], $siteinfo['theme']);
|
||||
$this->assertEquals($USER->policyagreed, $siteinfo['policyagreed']);
|
||||
|
||||
// Now as admin.
|
||||
$this->setAdminUser();
|
||||
|
Loading…
x
Reference in New Issue
Block a user