Skip to content

change password for users on profile page#15

Open
WLsupport wants to merge 10 commits intoaimeos:masterfrom
WLsupport:features/user_change_password
Open

change password for users on profile page#15
WLsupport wants to merge 10 commits intoaimeos:masterfrom
WLsupport:features/user_change_password

Conversation

@WLsupport
Copy link

No description provided.

namespace Aimeos\Controller\Frontend\Customer;


use Illuminate\Support\Facades\Log;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all Laravel specific code

*
* @param array $values Values added to the customer item (new or existing) like "customer.code"
* @return \Aimeos\Controller\Frontend\Customer\Iface Customer controller for fluent interface
* @return Iface Customer controller for fluent interface
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was that intentional?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think phpstorm did some magic, i reverted all import simplifications back to the full path.

if ( $oldPassword = $values['customer.oldpassword'] ?? null) {
$confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
$isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
if ($this->item->verifyPassword($oldPassword) && $confirmed && $isNew) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method isn't available in the customer item yet

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aimeos/aimeos-core#250

i forgot the aimeos-core pr

$confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
$isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];
if ($this->item->verifyPassword($oldPassword) && $confirmed && $isNew) {
$this->item = $this->item->setPassword($values['customer.newpassword']);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few rules that have to be enforced for passwords:

  • min 8 chars
  • max 64 chars
  • includes upper and lower case chars
  • includes numbers

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i implemented the check in ai-client-html, it wont reach this code if the requirements arent meet

if( !isset( self::$aimeos ) )
{
require_once 'Bootstrap.php';
require_once 'vendor/aimeos/aimeos-core/Bootstrap.php';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove that as it's wrong when the test setup is right

$confirmed = $values['customer.newpassword'] === $values['customer.confirmnewpassword'];
$isNew = $values['customer.newpassword'] !== $values['customer.oldpassword'];

$passHelper = $this->getContext()->password();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please fix the indentions? We use one tab per indention

.gitignore Outdated
Comment on lines 7 to 8
vendor
composer.lock
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove those because they are not necessary if the test setup is correct (ai-controller-frontend extension is located in ./ext/ai-controller-frontend/ directory of aimeos-core checkout)

@aimeos
Copy link
Owner

aimeos commented Sep 17, 2021

The return types are now inconsistent, sometimes it's Iface, somtimes it's \Aimeos\Controller\Frontend\Customer\Iface. Can you either leave it to Iface or use \Aimeos\Controller\Frontend\Customer\Iface all over?

For the tests to succeed, you need to add these lines here:
https://github.com/aimeos/ai-controller-frontend/blob/master/controller/frontend/tests/TestHelperFrontend.php#L83

$password = new \Aimeos\MW\Password\Standard();
$context->setPassword( $password );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants