198 Commits

Author SHA1 Message Date
Andrew Nicols
99c1543aa8
MDL-79581 communication: Context is a mandatory field
The API was incorrectly assuming that all uses of the API were for a
course, and that the instanceid of the communication instance was a
course id. These assumptions are both entirely wrong.

The API is intended to support a range of uses including use at the
site, user, and activity levels.

Furthermore, if a group were to be used, then the instanceid should be
of that group's id, and therefore the contextid would need to be fetched
or that group's course instead.

The only solution here is to add a new contextid field to the table, and
implement it all parts of the API.
2023-10-04 20:37:57 +08:00
Matt Porritt
fc3fe7d329 MDL-67390 Authentication: Update password hashing to SHA-512
Update user password history tracking to use SHA-512 instead
of bcrypt.
2023-08-25 11:54:05 +10:00
Safat
ab3c78e873 MDL-77576 core_user: Update room membership on user update
This commit implements the communication api updates
when a user is updated. It handles the room membership
when a user is suspended and deleted.

Originally implemented as MDL-76703.

Co-authored-by: David Woloszyn <david.woloszyn@moodle.com>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>
2023-05-11 13:35:16 +10:00
Sara Arjona
9ce4fb65fd Merge branch 'MDL-77164-master' of https://github.com/marinaglancy/moodle 2023-04-13 14:00:18 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Sara Arjona
57589966bc Merge branch 'MDL-77468-master' of https://github.com/rmady/moodle 2023-04-13 09:19:54 +02:00
Juan Leyva
e464d2c8a1 MDL-77468 user: Make user profile visibility consistent web and ws 2023-04-11 09:24:40 -03:00
Alex Morris
9bc236d48d MDL-76722 user: Add new update_user_device_public_key webservice 2023-04-11 08:58:27 +08:00
Juan Leyva
76807203a3 MDL-77726 user: Fix custom user profiles supporting filtering in WS 2023-03-23 18:08:03 +01:00
Andrew Nicols
a3cc26f8bb MDL-76583 core: Update uses of external_* classes 2023-01-19 07:34:09 +08:00
Neill Magill
6fb4a3b56e MDL-72948 messaging: Minimise fields used in query
Most of the fields in the query are not needed and are discarded
soon after visibility checks are made.
2022-06-22 10:11:18 +01:00
Paul Holden
b6d8939959 MDL-72634 user: populate default city/country during user creation. 2022-03-22 17:28:09 +00:00
Mathew May
1cb3cb375d MDL-73554 core: Update usermenu metadata display 2022-01-17 15:09:06 +08:00
Huong Nguyen
8c336899a9 MDL-72867 Navigations: User menu improvements 2021-12-15 13:54:45 +07:00
Peter Dias
25e178aa59 MDL-71148 core_navigation: Move unauthenticated user checks to the lib
- Part of: MDL-69588
Added conditional information in user_get_user_navigation_info for
when a user is unauthenticated.
2021-08-23 17:45:55 +08: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
987e55452f MDL-45242 Course: Enrol feature supports custom profile fields 2021-03-10 10:57:11 +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
Michael Hawkins
2396e3156f MDL-68612 user: Unified filter deprecations - related library functions 2020-05-29 12:13:26 +08:00
Michael Hawkins
25d9dabdcf MDL-68348 user: User filter match types support - keywords/last access
The last access implementation also fixes an existing bug,
where it was assumed never accessed would be 0, when it also needed to
handle null to return correct results. Related userlib unit tests also
updated to reflect this, as well as some incorrect comment wording.
2020-05-25 18:35:08 +08:00
Luca Bösch
dfe22c29c2 MDL-67672 user: Display name in user menu as elsewhere. 2020-04-01 09:03:03 +02:00
Víctor Déniz Falcón
a98192b8c0 MDL-63895 user: Hide suspended enrolments to user without capability
Users without course:viewsuspendedusers capability should not view suspended
users on the participant list
2019-09-12 12:04:43 +01:00
Paul Holden
90ce66a9ce MDL-66178 user: filter course participants for users with no roles. 2019-08-02 16:42:10 +01:00
[Peter Burnett]
ad9c96e531 MDL-66123 core: check_password_policy takes $user argument 2019-07-29 14:37:50 +10:00
Jake Dallimore
0e0e1b4552 MDL-65566 core_user: remove the conversation creation code from lib.php
These are now lazy created in the messaging APIs, so we don't need
to create them on user creation any more.
2019-05-15 18:42:47 +08:00
Sara Arjona
bbbaeedfdc Merge branch 'MDL-65170-master' of https://github.com/snake/moodle 2019-04-24 09:02:20 +02:00
Sara Arjona
734b198fd3 MDL-64715 message: add support for self conversations
Added new MESSAGE_CONVERSATION_TYPE_SELF type for self-conversations
and upgraded legacy self-conversations to the new type, removing
repeated members in the message_conversation_members table.
Besides, from now, a self-conversation will be created by default for
all the existing users.

