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

tool_usertours blocks upgrade if admin directory renamed.

    XMLWordPrintable

Details

    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_33_STABLE, MOODLE_34_STABLE
    • MDL-60762-master
    • Hide

      Abandon of renaming admin directory (used for hiding admin scripts for security reasons) or

      deleting the folder tool\usertours in administration folder.

      Show
      Abandon of renaming admin directory (used for hiding admin scripts for security reasons) or deleting the folder tool\usertours in administration folder.
    • Hide

      Note: This is easier to test with MDK.

      1. Open your terminal and go to your moodle instance's root directory.
      2. If your moodle instance is currently installed, uninstall it:

        mdk uninstall

      3. Checkout the 3.1 branch:

        git checkout MOODLE_31_STABLE
        

      4. Install the Moodle 3.1 instance

        mdk install -r mindev
        

      5. Checkout the branch you're testing on.
        • 33

          git checkout MOODLE_33_STABLE

        • 34

          git checkout MOODLE_34_STABLE

        • master

          git checkout master

      6. Rename admin directory. (e.g. 'cooladmin').
      7. Edit config.php and set the value for $CFG->admin to 'cooladmin'.

        $CFG->admin = 'cooladmin';

      8. Open your moodle instance in your browser and run through the upgrade.
        • Confirm that the upgrade process successfully completes.

      After the test, don't forget to revert the changed admin folder back to admin

      Show
      Note: This is easier to test with MDK. Open your terminal and go to your moodle instance's root directory. If your moodle instance is currently installed, uninstall it: mdk uninstall Checkout the 3.1 branch: git checkout MOODLE_31_STABLE Install the Moodle 3.1 instance mdk install -r mindev Checkout the branch you're testing on. 33 git checkout MOODLE_33_STABLE 34 git checkout MOODLE_34_STABLE master git checkout master Rename admin directory. (e.g. 'cooladmin'). Edit config.php and set the value for $CFG->admin to 'cooladmin'. $CFG->admin = 'cooladmin'; Open your moodle instance in your browser and run through the upgrade. Confirm that the upgrade process successfully completes. After the test, don't forget to revert the changed admin folder back to admin

    Description

      If admin directory is renamed to something else (according to good security practice), usertours blocks the  upgrade of Moodle or when installed before renaming the admin directory doesn't appear in Administration->Appearance at all.

      Hardcoded 'admin' directory is the reason for this situation. 

      Examples of code:

      $filepath = $CFG->dirroot . '/admin/tool/usertours/tours/' . $filename;

      To reproduce bug: 

      1. install version prior to 3.2 of Moodle
      2. rename admin directory to ie. cooladmin,
      3. set the $CFG->admin='cooladmin'
      4. replace the Moodle code for version 3.2 or later
      5. rename admin directory to cooladmin,
      6. copy proper config.php (with the $CFG->admin='cooladmin' set )
      7. Run an upgrade.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adamtppaw Adam Pawełczak
              Andrew Lyons Andrew Lyons
              Jun Pataleta Jun Pataleta
              Gladys Basiana Gladys Basiana
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours
                  3h

                  Clockify

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