From dabfe65fa461b77b2af92ec50a5e34bdc81fe263 Mon Sep 17 00:00:00 2001 From: tuanngocnguyen Date: Tue, 18 Jun 2019 12:57:02 +1000 Subject: [PATCH] issue#395 - change preventsharedip default value to 1 (#396) * issue#395 - make sure preventsharedip default value to is set 0 * pump up version --- db/install.xml | 2 +- db/upgrade.php | 15 +++++++++++++++ version.php | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/db/install.xml b/db/install.xml index 2296cd0..72f2e19 100644 --- a/db/install.xml +++ b/db/install.xml @@ -45,7 +45,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index aa0e5b0..9bdfba7 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -550,5 +550,20 @@ function xmldb_attendance_upgrade($oldversion=0) { upgrade_mod_savepoint(true, 2019012500, 'attendance'); } + if ($oldversion < 2019061800) { + + // Make sure default value to '0'. + $table = new xmldb_table('attendance_sessions'); + $field = new xmldb_field('preventsharedip', XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, + XMLDB_NOTNULL, null, '0', 'absenteereport'); + + if ($dbman->field_exists($table, $field)) { + $dbman->change_field_default($table, $field); + } + + // Attendance savepoint reached. + upgrade_mod_savepoint(true, 2019061800, 'attendance'); + } + return $result; } diff --git a/version.php b/version.php index 6c1d89a..55f125e 100644 --- a/version.php +++ b/version.php @@ -23,7 +23,7 @@ */ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2019052801; +$plugin->version = 2019061800; $plugin->requires = 2018102700; // Requires 3.6. $plugin->release = '3.6.7'; $plugin->maturity = MATURITY_STABLE;