Permalink
Browse files

MDL-27360 Web service tokens are displayed for deleted users

  • Loading branch information...
1 parent d4b3034 commit 28a3a568aa8a00f97e218eebef0777c89dabf74d @mouneyrac mouneyrac committed Feb 2, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/moodlelib.php
View
@@ -3775,6 +3775,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 28a3a56

Please sign in to comment.