Page 1 of 1

Set Password

Posted: Thu Nov 02, 2023 11:39 am
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?

Re: Set Password

Posted: Thu Nov 02, 2023 1:04 pm
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

Re: Set Password

Posted: Thu Nov 02, 2023 2:48 pm
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.

Re: Set Password

Posted: Thu Nov 02, 2023 2:54 pm
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

Re: Set Password

Posted: Thu Nov 02, 2023 3:09 pm
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.

Re: Set Password

Posted: Thu Nov 02, 2023 3:18 pm
by Brighton
N.B. In case anyone is interested, I think it's $attributes (i.e. plural).