Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26645

should use constants instead of integers for "maildisplay"

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.2
    • Fix Version/s: BACKEND
    • Component/s: General
    • Labels:
    • Database:
      Any
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      On user profiles the maildisplay property always using straight integers. For example

      if ($user->maildisplay == 2 && is_enrolled($context, $user))

      This makes the code unnecessarily hard to read. Constants should be used.

      The values are:
      0 hide my email address
      1 allow everyone to see my email address
      2 only allow other users in a course with me to see my email address

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              moodle.com moodle.com
              Reporter:
              andyjdavis Andrew Davis
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: