-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client html side of user password change #152
base: master
Are you sure you want to change the base?
Conversation
|
||
public function getSubClient(string $type, string $name = null): \Aimeos\Client\Html\Iface | ||
{ | ||
// TODO: Implement getSubClient() method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just copy the code from another file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added that
foreach( $this->getSubClients() as $subclient ) { | ||
$html .= $subclient->setView( $view )->getBody( $uid ); | ||
} | ||
$view->addressBody = $html; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace all occurrences of "address" by "account" everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced every occurance of "address"
<form class="container-fluid" method="POST" action="<?= $enc->attr( $this->link( 'client/html/account/profile/url' ) ) ?>"> | ||
<?= $this->csrf()->formfield() ?> | ||
<?php if ( $this->get('passwordChanged', '') === 'true' ) : ?> | ||
<div class="row d-flex justify-content-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Utility CSS classes are handy but a bad idea if different themes have to cope with them. Please add the necessary styles to the CSS file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed that
<?= $this->csrf()->formfield() ?> | ||
<?php if ( $this->get('passwordChanged', '') === 'true' ) : ?> | ||
<div class="row d-flex justify-content-center"> | ||
<h2 class="text-success">Password changed successfull!</h2> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All strings need to be translated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Validator::make([ | ||
'password' => $values['customer.newpassword'], | ||
'password_confirmation' => $values['customer.confirmnewpassword'] | ||
], [ | ||
'password' => ['required', 'string', new Password, 'confirmed'] | ||
])->validate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use Laravel specific code in HTML clients. This won't work in other integrations.
use Illuminate\Support\Facades\Validator; | ||
use Laravel\Fortify\Rules\Password; | ||
use Laravel\Jetstream\Jetstream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Laravel specific code is possible
@@ -0,0 +1,264 @@ | |||
<?php | |||
|
|||
namespace Aimeos\Client\Html\Account\Profile\Account; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change that to Aimeos\Client\Html\Account\Profile\Password
instead?
* design. | ||
* | ||
* @param array List of sub-client names | ||
* @since 2019.07 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update @since
lines to 2021.10
/** is the password realy new? */ | ||
if (!$isNew) { | ||
$errors['isNew'] = "The given password is not new!"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a password isn't new doesn't matter for the customer so we could remove that
placeholder="<?= $enc->attr( $this->translate( 'client', 'Old password' ) ) ?>" | ||
> | ||
<?php if( isset($passwordErrors['oldPassword']) ) : ?> | ||
<span class="invalid-feedback d-block" role="alert"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No Bootstrap utitlity classes (d-block
) please because they make theming harder.
No description provided.