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

Let the embed.php redirect to login (requirement for the app)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 3.8
    • Component/s: H5P
    • Labels:
    • Testing Instructions:
      Hide

      Setup

      1. Upload the test-h5p.html file to the $CFG->wwwroot.
      2. Login as admin.
      3. Create a student (s1).
      4. Create a course "Course 1".
      5. Access to the course.
      6. Enrol s1 to the course.
      7. Create a "Folder" resource.
      8. Upload the arithmetic-quiz.h5p to the "Folder".

      Testing scenario 1. No redirection vs redirection

      1. Login as admin.
      2. Go to the "Course 1".
      3. Click on the "Folder" resource and copy the URL for the arithmetic-quiz.h5p file.
      4. Open $CFG->wwwroot/test-h5p.html in a new tab.
      5. Paste the previous URL into the "H5P file URL" form field.
      6. Click the Display button.
      7. Check the H5P content is displayed and working as expected.
      8. Open a different browser (for instance, if you're using Chrome, open Firefox).
      9. Open $CFG->wwwroot/test-h5p.html
      10. Paste the previous URL into the "H5P file URL" form field.
      11. Click the Display button.
      12. Check the following error is displayed: "Course or activity not accessible. (You are not logged in)"
      13. Open $CFG->wwwroot/test-h5p.html
      14. Paste the previous URL into the "H5P file URL" form field.
      15. Select the "preventredirect" checkbox.
      16. Click the Display button.
      17. Check the page is redirected to the login page.
      18. Login as s1.
      19. Check the H5P content is displayed and working as expected.
      Show
      Setup Upload the test-h5p.html file to the $CFG->wwwroot. Login as admin. Create a student (s1). Create a course "Course 1". Access to the course. Enrol s1 to the course. Create a "Folder" resource. Upload the arithmetic-quiz.h5p to the "Folder". Testing scenario 1. No redirection vs redirection Login as admin. Go to the "Course 1". Click on the "Folder" resource and copy the URL for the arithmetic-quiz.h5p  file. Open $CFG->wwwroot/test-h5p.html in a new tab. Paste the previous URL into the "H5P file URL" form field. Click the Display button. Check  the H5P content is displayed and working as expected. Open a different browser (for instance, if you're using Chrome, open Firefox). Open $CFG->wwwroot/test-h5p.html Paste the previous URL into the "H5P file URL" form field. Click the Display button. Check the following error is displayed: "Course or activity not accessible. (You are not logged in)" Open $CFG->wwwroot/test-h5p.html Paste the previous URL into the "H5P file URL" form field. Select the "preventredirect" checkbox. Click the Display button. Check the page is redirected to the login page. Login as s1. Check  the H5P content is displayed and working as expected.
    • Affected Branches:
      MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-67076-master
    • Sprint:
      H5P Sprint Relase 3.8

      Description

      Dani Palou has raised this issue:

      When the embed.php file is opened in a browser where the user is not logged in, an error is displayed, instead of redirecting the user to the login page.

      The mobile app won't have a Moodle web session in the iframe. It has a script to auto-login the user in the iframe, but it has some limitations (e.g. it only works in https sites) so it'd be nice if the user can authenticate manually inside the iframe if we cannot authenticate him automatically.

      A new parameter will be added to the embed to let the app to use it to redirect (instead of display the error).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sarjona Sara Arjona (@sarjona)
              Reporter:
              sarjona Sara Arjona (@sarjona)
              Peer reviewer:
              Dani Palou
              Integrator:
              Andrew Nicols
              Tester:
              Janelle Barcega
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 40 minutes
                  1h 40m