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

Replace xmlrpc extension in MNet by php library

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 4.1
    • 4.1
    • MNet
    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • Hide

      1 Sanity checks

      1. Note that we exclude from all these operations both the webservice (will be done @ MDL-76052) and the phpxmlrpc library itself.
      2. Verify that there are not uses of any xmlrpc_xxxx function in core anymore:

        grep -Pr 'xmlrpc_decode_request|xmlrpc_decode|xmlrpc_encode_request|xmlrpc_encode|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type' --exclude-dir phpxmlrpc --exclude-dir webservice | grep ".php"
        

      3. Verify that the only uses of xmlrpc in general are in upgradelib stuff (and its tests) (will be amended @ MDL-76053).

        grep -Pr '[^_>p\.]xmlrpc_' --exclude-dir phpxmlrpc --exclude-dir webservice | grep ".php"
        

      2 Testing Moodle ==> Mahara portfolio (MDLQA-314)

      • Please, use PHP 7.4 to run this test. Mahara needs patching to be used with PHP 8.0.
      • Ensure that the site is using the master branch of integration.git
      • Use a different browser for each site.
      1. Repeat the testing instructions of MDLQA-314
      2. Verify they pass ok.

      3 Testing Moodle <==> Moodle SSO / roaming (MDL-74394)

      • Please, use PHP 8.0 to run this test.
      • Ensure that site1 is using the master branch of integration.git and site2 is using MOODLE_400_STABLE (to guarantee that we check BC/inter operability).
      • Use a different browser for each site.
      1. Repeat the testing instructions of MDL-74394 (ignore the ngrok and self signed cert. requirements there - that isn't needed)
      2. Verify they pass ok.

      4 Testing Moodle ==> Moodle enrolments

      • Please, use BOTH PHP 7.4 and 8.0 to run this test.
      • The sites created in the previous test can be used here, instead of installing new ones.
      • Use a different browser for each site.
      • Logged in as admins in both sites.
      1. Configuring "site1" to be able to apply for enrolments, the one using integration.git, master branch:
        1. Go to Admin -> Networking -> Manage peers and in the list click on the "site2" link. In the Services tab tick on "Subscribe" the "Remote enrolment service". And ensure that "Publish" is not ticked. Also, confirm that the FOUR SSO settings (IdP and SP publish and subscribe are ticked from previous test).
        2. This should be set from previous tests, but go to Admin -> Users -> Define roles and ensure that the Authenticated user role has the "moodle/site:mnetlogintoremote" allowed. Allow it if needed to (so we guarantee that all users in "site1" can use MNet SSO/roaming.
        3. Create a few users (3-4) in "site1".
        4. With this, "site1" is ready to apply for remote enrolments in "site2".
      2. Configuring "site2" (that will accept remote enrolments, the one using MOODLE_400_STABLE):
        1. Go to Admin -> Plugins -> Manage enrol plugins and enable "MNet remote enrolments"
        2. Go to Admin -> Networking -> Manage peers and in the list click on the "site1" link. In the Services tab tick on "Publish" the "Remote enrolment service". And ensure that "Subscribe" is not ticked. Also, confirm that the FOUR SSO settings (IdP and SP publish and subscribe are ticked from previous test).
        3. Create a couple of courses: Course21 and Course22
        4. In Course21 -> Participants, select "Enrolment methods" and add the "MNet remote enrolments" method, selecting "site1" in the "Remote host" dropdown. Press "Add method".
        5. With this, "site2" is ready to accept remote enrolments from "site1".
      3. Verifying that remote enrolments work ("site1" ==> "site2")
        1. In "site1", go to Admin -> Networking -> Remote enrolments client.
        2. Verify that you see one line with Application = Moodle and Host name being site2.
        3. Click on "Edit enrolments" button.
        4. If there is a "Re-fetch" button, click on it.
        5. Verify that in the list of courses from "site2" you see "Course21" but don't see "Course22".
        6. Go to "site2" and in Course22 -> Participants, select "Enrolment methods" and add the "MNet remote enrolments" method, selecting "site1" in the "Remote host" dropdown. Press "Add method".
        7. Back to "site1" refresh the "Remote enrolments client" page.
        8. Verify that now both Course21 and Course22 are shown in the list.
        9. Click the "Edit enrolments" button of Course22.
        10. Select a couple of users and "Add" them, so they show on the left column.
        11. In "site2", go to Course22 -> participants
        12. Verify that the 2 users added from site1 are listed now and displayed as "Active"
        13. Click on the little "i" (information).
        14. Verify that you see "MNet remote enrolments (site1)" in the information.
        15. Back to "site1", remove one of the 2 enrolled users. Annotate it.
        16. In "site2", refresh the participants page.
        17. Verify that now only one user is listed and the annotated user in "site1" does not show anymore. Annotate it.
        18. Back to "site1", verify that the "Network servers" is in front page (from previous tests). Add it if missing.
        19. Logout from the admin session.
        20. Login in "site1" as the annotated user (the one remaining from the 2 originally enrolled).
        21. In the front page, click on the "site2" link in the "Networks servers" block.
        22. Verify that the user is automatically roamed to "site2" and you see the "Welcome back userxxx" message.
        23. Go to "My courses".
        24. Verify that Course22 is shown (that means the user in enrolled).
        25. Click in the "Course22" link.
        26. Verify the user access to the course without any problem.
        27. Logout from "site2".
        28. Verify that you're automatically redirected back to "site1" (not logged-in).

      5 Testing Moodle <==> Moodle key-swapping

      • Please, use BOTH PHP 7.4 and 8.0 to run this test.
      • The sites created in the previous test can be used here, instead of installing new ones.
      • Use a different browser for each site.
      • Logged in as admins in both sites.
      1. "site1" examines "site2" public key.
        1. In "site1" go to Admin -> Networking -> Peers -> "site2".
        2. Verify that you see a form, with the name of "site2", its URL and other fields.
        3. Verify that there is a bit text field with a Public key.
        4. Verify that there isn't any error shown about the key being incorrect.
        5. Edit the public key and change some char. Save changes.
        6. Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key."
        7. In "site1" go to go to Admin -> Networking -> Peers -> "site2" again.
        8. In "site2" go to Admin -> Networking -> Settings.
        9. Click on "Delete key" and confirm the deletion (in an ugly page).
        10. Verify that you see "Your key has been successfully deleted and replaced."
        11. Back to "site1" refresh the page.
        12. Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing".
        13. Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes.
        14. In "site1" go to go to Admin -> Networking -> Peers -> "site2" again.
        15. Verify that there isn't any error shown about the key being incorrect.
      2. "site2" examines "site1" public key.
        1. In "site2" go to Admin -> Networking -> Peers -> "site1".
        2. Verify that you see a form, with the name of "site1", its URL and other fields.
        3. Verify that there is a bit text field with a Public key.
        4. Verify that there isn't any error shown about the key being incorrect.
        5. Edit the public key and change some char. Save changes.
        6. Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key."
        7. In "site2" go to go to Admin -> Networking -> Peers -> "site1" again.
        8. In "site1" go to Admin -> Networking -> Settings.
        9. Click on "Delete key" and confirm the deletion (in an ugly page).
        10. Verify that you see "Your key has been successfully deleted and replaced."
        11. Back to "site2" refresh the page.
        12. Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing".
        13. Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes.
        14. In "site2" go to go to Admin -> Networking -> Peers -> "site1" again.
        15. Verify that there isn't any error shown about the key being incorrect.
      Show
      1 Sanity checks Note that we exclude from all these operations both the webservice (will be done @ MDL-76052 ) and the phpxmlrpc library itself. Verify that there are not uses of any xmlrpc_xxxx function in core anymore: grep -Pr 'xmlrpc_decode_request|xmlrpc_decode|xmlrpc_encode_request|xmlrpc_encode|xmlrpc_get_type|xmlrpc_is_fault|xmlrpc_parse_method_descriptions|xmlrpc_server_add_introspection_data|xmlrpc_server_call_method|xmlrpc_server_create|xmlrpc_server_destroy|xmlrpc_server_register_introspection_callback|xmlrpc_server_register_method|xmlrpc_set_type' --exclude-dir phpxmlrpc --exclude-dir webservice | grep ".php" Verify that the only uses of xmlrpc in general are in upgradelib stuff (and its tests) (will be amended @ MDL-76053 ). grep -Pr '[^_>p\.]xmlrpc_' --exclude-dir phpxmlrpc --exclude-dir webservice | grep ".php" 2 Testing Moodle ==> Mahara portfolio ( MDLQA-314 ) Please, use PHP 7.4 to run this test. Mahara needs patching to be used with PHP 8.0. Ensure that the site is using the master branch of integration.git Use a different browser for each site. Repeat the testing instructions of MDLQA-314 Verify they pass ok. 3 Testing Moodle <==> Moodle SSO / roaming ( MDL-74394 ) Please, use PHP 8.0 to run this test. Ensure that site1 is using the master branch of integration.git and site2 is using MOODLE_400_STABLE (to guarantee that we check BC/inter operability). Use a different browser for each site. Repeat the testing instructions of MDL-74394 (ignore the ngrok and self signed cert. requirements there - that isn't needed) Verify they pass ok. 4 Testing Moodle ==> Moodle enrolments Please, use BOTH PHP 7.4 and 8.0 to run this test. The sites created in the previous test can be used here, instead of installing new ones. Use a different browser for each site. Logged in as admins in both sites. Configuring "site1" to be able to apply for enrolments, the one using integration.git, master branch: Go to Admin -> Networking -> Manage peers and in the list click on the "site2" link. In the Services tab tick on "Subscribe" the "Remote enrolment service". And ensure that "Publish" is not ticked. Also, confirm that the FOUR SSO settings (IdP and SP publish and subscribe are ticked from previous test). This should be set from previous tests, but go to Admin -> Users -> Define roles and ensure that the Authenticated user role has the "moodle/site:mnetlogintoremote" allowed. Allow it if needed to (so we guarantee that all users in "site1" can use MNet SSO/roaming. Create a few users (3-4) in "site1". With this, "site1" is ready to apply for remote enrolments in "site2". Configuring "site2" (that will accept remote enrolments, the one using MOODLE_400_STABLE): Go to Admin -> Plugins -> Manage enrol plugins and enable "MNet remote enrolments" Go to Admin -> Networking -> Manage peers and in the list click on the "site1" link. In the Services tab tick on "Publish" the "Remote enrolment service". And ensure that "Subscribe" is not ticked. Also, confirm that the FOUR SSO settings (IdP and SP publish and subscribe are ticked from previous test). Create a couple of courses: Course21 and Course22 In Course21 -> Participants, select "Enrolment methods" and add the "MNet remote enrolments" method, selecting "site1" in the "Remote host" dropdown. Press "Add method". With this, "site2" is ready to accept remote enrolments from "site1". Verifying that remote enrolments work ("site1" ==> "site2") In "site1", go to Admin -> Networking -> Remote enrolments client. Verify that you see one line with Application = Moodle and Host name being site2. Click on "Edit enrolments" button. If there is a "Re-fetch" button, click on it. Verify that in the list of courses from "site2" you see "Course21" but don't see "Course22". Go to "site2" and in Course22 -> Participants, select "Enrolment methods" and add the "MNet remote enrolments" method, selecting "site1" in the "Remote host" dropdown. Press "Add method". Back to "site1" refresh the "Remote enrolments client" page. Verify that now both Course21 and Course22 are shown in the list. Click the "Edit enrolments" button of Course22. Select a couple of users and "Add" them, so they show on the left column. In "site2", go to Course22 -> participants Verify that the 2 users added from site1 are listed now and displayed as "Active" Click on the little "i" (information). Verify that you see "MNet remote enrolments (site1)" in the information. Back to "site1", remove one of the 2 enrolled users. Annotate it. In "site2", refresh the participants page. Verify that now only one user is listed and the annotated user in "site1" does not show anymore. Annotate it. Back to "site1", verify that the "Network servers" is in front page (from previous tests). Add it if missing. Logout from the admin session. Login in "site1" as the annotated user (the one remaining from the 2 originally enrolled). In the front page, click on the "site2" link in the "Networks servers" block. Verify that the user is automatically roamed to "site2" and you see the "Welcome back userxxx" message. Go to "My courses". Verify that Course22 is shown (that means the user in enrolled). Click in the "Course22" link. Verify the user access to the course without any problem. Logout from "site2". Verify that you're automatically redirected back to "site1" (not logged-in). 5 Testing Moodle <==> Moodle key-swapping Please, use BOTH PHP 7.4 and 8.0 to run this test. The sites created in the previous test can be used here, instead of installing new ones. Use a different browser for each site. Logged in as admins in both sites. "site1" examines "site2" public key. In "site1" go to Admin -> Networking -> Peers -> "site2". Verify that you see a form, with the name of "site2", its URL and other fields. Verify that there is a bit text field with a Public key. Verify that there isn't any error shown about the key being incorrect. Edit the public key and change some char. Save changes. Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key." In "site1" go to go to Admin -> Networking -> Peers -> "site2" again. In "site2" go to Admin -> Networking -> Settings. Click on "Delete key" and confirm the deletion (in an ugly page). Verify that you see "Your key has been successfully deleted and replaced." Back to "site1" refresh the page. Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing". Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes. In "site1" go to go to Admin -> Networking -> Peers -> "site2" again. Verify that there isn't any error shown about the key being incorrect. "site2" examines "site1" public key. In "site2" go to Admin -> Networking -> Peers -> "site1". Verify that you see a form, with the name of "site1", its URL and other fields. Verify that there is a bit text field with a Public key. Verify that there isn't any error shown about the key being incorrect. Edit the public key and change some char. Save changes. Verify that you're redirected back to the form and you see the error: "The key is not a valid SSL key." In "site2" go to go to Admin -> Networking -> Peers -> "site1" again. In "site1" go to Admin -> Networking -> Settings. Click on "Delete key" and confirm the deletion (in an ugly page). Verify that you see "Your key has been successfully deleted and replaced." Back to "site2" refresh the page. Verify that now you see the message "The public key you are holding for this host is different from the public key it is currently publishing". Copy the new public key that is available under the message above and paste it in the "public key" field of the form. Save changes. In "site2" go to go to Admin -> Networking -> Peers -> "site1" again. Verify that there isn't any error shown about the key being incorrect.

      This issue was originally MDL-70889, now converted in an Epic to control all the associated issues (like this, that is part of the Epic now).

      For more details about the evolution, please, read the information in the Epic.

      Basically, what we are doing here is to replace all the uses of the xmlrpc php extension by the phpxmlrpc library for all MNet functionalities (SSO, roam, mahara portfolio export).

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Jun Pataleta Jun Pataleta
            Jake Dallimore Jake Dallimore
            Jake Dallimore Jake Dallimore
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 4 hours, 30 minutes
                4d 4h 30m

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