Commit Graph

59 Commits

Author SHA1 Message Date
Marina Glancy 18067c8971 MDL-83504 user: reset preference cache in unittests 2024-10-21 17:58:50 +01:00
Huong Nguyen dca18ebca3 Merge branch 'MDL-81634-main' of https://github.com/andrewnicols/moodle 2024-08-20 09:30:44 +07:00
Ilya Tregubov b6a0a658b5 Merge branch 'MDL-82525' of https://github.com/paulholden/moodle 2024-08-08 08:25:31 +08:00
Andrew Nicols 1b7d08465c MDL-81031 core: Add routing 2024-08-06 16:01:07 +08:00
Andrew Nicols d3d5d8bc73 MDL-81031 core: Coding style fixes for \core\user 2024-08-06 16:01:07 +08:00
Andrew Nicols f943311753 MDL-81031 core: Rename \core_user to \core\user 2024-08-06 16:01:06 +08:00
Andrew Nicols 024e36be17 MDL-81634 core: Fix all implicitly defined nullables
Note: This does not impact third-party libraries.
2024-08-02 14:11:12 +08:00
meirzamoodle 699daafc64 MDL-64148 core: Make email greetings consistent
Some email body strings use first names as greetings,
some use full names, and some do not.

Using the first name for greeting makes it consistent and
a bit more "personal".
2024-07-30 22:40:47 +07:00
Paul Holden 0834280726 MDL-82525 user: correct course parameter for course profile page. 2024-07-29 09:21:57 +01:00
Jun Pataleta cf2073134a Merge branch 'MDL-82066' of https://github.com/paulholden/moodle 2024-07-18 00:03:02 +08:00
Ilya Tregubov de54a993d3 MDL-80744 mod_assign: Add user search. 2024-07-15 16:36:47 +08:00
Paul Holden a22ccfc7d0 MDL-82066 hook: new hook to extend options for default site homepage. 2024-07-09 13:09:09 +01:00
Paul Holden c63e3c5756 MDL-82169 user: remove access to non-existent $options array. 2024-06-11 21:24:27 +01:00
sam marshall 975daef935 MDL-80693 core_user: search() fails if no standard identify fields 2024-01-22 11:38:01 +00:00
Laurent David bef0cb7a34 MDL-77274 core_renderer: Respect full name format in letter avatars
* Make sure that we respect the fullnamedisplay and alternativefullnameformat
parameters to decide on the initials for a given user
* Add further tests

Co-authored-by: Tatsunori Uchino <tats.u@live.jp>
2023-10-30 06:14:18 +01:00
hieuvu a3da58a9cb MDL-78312 core_user: add an 'exact match only' option 2023-09-13 20:22:22 +07:00
Paul Holden b30245b3e2 MDL-76974 javascript: convert remaining uses of old preferences API.
Implement component preference definition callbacks, update JS code
to use the `core_user/repository` module instead of the now deprecated
API.
2023-08-22 14:43:34 +01:00
Nathan Nguyen f897ecd627 MDL-77353 core_user: new functions
New functions:
    * `core_user::get_profile_picture` for retrieving user picture.
    * `core_user::get_profile_url` for retrieving profile url.
    * `core_user::get_fullname` for retrieving user full name.

Note: the context is not used as this stage. It will be used by "User Disguises" plugin, which will be implemented later.
2023-05-24 13:05:02 +10:00
Paul Holden 75ab52d902 MDL-76878 user: amend permission callbacks for preference definitions.
Ensure those preferences that are used for storing state can always be
updated via web service requests for the current user.
2023-01-20 10:05:21 +00:00
Paul Holden 2dfc273752 MDL-76862 user: ensure user can only update own preferred start page. 2023-01-12 11:35:10 +08:00
Sara Arjona e3d2fa41d0 MDL-73233 user: Review Start page user preferences
The "Start page" user preferences page has been reviewed to
consider the new $CFG->enabledashboard setting.
The "Dashboard" won't be displayed in the list if it's disabled.
Besides, the default value is now calculated calling the new
get_default_home_page() method.
2022-03-16 11:22:22 +01:00
Mathew May 54e098c5a5 MDL-73231 my: Allow my courses to be a homepage 2021-12-13 22:43:28 +08:00
David Mudrák 3722466892 MDL-72658 lang: Let welcome message use other than just firstname
The patch allows for strings welcomeback and welcometosite to be
customised and use other user names than just the firstname.

Supported are placeholder properties matching all known name fields:
firstnamephonetic, lastnamephonetic, middlename, alternatename,
firstname and lastname. Special values fullname and alternativefullname
are supported, too.

By default, the firstname is kept for compatibility with the original
feature design.
2021-09-23 20:57:22 +02:00
Dongsheng Cai a2d5d43223 MDL-71964 dashboard: add welcome message for all users 2021-09-23 10:42:04 +08:00
David Mudrák 7a8eae027f MDL-72325 user: Introduce new core_user::awaiting_action() method
The method allows to check if the user is fully ready to use the site or
whether there is an action (such as filling the missing profile field,
changing password or agreeing to the site policy) needed.
2021-08-12 13:05:38 +02:00
Ilya Tregubov 430746d3a2 MDL-66431 core: Remove activity chooser user preference.
This commit removes activity chooser user preference and
course preference page. Separate dropdowns to activity and
resource is also removed.
2021-05-01 16:21:59 +02:00
Bas Brands f9e1c2587a MDL-28452 core_user: migrate social profile fields
Create a new profile field type, move all existing content of the fields
'icq', 'skype', 'aim', 'yahoo', 'msn' and 'url' in the mdl_user table to
theses new profile fields if needed.

