if ($model->load($this->getRequest()->post()) | if ($model->load($this->getRequest()->post()) | ||||
&& $model->validate()) { | && $model->validate()) { | ||||
// l'utilisateur ne peut pas changer d'adresse email | |||||
$oldModel = $this->findModel($idUser); | |||||
$model->email = $oldModel->email; | |||||
// modification du mot de passe | // modification du mot de passe | ||||
if (strlen($model->password_new)) { | if (strlen($model->password_new)) { | ||||
$model->password_hash = \Yii::$app->security->generatePasswordHash($model->password_new); | $model->password_hash = \Yii::$app->security->generatePasswordHash($model->password_new); |
<?= $form->field($model, 'lastname')->textInput() ?> | <?= $form->field($model, 'lastname')->textInput() ?> | ||||
<?= $form->field($model, 'name')->textInput() ?> | <?= $form->field($model, 'name')->textInput() ?> | ||||
<?= $form->field($model, 'phone')->textInput() ?> | <?= $form->field($model, 'phone')->textInput() ?> | ||||
<?= $form->field($model, 'email')->textInput(['readonly' => true]); ?> | |||||
<?= $form->field($model, 'email')->textInput(); ?> | |||||
<?= $form->field($model, 'address')->textarea() ?> | <?= $form->field($model, 'address')->textarea() ?> | ||||
<h2>Mot de passe</h2> | <h2>Mot de passe</h2> |