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

Add new settings in the core_get_site_info

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.8.3, 2.9
    • 2.9
    • Web Services
    • MOODLE_28_STABLE, MOODLE_29_STABLE
    • MOODLE_29_STABLE
    • MDL-49425-master
    • 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)

    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

              jleyva Juan Leyva
              jleyva Juan Leyva
              Dani Palou Dani Palou
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Rajesh Taneja Rajesh Taneja
              Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/May/15