179 Commits

Author SHA1 Message Date
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
Sara Arjona
4bcb0a9a1d MDL-60550 user: Add more restrictions in keyword searches
Original patch provided by Tim Schroeder.
2017-11-09 16:29:29 +08:00
Damyon Wiese
bb869f05e8 MDL-60579 user: Move defines into library
Entry page user/index.php was defining constants that were used by the renderer.
This means the renderer was tied to user/index.php.
2017-11-09 11:06:30 +08:00
Marina Glancy
b47fda7191 MDL-60029 core_user: new api functions rearranged 2017-10-10 10:34:55 +08:00
Mike Churchward
860f59b13c MDL-60029 core_user: Added new api function to reduce db calls. 2017-10-09 14:10:38 +08:00
Jake Dallimore
eb01e70b91 MDL-58953 user: fix course checking logic in user_can_view_profile()
Make sure to check that $user in enrolled in $course before checking
whether the current user has capabilities in that course, and make sure
that we don't check user context caps when handling a specific course.
2017-09-07 10:53:33 +02:00
Jake Dallimore
067accce47 MDL-59825 user: user_can_view_profile() checks all of a $user's courses
This function used to check only those courses shared by both users
when it should have been checking all courses in which $user is
enrolled. Managers can view a user's course profile without necessarily
sharing the course (being enrolled in) with the $user.
2017-08-18 08:29:37 +08:00
Jake Dallimore
4d068a6708 MDL-59172 user: user_can_view_profile() now checks viewalldetails cap 2017-08-07 09:27:04 +08:00
Jun Pataleta
9651e491d8 MDL-59366 user: Create a unified filter for participants page
Part of MDL-59290.
2017-07-31 13:04:06 +08:00
Jun Pataleta
fb7929677a MDL-59369 user: Add status column to the participants table 2017-07-26 09:42:38 +08:00
Andrew Nicols
e18ebf3999 Merge branch 'MDL-59367-master' of git://github.com/damyon/moodle 2017-07-25 15:02:55 +08:00
Damyon Wiese
73d0d56284 MDL-59367 user: Tests and coding style
Add a unit test for user_roles_editable.
Coding style fixes.
Don't show duplicate roles.
2017-07-21 10:25:25 +08:00
Damyon Wiese
5d0b4765d8 MDL-59367 roles: Add roles to participants page. 2017-07-21 09:52:14 +08:00
Jun Pataleta
a9991533fa MDL-59436 user: Render city and country based on $CFG->showuseridentity
* I also fixed the redundant generation of query fields in
  user_get_participants_sql().
2017-07-21 08:46:23 +08:00
Mark Nelson
bc47b70667 MDL-59395 core_user: move participants table to own class
Removed the edit link variable which was used in the heading
'Users with the role ..' but was never displayed due to filters.

Other minor tidy ups as well.

Part of MDL-59290.
2017-07-05 14:51:41 +08:00
Simey Lameze
f3dacc3860 MDL-58617 core_output: add mapping for dashboard on user menu 2017-04-20 13:56:13 +08:00
Eloy Lafuente (stronk7)
79262cb681 Merge branch 'MDL-57840-33-get_users_by_field' of https://github.com/roperto/moodle 2017-03-21 01:05:47 +01:00
Ankit Agarwal
58d85af209 MDL-56526 userlib: Do not allow not loggedin users if forceloginforprofile is set 2017-03-10 18:03:52 +00:00
Daniel Thee Roperto
b80caca188 MDL-57840 libraries: Fixed missing fields in get_users_by_field(). 2017-02-22 16:07:14 +11:00
Ankit Agarwal
3e40dc8c61 MDL-58032 core_user: Fix case when acting user is a visitor 2017-02-22 09:00:45 +05:30