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

core_enrol_submit_user_enrolment_form requires sesskey when called by web-service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 3.9.3
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      Hello,

      As it was the case for some others web-service functions, it seems that core_enrol_submit_user_enrolment_form needs to be slightly altered in order to be callable from an external web-service.

      I've got it working on my local moodle config by altering the function 'submit_user_enrolment_form' in enrol/externallib.php.

      At line 1141, I appended ", $USER" before the semicolon.

      At line 1148, I added those lines: "
      if(WS_SERVER)

      {     $USER->ignoresesskey =true; }

      ".

      There might be a way to also set "qf__enrol_user_enrolment_form" parameter to one, but I didn't explore this yet.
       
      Hope this helps people / gets implemented.

      Regards,
      Thomas.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            blnwe Thomas DELEPINNE
            Participants:
            Component watchers:
            Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: