From 7ce1f7c987411997cf50480675c1b85e8d9e4f03 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 5 Jul 2010 21:30:58 +0000 Subject: [PATCH] MDL-13563 necessary DB changes needed for proper suspending of users (prevention of log in), this will be handy --- lib/db/install.xml | 5 +++-- lib/db/upgrade.php | 15 +++++++++++++++ version.php | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/db/install.xml b/lib/db/install.xml index 81400211799..97b8b1396eb 100644 --- a/lib/db/install.xml +++ b/lib/db/install.xml @@ -707,8 +707,9 @@ - - + + + diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 1ed635c0bb6..5aecc565613 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -4844,6 +4844,21 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL"); upgrade_main_savepoint(true, 2010070500); } + if ($oldversion < 2010070501) { + + /// Define field suspended to be added to user + $table = new xmldb_table('user'); + $field = new xmldb_field('suspended', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'deleted'); + + /// Conditionally launch add field suspended + if (!$dbman->field_exists($table, $field)) { + $dbman->add_field($table, $field); + } + + /// Main savepoint reached + upgrade_main_savepoint(true, 2010070501); + } + return true; } diff --git a/version.php b/version.php index 9c76dbc5370..dfe5b56d8b9 100644 --- a/version.php +++ b/version.php @@ -6,7 +6,7 @@ // This is compared against the values stored in the database to determine // whether upgrades should be performed (see lib/db/*.php) - $version = 2010070500; // YYYYMMDD = date of the last version bump + $version = 2010070501; // YYYYMMDD = date of the last version bump // XX = daily increments $release = '2.0 Preview 4 (Build: 20100705)'; // Human-friendly version name