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

Unenrol self button shows on profile, but cant complete

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9
    • Component/s: General, Roles / Access
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Bug in user/view.php that shows the unenrol self button when you don't have the moodle/role:unassignself, but you do the moodle/role:assign role. To bring this more in line with how course/unenrol.php and the admin block work, it should be changed so that the button doesn't show (you get an error if you try to use it anyways.

      This is a diff of my proposed fix:

      Index: user/view.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/user/view.php,v
      retrieving revision 1.168.2.4
      diff -r1.168.2.4 view.php
      451c451
      < (has_capability('moodle/role:assign', $coursecontext, NULL) && // I can assign roles

      > ($user->id != $USER->id && has_capability('moodle/role:assign', $coursecontext, NULL) && // I can assign roles

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            skodak Petr Skoda added a comment -

            fixed in cvs, thanks for the report and patch.

            Show
            skodak Petr Skoda added a comment - fixed in cvs, thanks for the report and patch.
            Hide
            fox Séverin Terrier added a comment -

            The unenroll link is not present anymore when you don't have unassignself capability in latest 1.9 beta 4.
            Closing

            Show
            fox Séverin Terrier added a comment - The unenroll link is not present anymore when you don't have unassignself capability in latest 1.9 beta 4. Closing

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  3/Mar/08