mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed call to Member function that didn't exist
MINOR Check if OldPassword data exists before running checkPassword() git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65135 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
99589e626f
commit
b93a8257f4
@ -22,7 +22,7 @@ class ChangePasswordForm extends Form {
|
||||
function __construct($controller, $name, $fields = null, $actions = null) {
|
||||
if(!$fields) {
|
||||
$fields = new FieldSet();
|
||||
if(Member::currentUser() && (!isset($_REQUEST['h']) || !Member::member_from_autologin($_REQUEST['h']))) {
|
||||
if(Member::currentUser() && (!isset($_REQUEST['h']) || !Member::member_from_autologinhash($_REQUEST['h']))) {
|
||||
$fields->push(new PasswordField("OldPassword",_t('Member.YOUROLDPASSWORD', "Your old password")));
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class ChangePasswordForm extends Form {
|
||||
function doChangePassword(array $data) {
|
||||
if($member = Member::currentUser()) {
|
||||
// The user was logged in, check the current password
|
||||
if($member->checkPassword($data['OldPassword']) == false) {
|
||||
if(isset($data['OldPassword']) && $member->checkPassword($data['OldPassword']) == false) {
|
||||
$this->clearMessage();
|
||||
$this->sessionMessage(
|
||||
_t('Member.ERRORPASSWORDNOTMATCH', "Your current password does not match, please try again"),
|
||||
|
Loading…
Reference in New Issue
Block a user