[CONTROLLER][UserPanel] Email is now sanitized and validated before calling corresponding setter

This commit is contained in:
2022-01-27 16:59:43 +00:00
parent 64a698d255
commit 1576d253a5
3 changed files with 55 additions and 4 deletions

View File

@@ -115,8 +115,22 @@ class UserPanel extends Controller
// TODO Add support missing settings
$form = Form::create([
['outgoing_email', TextType::class, ['label' => _m('Outgoing email'), 'required' => false, 'help' => _m('Change the email we use to contact you')]],
['incoming_email', TextType::class, ['label' => _m('Incoming email'), 'required' => false, 'help' => _m('Change the email you use to contact us (for posting, for instance)')]],
['outgoing_email_sanitized', TextType::class,
[
'label' => _m('Outgoing email'),
'required' => false,
'help' => _m('Change the email we use to contact you'),
'data' => $user->getOutgoingEmail() ?: '',
],
],
['incoming_email_sanitized', TextType::class,
[
'label' => _m('Incoming email'),
'required' => false,
'help' => _m('Change the email you use to contact us (for posting, for instance)'),
'data' => $user->getIncomingEmail() ?: '',
],
],
['save_email', SubmitType::class, ['label' => _m('Save email info')]],
]);