Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29276 META- Web service improvements for 2.2
  3. MDL-29931

Review SQL statement in login/token.php and remove unneeded join and selects

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.2
    • 2.2
    • Web Services
    • None
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide

      1- create a web service (enabled and authorised for a specific username)
      2- in the mysql/postgres 'external_services' table, set manually the SHORTNAME
      3- Enter in your browser: http://yourmoodle/login/token.php?service=SHORTNAME&username=USERNAME&password=PASSWORD

      //use a no-admin user who has the moodle/webservice:createtoken capability
      a) the user never visited his security keys page (i.e. no token exists for him) and everything is set up correctly => a token is returned
      b) you run a) a new time (so a token has been generated) => the same token is returned.

      Show
      1- create a web service (enabled and authorised for a specific username) 2- in the mysql/postgres 'external_services' table, set manually the SHORTNAME 3- Enter in your browser: http://yourmoodle/login/token.php?service=SHORTNAME&username=USERNAME&password=PASSWORD //use a no-admin user who has the moodle/webservice:createtoken capability a) the user never visited his security keys page (i.e. no token exists for him) and everything is set up correctly => a token is returned b) you run a) a new time (so a token has been generated) => the same token is returned.

      The SQL statement within login/token.php that is selecting all of the applicable tokens for the user + service joins on the service and then selects several fields from it.
      However after the refactoring done in MDL-29716 this join and selects no longer appear to be needed (the service is fetched above and we can use the id from there in the where directly).

            jerome Jérôme Mouneyrac
            samhemelryk Sam Hemelryk
            Dongsheng Cai Dongsheng Cai
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Sam Hemelryk Sam Hemelryk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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