Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-33562 lib: remove deleted user tokens

  • Loading branch information...
commit 068373c86ac19d12da7944efa44ab107689741de 1 parent 4c4c90f
@danpoltawski danpoltawski authored
Showing with 10 additions and 1 deletion.
  1. +9 −0 lib/db/upgrade.php
  2. +1 −1  version.php
View
9 lib/db/upgrade.php
@@ -2164,5 +2164,14 @@ function xmldb_main_upgrade($oldversion) {
// Put any upgrade step following this.
+ if ($oldversion < 2013051400.04) {
+ // Clean up old tokens which haven't been deleted.
+ $DB->execute("DELETE FROM {user_private_key} WHERE NOT EXISTS
+ (SELECT 'x' FROM {user} WHERE deleted = 0 AND id = userid)");
+
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2013051400.04);
+ }
+
return true;
}
View
2  version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2013051400.03; // 20130514 = branching date YYYYMMDD - do not modify!
+$version = 2013051400.04; // 20130514 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.