valentineus / moodle-webhooks

Webhooks allow applications to subscribe to Moodle events.
https://moodle.org/plugins/local_webhooks
GNU General Public License v3.0
17 stars 14 forks source link

Disabled Events From WebApi #28

Open mlohoar opened 2 years ago

mlohoar commented 2 years ago

I need webhooks not to be triggered by WebAPI rest calls as it'll cause a never ending loop of events with my remote system. I put this in the handler as a short term fix: if($_POST['ignorewebhooks']=='true') { return; } I use the MoodleRest PHP SDK so it's easy for me to add addition data to the API post, but it might be worth enabling other methods of the webhooks not being triggered? client IP address? bool value on the chosen event

Good work thanks

mlohoar commented 2 years ago

Correction: if(isset($_GET['wsfunction'])) { return; }

as any additional parameters in the ws call trigger and error