Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
2a95efc3
Commit
2a95efc3
authored
Mar 26, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Mar 26, 2015
Browse files
Merge "Fix errors when unset a property of $SESSION. Bug 1435355"
parents
ec8193bb
73f50b5e
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/forgotpass.php
View file @
2a95efc3
...
@@ -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'
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment