#458 fix on email subject message and on send sms

This commit is contained in:
Antonio Cordeddu
2022-08-11 12:15:53 +02:00
parent 8b6c6282f9
commit 902970c718
30 changed files with 54 additions and 31 deletions

View File

@ -216,7 +216,7 @@ Configures the parameter values used on [MailFactory](../../src/User/Factory/Mai
'confirmationMailSubject' => Yii::t('usuario', 'Confirm account on {0}', $app->name),
'reconfirmationMailSubject' => Yii::t('usuario', 'Confirm email change on {0}', $app->name),
'recoveryMailSubject' => Yii::t('usuario', 'Complete password reset on {0}', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication on {0}', $app->name),
]
```

View File

@ -14,7 +14,7 @@ values:
'confirmationMailSubject' => Yii::t('usuario', 'Confirm account on {0}', $app->name),
'reconfirmationMailSubject' => Yii::t('usuario', 'Confirm email change on {0}', $app->name),
'recoveryMailSubject' => Yii::t('usuario', 'Complete password reset on {0}', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication on {0}', $app->name),
]
```

View File

@ -292,7 +292,7 @@ class Bootstrap implements BootstrapInterface
'confirmationMailSubject' => Yii::t('usuario', 'Confirm account on {0}', $app->name),
'reconfirmationMailSubject' => Yii::t('usuario', 'Confirm email change on {0}', $app->name),
'recoveryMailSubject' => Yii::t('usuario', 'Complete password reset on {0}', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication', $app->name),
'twoFactorMailSubject' => Yii::t('usuario', 'Code for two factor authentication on {0}', $app->name),
];
$module->mailParams = array_merge($defaults, $module->mailParams);

View File

@ -583,9 +583,9 @@ class SettingsController extends Controller
$success=true;
}else{
$success = $user->updateAttributes(['auth_tf_mobile_phone' => $mobilePhone]);
$success = $success && $this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run();
}
$success = $success && $this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run();
return [
'success' => $success,
'message' => $success

View File

@ -66,7 +66,6 @@ class TwoFactorSmsCodeGeneratorService implements ServiceInterface
$mobilePhone=$user->getAuthTfMobilePhone();
if( null===$mobilePhone || $mobilePhone=='' ){
Yii::$app->session->addFlash('error', Yii::t('usuario','Mobile phone not found, please check your profile'));
return false;
}
// send sms

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -274,7 +274,7 @@ return [
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd. MMMM YYYY, HH:mm}',
'{0} cannot be blank.' => '{0} darf nicht leer sein.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -277,7 +277,7 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '{0, date, dd. MMM YYYY, HH:mm}',
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd. MMMM YYYY, HH:mm}',
'{0} cannot be blank.' => '{0} darf nicht leer sein.',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
'Information' => '',
@ -300,4 +300,5 @@ return [
'Two factor authentication code by email' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -276,7 +276,7 @@ return [
'privacy policy' => 'política de privacidad',
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd MMMM, YYYY HH:mm}',
'{0} cannot be blank.' => '{0} no puede estar vacío.',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
'Insert' => '',
@ -300,4 +300,5 @@ return [
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'{0, date, MMM dd, YYYY HH:mm}' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -269,7 +269,7 @@ return [
'{0} cannot be blank.' => '{0} ei või olla tühi.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'Authentication rule class {0} can not be instantiated' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your two factor authentication method is based on "{0}".' => '',
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -173,7 +173,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Create new permission' => '',
'Create new role' => '',
'Create new rule' => '',
@ -300,4 +300,5 @@ return [
'privacy policy' => '',
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -273,7 +273,7 @@ return [
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd MMMM YYYY HH:mm}',
'{0} cannot be blank.' => '{0} ne peut être vide.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'{0, date, MMM dd, YYYY HH:mm}' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -271,7 +271,7 @@ return [
'{0} cannot be blank.' => '{0} nem lehet üres.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => 'Figli',
'Class' => 'Classe',
'Close' => 'Chiudi',
'Code for two factor authentication' => 'Codice per l\'autenticazione a due fattori',
'Code for two factor authentication on {0}' => 'Codice per l\'autenticazione a due fattori su {0}',
'Complete password reset on {0}' => 'Completa la procedura di reset della password su {0}',
'Confirm' => 'Conferma',
'Confirm account on {0}' => 'Conferma l\'account su {0}',

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -271,7 +271,7 @@ return [
'{0} cannot be blank.' => '{0} kan niet leeg zijn.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -271,7 +271,7 @@ return [
'{0} cannot be blank.' => '{0} nie może pozostać bez wartości',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -271,7 +271,7 @@ return [
'{0} cannot be blank.' => '{0} não pode estar em branco',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -262,7 +262,7 @@ return [
'Awesome, almost there. Now you need to click the confirmation link sent to your old email address.' => '',
'Children' => '',
'Class' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Email' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
@ -300,4 +300,5 @@ return [
'Your two factor authentication method is based on "{0}".' => '',
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -271,7 +271,7 @@ return [
'{0} cannot be blank.' => '{0} nu poate fi gol.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'An email with instructions to create a new password has been sent to {email} if it is associated with an {appName} account. Your existing password has not been changed.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -274,7 +274,7 @@ return [
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, d MMMM YYYY в HH:mm}',
'{0} cannot be blank.' => '{0} не может быть пустым.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -300,4 +300,5 @@ return [
'Your consent is required to work with this site' => '',
'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '',
'Your two factor authentication method is based on "{0}".' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -273,7 +273,7 @@ return [
'{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, MMMM dd, YYYY HH:mm}',
'{0} cannot be blank.' => '{0} не може бути порожнім.',
'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Data privacy' => '',
'Error while enabling SMS two factor authentication. Please reload the page.' => '',
'Google Authenticator' => '',
@ -304,6 +304,7 @@ return [
'An email has been sent with instructions for resetting your password' => '@@Лист з інструкціями по зміні пароля надіслано на електронну адресу@@',
'Awesome, almost there. ' => '@@Чудово, майже все.@@',
'Class "{0}" does not exist' => '@@Клас "{0}" не існує@@',
'Code for two factor authentication' => '@@@@',
'Disable Two-Factor Auth' => '@@Вимкнути двофакторну аутентифікацію@@',
'Enable Two-factor auth' => '@@Увімкнути двофакторну аутентифікацію@@',
'Every user having your role has two factor authentication mandatory, you must enable it' => '@@@@',

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];

View File

@ -63,7 +63,7 @@ return [
'Children' => '',
'Class' => '',
'Close' => '',
'Code for two factor authentication' => '',
'Code for two factor authentication on {0}' => '',
'Complete password reset on {0}' => '',
'Confirm' => '',
'Confirm account on {0}' => '',
@ -300,4 +300,5 @@ return [
'{0, date, MMM dd, YYYY HH:mm}' => '',
'{0, date, MMMM dd, YYYY HH:mm}' => '',
'{0} cannot be blank.' => '',
'Code for two factor authentication' => '@@@@',
];