MDL-71099 Lib: Move new user_fields class from core to core_user

This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.

Since the class has only just been added to Moodle, now is a good
time to move it.
This commit is contained in:
sam marshall
2021-03-25 13:48:04 +00:00
parent c54de9bec2
commit 3dee5cd74c
161 changed files with 420 additions and 420 deletions
@@ -115,7 +115,7 @@ class send_failed_login_notifications_task extends scheduled_task {
// Now, select all the login error logged records belonging to the ips and infos
// since lastnotifyfailure, that we have stored in the cache_flags table.
$userfieldsapi = \core\user_fields::for_name();
$userfieldsapi = \core_user\fields::for_name();
$namefields = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
$sql = "SELECT * FROM (
SELECT l.*, u.username, $namefields
@@ -47,7 +47,7 @@ class send_new_user_passwords_task extends scheduled_task {
// Generate new password emails for users - ppl expect these generated asap.
if ($DB->count_records('user_preferences', array('name' => 'create_password', 'value' => '1'))) {
mtrace('Creating passwords for new users...');
$userfieldsapi = \core\user_fields::for_name();
$userfieldsapi = \core_user\fields::for_name();
$usernamefields = $userfieldsapi->get_sql('u', false, '', '', false)->selects;
$newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email, u.auth, u.deleted,
u.suspended, u.emailstop, u.mnethostid, u.mailformat,