MDL-40045 login: removed add_to_log call when a user updates their password

This add_to_log call is not being replaced by a user_updated event as the
call to $userauth->user_update_password should (and does in the case of
manual authentication - see MDL-41170) do this already when the password
is changed in the user table. If the authentication plugin is changing
the password externally then there is no need to call the user_updated
event as this should only be called whenever any update is made on the
user table.
This commit is contained in:
Mark Nelson
2013-10-21 11:53:31 +08:00
parent f2f694f399
commit e58c291cbb
+3 -5
View File
@@ -31,12 +31,14 @@ require_once($CFG->libdir.'/authlib.php');
$id = optional_param('id', SITEID, PARAM_INT); // current course
$return = optional_param('return', 0, PARAM_BOOL); // redirect after password change
$systemcontext = context_system::instance();
//HTTPS is required in this page when $CFG->loginhttps enabled
$PAGE->https_required();
$PAGE->set_url('/login/change_password.php', array('id'=>$id));
$PAGE->set_context(context_system::instance());
$PAGE->set_context($systemcontext);
if ($return) {
// this redirect prevents security warning because https can not POST to http pages
@@ -53,8 +55,6 @@ if ($return) {
$strparticipants = get_string('participants');
$systemcontext = context_system::instance();
if (!$course = $DB->get_record('course', array('id'=>$id))) {
print_error('invalidcourseid');
}
@@ -120,8 +120,6 @@ if ($mform->is_cancelled()) {
$strpasswordchanged = get_string('passwordchanged');
add_to_log($course->id, 'user', 'change password', "view.php?id=$USER->id&course=$course->id", "$USER->id");
$fullname = fullname($USER, true);
$PAGE->navbar->add($fullname, new moodle_url('/user/view.php', array('id'=>$USER->id, 'course'=>$course->id)));