Commit 82247213 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1471103: Force user to login after password reset via CLI script

Kill any sessions that the account may have active


Change-Id: I602fe94262c453eae1f5e1faf83d7709720bd906
Signed-off-by: Robert Lyon's avatarRobert Lyon <>
parent 87b30387
......@@ -101,6 +101,8 @@ else {
$success = reset_password($user);
if ($success) {
// Delete the existing usr_session rows to force usr to log back in
execute_sql("DELETE FROM {usr_session} WHERE usr = ?", array($user->id));
$exitstring = get_string('cli_pwreset_success', 'admin', $username);
if ($forcepasswordchange) {
set_field('usr', 'passwordchange', 1, 'username', $username);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment