Commit 2a95efc3 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Fix errors when unset a property of $SESSION. Bug 1435355"

parents ec8193bb 73f50b5e
...@@ -18,8 +18,8 @@ define('SECTION_PAGE', 'forgotpass'); ...@@ -18,8 +18,8 @@ define('SECTION_PAGE', 'forgotpass');
require('init.php'); require('init.php');
require_once('pieforms/pieform.php'); require_once('pieforms/pieform.php');
if (!empty($_SESSION['pwchangerequested'])) { if (!empty($SESSION->pwchangerequested)) {
unset($SESSION['pwchangerequested']); unset($SESSION->pwchangerequested);
die_info(get_string('pwchangerequestsent')); die_info(get_string('pwchangerequestsent'));
} }
...@@ -27,16 +27,16 @@ if (isset($_GET['key'])) { ...@@ -27,16 +27,16 @@ if (isset($_GET['key'])) {
$SESSION->set('forgotpasskey', $_GET['key']); $SESSION->set('forgotpasskey', $_GET['key']);
redirect('/forgotpass.php'); redirect('/forgotpass.php');
} }
if (isset($_SESSION['forgotpasskey'])) { if (isset($SESSION->forgotpasskey)) {
define('TITLE', get_string('changepassword')); define('TITLE', get_string('changepassword'));
if (!$pwrequest = get_record('usr_password_request', 'key', $_SESSION['forgotpasskey'])) { if (!$pwrequest = get_record('usr_password_request', 'key', $SESSION->forgotpasskey)) {
unset($SESSION['forgotpasskey']); unset($SESSION->forgotpasskey);
die_info(get_string('nosuchpasswordrequest')); die_info(get_string('nosuchpasswordrequest'));
} }
if (strtotime($pwrequest->expiry) < time()) { if (strtotime($pwrequest->expiry) < time()) {
unset($SESSION['forgotpasskey']); unset($SESSION->forgotpasskey);
die_info(get_string('passwordresetexpired')); die_info(get_string('passwordresetexpired'));
} }
...@@ -208,7 +208,7 @@ function forgotpasschange_validate(Pieform $form, $values) { ...@@ -208,7 +208,7 @@ function forgotpasschange_validate(Pieform $form, $values) {
function forgotpasschange_submit(Pieform $form, $values) { function forgotpasschange_submit(Pieform $form, $values) {
global $SESSION, $USER; global $SESSION, $USER;
unset($SESSION['forgotpasskey']); unset($SESSION->forgotpasskey);
try { try {
$user = new User(); $user = new User();
$user->find_by_id($values['user']); $user->find_by_id($values['user']);
......
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