From e58c291cbbeaee0d9bb09d41311dd0e1be198ce3 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 6 Sep 2013 17:01:46 +0800 Subject: [PATCH] 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. --- login/change_password.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/login/change_password.php b/login/change_password.php index 88a7cf50fb4..8f0803ebe1d 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -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)));