From: scyrma Date: Mon, 28 Apr 2008 08:35:21 +0000 (+0000) Subject: MDL-14569 - Remove linked tags when deleting users. (merge from 1.9) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=13b31d6f9dbc86b800b9c9db256a3af5bd496b4e;p=moodle.git MDL-14569 - Remove linked tags when deleting users. (merge from 1.9) --- diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 517c73114a..2425591288 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2975,6 +2975,9 @@ function delete_user($user) { // now do a final accesslib cleanup - removes all role assingments in user context and context itself delete_context(CONTEXT_USER, $user->id); + require_once($CFG->dirroot.'/tag/lib.php'); + tag_set('user', $user->id, array()); + // workaround for bulk deletes of users with the same email address $delname = addslashes("$user->email.".time()); while (record_exists('user', 'username', $delname)) { // no need to use mnethostid here