| Línea 285... |
Línea 285... |
| 285 |
$userauth = get_auth_plugin($user->auth);
|
285 |
$userauth = get_auth_plugin($user->auth);
|
| 286 |
if (!$userauth->user_update_password($user, $data->password)) {
|
286 |
if (!$userauth->user_update_password($user, $data->password)) {
|
| 287 |
throw new \moodle_exception('errorpasswordupdate', 'auth');
|
287 |
throw new \moodle_exception('errorpasswordupdate', 'auth');
|
| 288 |
}
|
288 |
}
|
| 289 |
user_add_password_history($user->id, $data->password);
|
289 |
user_add_password_history($user->id, $data->password);
|
| 290 |
if (!empty($CFG->passwordchangelogout)) {
|
290 |
if (!empty($CFG->passwordchangelogout) || !empty($data->logoutothersessions)) {
|
| 291 |
\core\session\manager::kill_user_sessions($user->id, session_id());
|
291 |
\core\session\manager::destroy_user_sessions($user->id, session_id());
|
| 292 |
}
|
292 |
}
|
| 293 |
// Reset login lockout (if present) before a new password is set.
|
293 |
// Reset login lockout (if present) before a new password is set.
|
| 294 |
login_unlock_account($user);
|
294 |
login_unlock_account($user);
|
| 295 |
// Clear any requirement to change passwords.
|
295 |
// Clear any requirement to change passwords.
|
| 296 |
unset_user_preference('auth_forcepasswordchange', $user);
|
296 |
unset_user_preference('auth_forcepasswordchange', $user);
|
| Línea 360... |
Línea 360... |
| 360 |
if ($homepage === HOMEPAGE_MYCOURSES && !isguestuser()) {
|
360 |
if ($homepage === HOMEPAGE_MYCOURSES && !isguestuser()) {
|
| 361 |
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
|
361 |
if ($urltogo == $CFG->wwwroot or $urltogo == $CFG->wwwroot.'/' or $urltogo == $CFG->wwwroot.'/index.php') {
|
| 362 |
$urltogo = $CFG->wwwroot.'/my/courses.php';
|
362 |
$urltogo = $CFG->wwwroot.'/my/courses.php';
|
| 363 |
}
|
363 |
}
|
| 364 |
}
|
364 |
}
|
| - |
|
365 |
if ($homepage === HOMEPAGE_URL) {
|
| - |
|
366 |
$urltogo = (string) get_default_home_page_url();
|
| - |
|
367 |
}
|
| 365 |
}
|
368 |
}
|
| 366 |
return $urltogo;
|
369 |
return $urltogo;
|
| 367 |
}
|
370 |
}
|
| Línea 368... |
Línea 371... |
| 368 |
|
371 |
|