Correction of transmitted parameters
This commit is contained in:
parent
f43b3f2fd3
commit
18a5d23d07
@ -74,7 +74,9 @@ class events {
|
|||||||
*/
|
*/
|
||||||
private static function handler_callback($data, $callback) {
|
private static function handler_callback($data, $callback) {
|
||||||
if ($callback->enable) {
|
if ($callback->enable) {
|
||||||
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
if (!empty($callback->events)) {
|
||||||
|
$events = unserialize(gzuncompress(base64_decode($callback->events)));
|
||||||
|
}
|
||||||
|
|
||||||
if (boolval($events[$data["eventname"]])) {
|
if (boolval($events[$data["eventname"]])) {
|
||||||
/* Adding to the data token */
|
/* Adding to the data token */
|
||||||
|
@ -81,7 +81,7 @@ class service_edit_form extends moodleform {
|
|||||||
$mform->addRule("url", null, "required");
|
$mform->addRule("url", null, "required");
|
||||||
|
|
||||||
/* Enabling the service */
|
/* Enabling the service */
|
||||||
$mform->addElement("checkbox", "enable",
|
$mform->addElement("advcheckbox", "enable",
|
||||||
new lang_string("enable", "moodle"));
|
new lang_string("enable", "moodle"));
|
||||||
$mform->setType("enable", PARAM_BOOL);
|
$mform->setType("enable", PARAM_BOOL);
|
||||||
$mform->setDefault("enable", 1);
|
$mform->setDefault("enable", 1);
|
||||||
|
@ -59,10 +59,6 @@ if ($idediting = boolval($idservice)) {
|
|||||||
|
|
||||||
/* Processing of received data */
|
/* Processing of received data */
|
||||||
if ($data = $mform->get_data()) {
|
if ($data = $mform->get_data()) {
|
||||||
if (empty($data->enable)) {
|
|
||||||
$data->enable = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Packing of data */
|
/* Packing of data */
|
||||||
if (!empty($data->events)) {
|
if (!empty($data->events)) {
|
||||||
$data->events = base64_encode(gzcompress(serialize($data->events), 9));
|
$data->events = base64_encode(gzcompress(serialize($data->events), 9));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user