Set Password

Open to all! Ask other shopowners for help.
Post Reply
Brighton
Member
Posts: 15
Joined: Sat Jan 08, 2022 12:13 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 1 time

Set Password

Post by Brighton »

Version 1.0.8.20

Set_Password is probably rarely if ever used so this isn’t too important.

There may be a small error in

/templates/default/includes/ext/modules/content/account/set_password.php

When submitting the set_password page, if there is an error the message it is not reported when the page is re-displayed.

Lines 22-24
if ($messageStack->size('account_password') > 0) {
echo $messageStack->output('account_password');
}

I think ‘account_password’ needs to be ‘customer_data’?

Relating to this -
a) is there a reason why set_password is subordinate to the ext folder instead of in the main stream as is change_password etc?
b) is there a reason why the set_password data control for display/process/update is semi hard coded instead of being accessed/controlled by the customer data cd_ modules?


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set Password

Post by burt »

Brighton wrote: Thu Nov 02, 2023 11:39 am When submitting the set_password page, if there is an error the message it is not reported when the page is re-displayed.
Can you show the steps you took to get an error on this page?

There is an input box for password, which is required and has a MINLENGTH of 5 characters and a continue button. The input box uses HTML5 validation, so it should be impossible to create an error that would reload the page...

After successfully saving a password, this appears on the redirect to account.php
pw.jpg
You do not have the required permissions to view the files attached to this post.
Brighton
Member
Posts: 15
Joined: Sat Jan 08, 2022 12:13 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 1 time

Re: Set Password

Post by Brighton »

Running a very close to virgin “Installed Version: CE Phoenix v1.0.8.20”, there is no HTML field length validation, the validation happens after the page is submitted.

When you say “The input box uses HTML5 validation” I presume you mean “minlength=” on the HTML form <input> definition? I can’t find 'minlength=' on any HTML form <input> definitions in my loaded version.
User avatar
burt
Core Team
Posts: 4550
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Set Password

Post by burt »

Ah yeah, better system of minlength has been added in the upcoming 1.0.8.21 which I'm currently using.

You can do similar in 1.0.8.20/includes/modules/customer_data/cd_password.php

Code: Select all

$attribute .= ' minlength="' . $this->base_constant('MIN_LENGTH') . '"';
Prior to

Code: Select all

$input = tep_draw_input_field('password', null, $attribute, 'password')
             . $postInput;
Untested, but it might work. Will display error message like this when pw is too short;
pw1.jpg
You do not have the required permissions to view the files attached to this post.
Brighton
Member
Posts: 15
Joined: Sat Jan 08, 2022 12:13 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 1 time

Re: Set Password

Post by Brighton »

Thank you, it’s no major trauma. I did wonder if there were future plans to include the ‘minlength=’ on form input definitions.
Brighton
Member
Posts: 15
Joined: Sat Jan 08, 2022 12:13 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 1 time

Re: Set Password

Post by Brighton »

N.B. In case anyone is interested, I think it's $attributes (i.e. plural).


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply