MDL-76055 auth_mnet: Fix update_enrolments request
commit478f423e2d611ffbd3488c9d8aeb2f06dec48a08
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Sun, 25 Sep 2022 14:27:21 +0000 (25 16:27 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Wed, 2 Nov 2022 14:56:38 +0000 (2 15:56 +0100)
tree8a3ac6ef0a62a34915da117d968f7847286f5ece
parent29873206b964489ef7bb2feb39424d16c882e5ca
MDL-76055 auth_mnet: Fix update_enrolments request

Basically this fixes MDL-70833 that was reproduced while
testing the update_enrolments requests. Summary:

- Fixes a typo in table name preventing it to be updated ever.
- Fix outer join that was missing records.
- Stop playing and mixing ids (local and remote).
- Better control which enrolments have to be kept (previously
  they were being deleted immediately after creating them).
- Improve the coding style of inserts.
- Modernise the deletions to use sql helper and to work with 0..n ids.
auth/mnet/auth.php