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
..