MDL-23772 cleanup SESSION->wantsurl before redirect + removed unnecessary require_login()
authorPetr Skoda <skodak@moodle.org>
Sun, 3 Oct 2010 15:27:31 +0000 (15:27 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 3 Oct 2010 15:27:31 +0000 (15:27 +0000)
login/change_password.php

index b020cb3..ab47e71 100644 (file)
@@ -57,7 +57,6 @@ if (!isloggedin() or isguestuser()) {
 
 // do not require change own password cap if change forced
 if (!get_user_preferences('auth_forcepasswordchange', false)) {
-    require_login();
     require_capability('moodle/user:changeownpassword', $systemcontext);
 }
 
@@ -120,6 +119,7 @@ if ($mform->is_cancelled()) {
     } else {
         $returnto = $SESSION->wantsurl;
     }
+    unset($SESSION->wantsurl);
 
     notice($strpasswordchanged, $returnto);