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

Return site policy in tool_mobile_get_config (Backport of MDL-60005)

XMLWordPrintable

    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • Hide
      1. As admin add a sitepolicy global setting on your site pointing to any URL (it may not exists)
      2. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      3. Create a Token for one normal user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      4. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      5. Check that among all the fields in the curl response (settings field), you receive a field with name sitepolicy and value the URL you used.
      Show
      As admin add a sitepolicy global setting on your site pointing to any URL (it may not exists) As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token for one normal user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=tool_mobile_get_config&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Check that among all the fields in the curl response (settings field), you receive a field with name sitepolicy and value the URL you used.

      This will help to fix a mobile app bug in Moodle 3.3 and 3.2 (MOBILE-2209)

      We need the site policy link to allow the user to accept it when is configured in that way.

      The backport should be very safe because we are not changing the Web Services parameters or return structures (we return a generic array of name/value settings so adding extra settings there is safe)

            jleyva Juan Leyva
            jleyva Juan Leyva
            David Monllaó David Monllaó
            Jun Pataleta Jun Pataleta
            Simey Lameze Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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