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).
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.
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.
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.
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.
A bug introduced with MDL-45893 meant that the failure count was being
reset, causing the footer code to be skipped. This patch fixes that
bug and adds behat tests covering the displayloginfailures feature.
This commit replace as much as possible of clean_param and PARAM_ usages related to user object.
Also few unit tests has been changed to match the new validation
The new validation were added to user_create_user and user_update_user,
displaying debug message if some invalid data has been found.
Also the unit tests of those methods has been changed to match the methods behaviour.
Added an @array "options" parameter to user_get_user_navigation_info(),
for passing in avatarsize, and possibly other options in future.
Also removed an errant parameter in the /lib/outputrenderers.php
user_get_user_navigation_info() call, as there was no corresponding
parameter in the function definition.
(Test written by Jetha Chan.)
As a result of MDL-49632, the preferred language is no longer part of
the "Add a new user" form. So the lang property is not passed to the
user_create_user() when creating a new user and the value always falls
back to "en" (which is the default defined in the database for this
column).
This patch makes sure that the site default language is used in such
case.