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

Unused code in user/index.php

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6.1
    • Fix Version/s: 2.7
    • Component/s: Administration
    • Labels:

      Description

      We have the following code in user/index.php

                  if (isset($userlistextra) && isset($userlistextra[$user->id])) {
                      $ras = $userlistextra[$user->id]['ra'];
                      $rastring = '';
                      foreach ($ras as $key => $ra) {
                          $rolename = $allrolenames[$ra['roleid']];
                          if ($ra['ctxlevel'] == CONTEXT_COURSECAT) {
                              $rastring .= $rolename. ' @ ' . '<a href="'.$CFG->wwwroot.'/course/index.php?categoryid='.$ra['ctxinstanceid'].'">'.s($ra['ccname']).'</a>';
                          } else if ($ra['ctxlevel'] == CONTEXT_SYSTEM) {
                              $rastring .= $rolename. ' - ' . get_string('globalrole', 'role');
                          } else {
                              $rastring .= $rolename;
                          }
                      }
                      $data[] = $rastring;
                      echo "Test", $groupmode;
                      if ($groupmode != 0) {
                          echo "Test";
                          // Use htmlescape with s() and implode the array.
                          $data[] = implode(', ', array_map('s', $userlistextra[$user->id]['group']));
                          $data[] = implode(', ', array_map('s', $userlistextra[$user->id]['gping']));
                      }
                  }
      

      $userlistextra is never defined. We should either remove this code or fix to do what it was supposed to do.

        Attachments

          Activity

            People

            Assignee:
            andyjdavis Andrew Davis
            Reporter:
            ankit_frenz Ankit Agarwal
            Peer reviewer:
            Andrew Nicols
            Integrator:
            Sam Hemelryk
            Tester:
            Simey Lameze
            Participants:
            Component watchers:
            Andrew Nicols, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/May/14