Permalink
Browse files

MDL-27360 Web service tokens are displayed for deleted users

  • Loading branch information...
1 parent 216f6d8 commit 2214c4a2e8528a8a255d1c36bdbdfa7fb0a2be59 @mouneyrac mouneyrac committed Feb 2, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/moodlelib.php
View
@@ -3810,6 +3810,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));
+
// force logout - may fail if file based sessions used, sorry
session_kill_user($user->id);

0 comments on commit 2214c4a

Please sign in to comment.