MDL-27360 Web service tokens are displayed for deleted users

This commit is contained in:
Jerome Mouneyrac 2012-02-02 15:34:05 +08:00
parent 216f6d8e9d
commit 2214c4a2e8

View File

@ -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);