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

Redirection not working on pluginfile.php when user has to log in

XMLWordPrintable

    • MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • m28_MDL-47210_IIS_PATH_INFO_Ignored_In_Required_Login_Pluginfile_Redirect
    • Hide

      (difficulty: medium, requires teacher access to a course on a Moodle instance properly configured to run under IIS, regardless the Database server, and OS administrator access to the server hosting the instance, to change some registry settings)

      Required login redirect test.

      1. Publish a resource, e.g. a PDF, whose name is plain ASCII text in a restricted access course (no guest, no front page) and take note of its URL e.g. http://hostname/path/to/moodle/pluginfile.php/<NNN>/mod_resource/content/<MMM>/<filename>;
      2. Log out and clean your browser cache;
      3. Copy the URL above in your browser: you should be redirected to the login page and than, after a successful login, to the requested resource;

      UTF-8 encoding support test (out of scope but the main reason of this bug).

      1. Change the IIS configuration - if not already done at the time of creating a proper IIS configuration of the server hosting the Moodle instance - to support the UTF-8 encoding on Server Variables:
        • reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO
        • iisreset
      2. Repeat the first test by adding a resource whose filename has been renamed using whatever UTF-8-based name you prefer e.g. by using Google Translate, keeping the original extension => これは動作します.txt.
      Show
      (difficulty: medium, requires teacher access to a course on a Moodle instance properly configured to run under IIS, regardless the Database server, and OS administrator access to the server hosting the instance, to change some registry settings) Required login redirect test. Publish a resource, e.g. a PDF, whose name is plain ASCII text in a restricted access course (no guest, no front page) and take note of its URL e.g. http://hostname/path/to/moodle/pluginfile.php/ <NNN>/mod_resource/content/<MMM>/<filename> ; Log out and clean your browser cache; Copy the URL above in your browser: you should be redirected to the login page and than, after a successful login, to the requested resource; UTF-8 encoding support test (out of scope but the main reason of this bug). Change the IIS configuration - if not already done at the time of creating a proper IIS configuration of the server hosting the Moodle instance - to support the UTF-8 encoding on Server Variables : reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO iisreset Repeat the first test by adding a resource whose filename has been renamed using whatever UTF-8-based name you prefer e.g. by using Google Translate, keeping the original extension => これは動作します.txt.

      When a user has a direct link to a resource within Moodle they are forced to log in if not already in and they are successfully redirected to that resource.

      However, when they have a link to a file and they are forced to log in, the link is truncated from

      http://<site>/pluginfile.php/17521/mod_resource/content/11/<filename>

      to

      https://<site>/pluginfile.php

      and gives an error message

      'No valid arguments supplied or incorrect server configuration'

      rather than redirecting to the original link.

      The link to the files work if logged in, so it looks as though the redirect for pluginfile.php is not working correctly

            matteo Matteo Scaramuccia
            wullie William Mair
            Marina Glancy Marina Glancy
            Damyon Wiese Damyon Wiese
            Damyon Wiese Damyon Wiese
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

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