All the self-conversations have been also starred and a default message
will be displayed always to explain how to use them.
2019-04-15 20:17:54 +02:00
Jake Dallimore
152e41cccb MDL-65170 core_user: perf improvement for user_get_user_details_courses
We don't always need to iterate over the user's courses, so only fetch
them when we do.
2019-04-08 09:02:13 +08:00
Jake Dallimore
e4aaecd392 MDL-65170 core_user: user_get_user_details_courses respects groupmode
This had a relatively simply check for course profile visibility, which
meant that users in separate groups could see one another's profile.
This has been replaced with the more correct check in
user_can_view_profile().
2019-04-08 09:02:13 +08:00
Juan Leyva
1f87a7f653 MDL-64084 core_enrol: Return expect last access course time 2019-02-28 11:11:35 +01:00
Damyon Wiese
145a10f7a9 MDL-64570 user: input field purpose
Do not autocomplete the user fields when editing another user.
2019-02-20 09:42:26 +08:00
David Monllaó
7677a86cc0 Merge branch 'MDL-64570-master' of git://github.com/damyon/moodle 2019-02-19 06:45:21 +01:00
Damyon Wiese
2159983aff MDL-64570 accessibility: autocomplete user profile fields
Only if editing your own user details and not logged in as someone else.
2019-02-19 09:44:15 +08:00
Sara Arjona
c654e35007 MDL-63677 core_user: Avoid redirection during signup
Purge cache just for the current user to avoid redirection when 2
simultaneous users try to sign up at the same time and some policy
has to be agreed.
The 'createduser' invalidation event has been removed also because
is not used any more.
Thanks John Azinheira for spotting it!
2019-01-11 10:20:59 +01:00
David Monllao
85d4b77cd3 Merge branch 'MDL-61967-master' of git://github.com/sarjona/moodle 2018-09-25 11:08:53 +02:00
Sara Arjona
5290d0604b MDL-61967 core_user: Allow filtering by No groups on participants page
A new optional parameter $context has been added to the
core_group::groups_get_members_join() function.
Besides, some core_group methods now accept -1 (USERSWITHOUTHGROUP) for
the groupid field.
2018-09-24 18:33:45 +02:00
Kathrin Osswald
df8eec5206 MDL-61573 user: Changes to pix path for better support of fa mapping 2018-09-18 08:28:23 +02:00
Jun Pataleta
f239f97d34 Merge branch 'wip-MDL-62520_MASTER' of https://github.com/jason-platts/moodle 2018-09-10 16:22:48 +08:00
Víctor Déniz Falcón
b93767f3ee MDL-63255 core_user: fix harcoded sql table aliases 2018-09-03 06:53:40 +01:00
David Mudrák
784883e1ee MDL-63174 user: user_create_user to throw exception on empty username
The core API function user_create_user() did not check the case when the
given username was empty.

Also adding a missing string 'usernamelowercase' for the existing lower
case check and unit tests.
2018-08-17 13:24:31 +02:00
Jason Platts
e52856bc9a MDL-62520 user: User identity fields not searchable in Participants list 2018-08-03 10:35:24 +01:00
Mihail Geshoski
204178d646 MDL-61707 authentication: Remove presignup session upon user signup 2018-07-23 09:33:08 +08:00
Michael Hawkins
c157e137ee MDL-62618 user: Display full names consistently on users page 2018-07-05 10:08:33 +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
Eloy Lafuente (stronk7)
2f27dca60d Merge branch 'MDL-60548-master-v4' of https://github.com/Dave-B/moodle 2018-04-10 17:14:46 +02:00
Jan Dageförde
aa949cb2f9
MDL-61549 user: Remove $already columns because none were loaded yet 2018-02-27 14:47:44 +01:00
Igor Sazonov
358b10a337 MDL-58410 user: add support for alternative name search
The solution about searching all external names fields (middlename etc) from course enrolment page (enrolled and enrolling pages)
2018-01-24 11:15:45 +08:00
David Balch
565f3f25f0 MDL-60548 profile: Show profile email when 'maildisplay' allows it.
Adds 'email' to hiddenuserfields, which allows:
 * user to view email on their own profile,
 * users with cap site:viewuseridentity to view email on any profile (admins/teachers)
 * admin to veto display of email to users without site:viewuseridentity (except viewing their own)
 * unprivileged users to view if the profile's maildisplay permits it.

Changes in user/lib.php include removal of is_siteadmin() test, which
is redundant due to checks via has_capability().

Fixes regression from 2.9 (MDL-45774).
2018-01-15 12:21:09 +00:00
Juan Leyva
6db2423551 MDL-60738 webservice: Clean theme and lang properly
Sometimes the "theme" and "lang" fields in the user and course tables
in the database are set to incorrect values (uninstalled or
non-existent themes and language packs).
This makes Web Services functions to fail because the WS server
validate the returned data using the validate_param function that clean
parameters.
2017-11-20 09:37:30 +01:00