Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaee6b7c81 | ||
|
|
282e3bcaf1 | ||
|
|
c037edbc58 | ||
|
|
2c4c05acd6 |
@@ -77,6 +77,11 @@ class events {
|
|||||||
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
||||||
|
|
||||||
if (boolval($events[$data["eventname"]])) {
|
if (boolval($events[$data["eventname"]])) {
|
||||||
|
/* Adding to the data token */
|
||||||
|
if (boolval($callback->token)) {
|
||||||
|
$data["token"] = $callback->token;
|
||||||
|
}
|
||||||
|
|
||||||
self::send($data, $callback);
|
self::send($data, $callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,12 @@ class service_edit_form extends moodleform {
|
|||||||
$mform->setDefault("enable", 1);
|
$mform->setDefault("enable", 1);
|
||||||
$mform->setAdvanced("enable");
|
$mform->setAdvanced("enable");
|
||||||
|
|
||||||
|
/* Token */
|
||||||
|
$mform->addElement("text", "token",
|
||||||
|
new lang_string("token", "webservice"),
|
||||||
|
array("size" => 60));
|
||||||
|
$mform->setType("token", PARAM_NOTAGS);
|
||||||
|
|
||||||
/* Form heading */
|
/* Form heading */
|
||||||
$mform->addElement("header", "editserviceheaderevent",
|
$mform->addElement("header", "editserviceheaderevent",
|
||||||
new lang_string("edulevel", "moodle"));
|
new lang_string("edulevel", "moodle"));
|
||||||
|
|||||||
+2
-1
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<XMLDB PATH="blocks/local_webhooks/db" VERSION="20171025" COMMENT="XMLDB file for Moodle" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd">
|
<XMLDB PATH="blocks/local_webhooks/db" VERSION="20171026" COMMENT="XMLDB file for Moodle" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd">
|
||||||
<TABLES>
|
<TABLES>
|
||||||
<TABLE NAME="local_webhooks_service" COMMENT="A table for storing callback services.">
|
<TABLE NAME="local_webhooks_service" COMMENT="A table for storing callback services.">
|
||||||
<FIELDS>
|
<FIELDS>
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
<FIELD NAME="enable" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" />
|
<FIELD NAME="enable" TYPE="int" LENGTH="2" NOTNULL="true" DEFAULT="0" SEQUENCE="false" />
|
||||||
<FIELD NAME="title" TYPE="text" NOTNULL="true" SEQUENCE="false" />
|
<FIELD NAME="title" TYPE="text" NOTNULL="true" SEQUENCE="false" />
|
||||||
<FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" />
|
<FIELD NAME="url" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" />
|
||||||
|
<FIELD NAME="token" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" />
|
||||||
<FIELD NAME="events" TYPE="text" NOTNULL="true" SEQUENCE="false" />
|
<FIELD NAME="events" TYPE="text" NOTNULL="true" SEQUENCE="false" />
|
||||||
</FIELDS>
|
</FIELDS>
|
||||||
<KEYS>
|
<KEYS>
|
||||||
|
|||||||
+2
-2
@@ -23,8 +23,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
defined("MOODLE_INTERNAL") || die();
|
defined("MOODLE_INTERNAL") || die();
|
||||||
$plugin->release = "0.2.0 (Build: 2017102600)";
|
$plugin->release = "0.3.0 (Build: 2017102610)";
|
||||||
$plugin->version = 2017102600;
|
$plugin->version = 2017102610;
|
||||||
$plugin->requires = 2016112900;
|
$plugin->requires = 2016112900;
|
||||||
$plugin->component = "local_webhooks";
|
$plugin->component = "local_webhooks";
|
||||||
$plugin->maturity = MATURITY_BETA;
|
$plugin->maturity = MATURITY_BETA;
|
||||||
Reference in New Issue
Block a user