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

Manage site administrators to throw events triggers

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.0
    • Administration, Events API
    • None
    • MOODLE_20_STABLE
    • Easy

      When adding or removing the role of site administrator in http://../moodle/admin/roles/admins.php?section=admins ,
      it doesn't throw an event trigger like when other roles are assigned or unassigned.

      i managed to do a little peace of code to fix that, is not perfect but it's a start.
      here's a preview

      // Create a new entry
      $ra = new object();
      $ra->roleid = 0; // admin
      $ra->contextid = 1;
      $ra->userid = $confirmdel;
      $ra->modifierid = empty($USER->id) ? 0 : $USER->id;
      events_trigger('role_unassigned', $ra);
      OR events_trigger('role_assigned', $ra);

      full file in attachment

            Unassigned Unassigned
            pofis Ricardo Pinto (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.