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

Add new settings in the core_get_site_info

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.8.3, 2.9
    • Fix Version/s: 2.9
    • Component/s: Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable "Mobile services": Plugins ► Web Services ► Mobile
      2. Create a Token for the user (student) your are going to test with (and additional token for an admin user):
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
        • Click add, select user and service (Mobile Service)
      3. Next, you can do a CURL REST call simulating a WS client:
        • 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' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Cookie: MoodleSession=6jl8pbg3ndu6j70h4a56k0aea4' -H 'Connection: keep-alive' --data 'wsfunction=core_webservice_get_site_info&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed
          

      4. Confirm that:
        • You receive a json response containing these three attributes:
          usercanmanageownfiles
          userquota
          usermaxuploadfilesize
          With the correct values for the site, you may change the userquota global config and also the maxbytes global config to check if the function returns correctly the new values.
          If you call the web service as admin, you will receive 0 (admin can ignores the quotas) as userquota and -1 as usermaxuploadfilesize (admin can ignore limits)
      Show
      Enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the user (student) your are going to test with (and additional token for an admin user): Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (Mobile Service) Next, you can do a CURL REST call simulating a WS client: 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' -H 'Pragma: no-cache' -H 'Origin: file://' -H 'Accept-Encoding: gzip,deflate,sdch' -H 'Accept-Language: es,en;q=0.8,de-DE;q=0.6,de;q=0.4,nb;q=0.2' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1798.0 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Cache-Control: no-cache' -H 'Cookie: MoodleSession=6jl8pbg3ndu6j70h4a56k0aea4' -H 'Connection: keep-alive' --data 'wsfunction=core_webservice_get_site_info&wstoken=1b9cc9f44630b554bb2c9428b8744338' --compressed Confirm that: You receive a json response containing these three attributes: usercanmanageownfiles userquota usermaxuploadfilesize With the correct values for the site, you may change the userquota global config and also the maxbytes global config to check if the function returns correctly the new values. If you call the web service as admin, you will receive 0 (admin can ignores the quotas) as userquota and -1 as usermaxuploadfilesize (admin can ignore limits)
    • Affected Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Fixed Branches:
      MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49425-master

      Description

      We need additional user environment settings to be returned, like:

      Upload files size limit
      User storage quota (userquota)
      Whether the my files option is disabled (moodle/user:manageownfiles)
      Languages packs installed in the site

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/May/15