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

tool_usertours blocks upgrade if admin directory renamed.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2.5, 3.3, 3.3.2, 3.4
    • Fix Version/s: 3.3.6, 3.4.3
    • Component/s: User Tours
    • Labels:
    • Testing Instructions:
      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
    • Workaround:
      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.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60762-master

      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

              Assignee:
              Unassigned
              Reporter:
              adamtppaw Adam Pawełczak
              Peer reviewer:
              Andrew Nicols
              Integrator:
              Jun Pataleta
              Tester:
              Gladys Basiana
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                17/May/18

                  Time Tracking

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