aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2017-11-18 06:34:38 +0300
committerValentin Popov <info@valentineus.link>2017-11-18 06:34:38 +0300
commitf28b408b1ed984a02afec895a8cea7b58455c24e (patch)
tree0877d7d7f3633fd91d3cb284c3f34b8d2f520e23
parent91fd140bd46a04d979828416b12c5719b745efd7 (diff)
downloadlocal_webhooks-f28b408b1ed984a02afec895a8cea7b58455c24e.tar.xz
local_webhooks-f28b408b1ed984a02afec895a8cea7b58455c24e.zip
Added hostname to the request
-rw-r--r--classes/handler.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/classes/handler.php b/classes/handler.php
index ac933a9..8e20db8 100644
--- a/classes/handler.php
+++ b/classes/handler.php
@@ -71,6 +71,8 @@ class handler {
* @param object $callback
*/
private static function handler_callback($data, $callback) {
+ global $CFG;
+
if (boolval($callback->enable)) {
$events = array();
if (!empty($callback->events)) {
@@ -78,6 +80,9 @@ class handler {
}
if (!empty($events[$data["eventname"]])) {
+ $urlparse = parse_url($CFG->wwwroot);
+ $data["host"] = $urlparse['host'];
+
if (!empty($callback->token)) {
$data["token"] = $callback->token;
}