Permalink
Browse files

MDL-27360 Web service tokens are displayed for deleted users

Conflicts:

	lib/moodlelib.php
  • Loading branch information...
mouneyrac committed Feb 2, 2012
1 parent c0ac40e commit 4bdff2e1f0448c418d9fbc0f985a862edce2d824
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/moodlelib.php
View
@@ -3466,6 +3466,12 @@ function delete_user($user) {
// last course access not necessary either
$DB->delete_records('user_lastaccess', array('userid'=>$user->id));
+ // remove all user tokens
+ $DB->delete_records('external_tokens', array('userid'=>$user->id));
+
+ // unauthorise the user for all services
+ $DB->delete_records('external_services_users', array('userid'=>$user->id));
+
// now do a final accesslib cleanup - removes all role assignments in user context and context itself
delete_context(CONTEXT_USER, $user->id);

0 comments on commit 4bdff2e

Please sign in to comment.