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

timezone parameter in create_user web service function in /user/externallib.php throwing error

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.3, 2.1
    • Fix Version/s: 2.0.4
    • Component/s: Web Services
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      TESTCASE 1:
      Run testmoodlelib.php simpletest.

      Instructions to run testmoodlelib.php simpletest
      1. Navigate to unit test (Development -> unit test)
      2. enter "lib/simpletest/testmoodlelib.php" in textbox.
      3. click "Run test"

      TESTCASE 2:
      1. Enable Webservices
      2. Run unit test (Site adminstration -> Development -> unit tests) "webservice/simpletest/testwebservice.php".

      How to Enable webservices
      1. Enable web services (Site adminstration -> Advanced features)
      2. Enable protocols (Site adminstration -> Plugins -> Web Services -> Manage Protocols ). Enable Rest &/ XMLRPC
      3. Add External services ( Site adminstration -> Plugins -> Web Services -> External Services). Add function "moodle_user_create_users" to this external service
      4. Manage Tokens ( Site adminstration -> Plugins -> Web Services -> Manage Tokens). Add the "External Service" which we created in step 3 and copy the token value.
      5. Open webservice/simpletest/testwebservice.php and replace $this->testtoken value with above token value.
      6. set " $this->testxmlrpc" or "$this->testrest" to true
      7. set moodle_user_create_users to true.
      8. Now you are ready to run simple test

      Show
      TESTCASE 1: Run testmoodlelib.php simpletest. Instructions to run testmoodlelib.php simpletest 1. Navigate to unit test (Development -> unit test) 2. enter "lib/simpletest/testmoodlelib.php" in textbox. 3. click "Run test" TESTCASE 2: 1. Enable Webservices 2. Run unit test (Site adminstration -> Development -> unit tests) "webservice/simpletest/testwebservice.php". How to Enable webservices 1. Enable web services (Site adminstration -> Advanced features) 2. Enable protocols (Site adminstration -> Plugins -> Web Services -> Manage Protocols ). Enable Rest &/ XMLRPC 3. Add External services ( Site adminstration -> Plugins -> Web Services -> External Services). Add function "moodle_user_create_users" to this external service 4. Manage Tokens ( Site adminstration -> Plugins -> Web Services -> Manage Tokens). Add the "External Service" which we created in step 3 and copy the token value. 5. Open webservice/simpletest/testwebservice.php and replace $this->testtoken value with above token value. 6. set " $this->testxmlrpc" or "$this->testrest" to true 7. set moodle_user_create_users to true. 8. Now you are ready to run simple test
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Pull Master Branch:
      wip-mdl-27759-integration-master

      Description

      In create_user webservice function (/user/externallib.php), throw error for string timezones.
      This is happening because parameter check for timezone is PARAM_ALPHANUMEXT and it doesn't allow '/' (which string timezone format).

      Currently we don't have any PARAM defined for timzones, so probably we can define a new PARAM for timezone which should check for string to be either float or string with max one '/'

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  1/Aug/11