| Línea 231... |
Línea 231... |
| 231 |
unset_user_preference('create_password', $usernew); // Prevent cron from generating the password.
|
231 |
unset_user_preference('create_password', $usernew); // Prevent cron from generating the password.
|
| Línea 232... |
Línea 232... |
| 232 |
|
232 |
|
| 233 |
if (!empty($CFG->passwordchangelogout)) {
|
233 |
if (!empty($CFG->passwordchangelogout)) {
|
| 234 |
// We can use SID of other user safely here because they are unique,
|
234 |
// We can use SID of other user safely here because they are unique,
|
| 235 |
// the problem here is we do not want to logout admin here when changing own password.
|
235 |
// the problem here is we do not want to logout admin here when changing own password.
|
| 236 |
\core\session\manager::kill_user_sessions($usernew->id, session_id());
|
236 |
\core\session\manager::destroy_user_sessions($usernew->id, session_id());
|
| 237 |
}
|
237 |
}
|
| 238 |
if (!empty($usernew->signoutofotherservices)) {
|
238 |
if (!empty($usernew->signoutofotherservices)) {
|
| 239 |
webservice::delete_user_ws_tokens($usernew->id);
|
239 |
webservice::delete_user_ws_tokens($usernew->id);
|
| 240 |
}
|
240 |
}
|
| 241 |
}
|
241 |
}
|
| Línea 242... |
Línea 242... |
| 242 |
}
|
242 |
}
|
| 243 |
|
243 |
|
| 244 |
// Force logout if user just suspended.
|
244 |
// Force logout if user just suspended.
|
| 245 |
if (isset($usernew->suspended) and $usernew->suspended and !$user->suspended) {
|
245 |
if (isset($usernew->suspended) and $usernew->suspended and !$user->suspended) {
|
| 246 |
\core\session\manager::kill_user_sessions($user->id);
|
246 |
\core\session\manager::destroy_user_sessions($user->id);
|
| Línea 247... |
Línea 247... |
| 247 |
}
|
247 |
}
|