A small correction of logic
This commit is contained in:
parent
e1734746c0
commit
af6ac9fb22
@ -77,13 +77,14 @@ class events {
|
|||||||
* @param object $callback
|
* @param object $callback
|
||||||
*/
|
*/
|
||||||
private static function handler_callback($data, $callback) {
|
private static function handler_callback($data, $callback) {
|
||||||
if ($callback->enable) {
|
if (boolval($callback->enable)) {
|
||||||
|
$events = array();
|
||||||
if (!empty($callback->events)) {
|
if (!empty($callback->events)) {
|
||||||
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($events[$data["eventname"]])) {
|
if (!empty($events[$data["eventname"]])) {
|
||||||
if (boolval($callback->token)) {
|
if (!empty($callback->token)) {
|
||||||
$data["token"] = $callback->token;
|
$data["token"] = $callback->token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ if ($data = $mform->get_data()) {
|
|||||||
$data->events = base64_encode(gzcompress(serialize($data->events), 9));
|
$data->events = base64_encode(gzcompress(serialize($data->events), 9));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boolval($idediting)) {
|
if ($idediting) {
|
||||||
$data->id = $serviceid;
|
$data->id = $serviceid;
|
||||||
$DB->update_record("local_webhooks_service", $data);
|
$DB->update_record("local_webhooks_service", $data);
|
||||||
redirect($managerservice, new lang_string("eventwebserviceserviceupdated", "webservice"));
|
redirect($managerservice, new lang_string("eventwebserviceserviceupdated", "webservice"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user