AMOS BEGIN
MOV [aimid,core],[aimid,courseimage,profilefield_social]
MOV [yahooid,core],[yahooid,profilefield_social]
MOV [skypeid,core],[skypeid,profilefield_social]
MOV [icqnumber,core],[icqnumber,profilefield_social]
MOV [msnid,core],[msnid,profilefield_social]
MOV [webpage,core],[webpage,profilefield_social]
AMOS END
2021-04-21 11:22:25 +02:00
sam marshall 5e72715e4f 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.
2021-03-25 13:47:23 +00:00
sam marshall 558cc1b85e MDL-45242 Lib: Replace calls to deprecated functions
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
2021-03-10 10:57:10 +00:00
sam marshall 3f003455f3 MDL-45242 Lib: Replace direct references to ->showuseridentity 2021-03-08 09:20:18 +00:00
Sander Wind c9855a8b20 MDL-70668 auth: Fix secret validation during user confirmation
Co-authored-by: Michael Hawkins <michaelh@moodle.com>
2021-03-02 23:44:24 +01:00
Vitaly 3a4af1eb4c MDL-69342 core_user: fixed user picture updating
When editing a user and checking the 'Delete picture' checkbox to delete
the old picture and uploading a new one at a time, the new one didn't appear
in the user profile. This happened due to the 'if/else' statement
in the 'core_user::update_picture()' method which allowed either to delete
the old picture or to upload a new one.
The fix removes the 'else' part of the 'if/else' statement to force
checking for a new uploaded picture no matter if a user checked
the 'Delete picture' checkbox or not.
2020-09-21 23:15:23 +03:00
Farhan Karmali 470f94dc46 MDL-67419 admin: New admin setting for lang during user creation 2020-08-10 18:34:19 +05:30
Bas Brands c393d8185a MDL-68796 core_contentbank: Store view preferences
includes privacy export, privacy unit test
2020-05-27 17:27:23 +02:00
Paul Holden c4e79fc604 MDL-40669 tool_uploaduser: allow emailstop to be set during upload. 2019-09-15 21:43:55 +01:00
Paul Holden 719f76313c MDL-57208 user: select default homepage from user preferences page. 2019-07-30 08:53:18 +01:00
Frédéric Massart b91ddd160e MDL-60518 core_user: A user with ID 0 is never a real user 2018-12-14 10:28:34 +01:00
Andrew Nicols 0616f045c3 MDL-53566 core: Add support for context locking
This chagne adds support for a new feature known as Context Locking.
This allows a context to be locked, thereby removing all write
capabilities for all users (including admin) for that context, and all
child contexts.
2018-11-13 21:17:40 +08:00
sam marshall bef86c669c MDL-62273 Profile: Callback allows plugins to control profile access
Adds a new callback, <plugin>_control_view_profile. Plugins may
return core_user::VIEWPROFILE_PREVENT to prevent access,
core_user::VIEWPROFILE_DO_NOT_PREVENT to make no change, or
core_user::VIEWPROFILE_FORCE_ALLOW to allow access even when Moodle
would normally prevent it.

This allows third-party plugins to restrict (or allow) access to
profile pages in response to arbitrary business logic.
2018-06-01 09:59:01 +01:00
sam marshall acaeb5ec41 MDL-61028 core_search: Fix SELECT bug affecting Oracle 2018-04-24 15:48:40 +02:00
sam marshall 71d985ab7d MDL-61028 core_user: Function to search visible users
Implements core_user::search function which can search through the
names (and, if allowed, other identity fields) of all users visible
to the current logged-in user, within a course context or globally.
2018-04-20 17:10:03 +01:00
Juan Leyva bef5777fc4 MDL-59214 webservice: Return calendar type in get_site_info 2017-06-20 11:44:04 +01:00
Mark Nelson 90b735b169 MDL-12689 core: fixed incorrect use of the term 'depreciated' 2017-04-05 11:12:07 +08:00
Damyon Wiese d9fbe3146c MDL-58220 oauth2: Use the same list of user fields
Authentication has a hard coded list of valid internal user fields - but they are in a class variable. We need them
in oauth user_field_mapping so we need to move them to a central place and call them from oauth2 and auth.
2017-04-03 13:43:26 +08:00
Damyon Wiese 28b592d5a6 MDL-58338 oauth2: Force email confirmation
New accounts and linking a login to an existing account MUST go through email verification.
We cannot trust the emails we get from oauth providers have been confirmed.

Part of MDL-58220
2017-04-03 13:43:25 +08:00
Marina Glancy 6e65554ea1 MDL-58010 user: allow to update only whitelisted user preferences 2017-03-10 18:04:47 +00:00
Adrian Greeve 9715f61a26 MDL-44467 lib: Fix return path to noreply.
Added code to show emails from users on controlled domains.
Moved admin settings from message_email to admin.
2016-10-28 13:27:00 +08:00
Simey Lameze ec90722870 MDL-54734 core_user: do not cache dummy user records 2016-07-06 13:07:03 +08:00
Russell Smith 5407c5b0f4 MDL-51789 users: Allow picture update from webservices.
useredit_update_picture as moved to user_update_picture
as it's more general.  It was also moved to user/lib.php
so it can be used by both webservices and edit without more include files.
2016-06-21 16:36:53 +10:00
Frederic Massart 16825c4e95 MDL-50704 user: Do not validate timezones in user objects
The validation of the timezone field should not occur, especially
when it is automatically cleaned. Timezones can be volatile, we
must try hard to fallback on real timezones and must not lose reset
the values arbitrarily.

"There is absolutely no need to change $CFG->timezone and user timezones
in database - the timezones may come and go. If you change the value in
upgrade or on the fly you would not be able to get it back. This is the
reason why I implemented the "invalid timezone" thing in server and
user settings instead." - Petr Skoda (MDL-49684)
2016-05-09 17:28:38 +08:00