diff --git a/CHANGELOG.md b/CHANGELOG.md index a556cab..2d4f44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.6.0 work in progress + **WARNING**: this release (long time due) makes a step forward in PHP compatibility, leaving behind obsolete versions. While yii2-usuario should still work without issues on 5.6, from now on testing and development will @@ -27,6 +28,7 @@ There's a change in flash messages handling, please see #391 - Ehn #428: Translations of the placeholders in the login widget (anapaulaxenon) - Update PHP-CS-Fixer configuration to new version (maxxer) - Fix #391: Always create flash messages, allow `enableFlashMessages` only to dictate display (ajmedway) +- Ehn #458: Multiple 2FA channels (email, sms) (acordeddu) ## 1.5.1 April 5, 2020 diff --git a/composer.json b/composer.json index df734da..c989ca3 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,8 @@ "2amigos/yii2-selectize-widget": "^1.1", "yiisoft/yii2-authclient": "^2.1", "yiisoft/yii2-httpclient": "^2.0", - "yiisoft/yii2-bootstrap": "^2.0" + "yiisoft/yii2-bootstrap": "^2.0", + "yetopen/yii2-sms-sender-interface": "^0.1.1" }, "suggest": { "yiisoft/yii2-symfonymailer": "A mailer driver is needed to send e-mails. Older versions use abandoned Swiftmailer which can be replaced with symfonymailer", diff --git a/docs/installation/configuration-options.md b/docs/installation/configuration-options.md index d4bb406..069cab2 100755 --- a/docs/installation/configuration-options.md +++ b/docs/installation/configuration-options.md @@ -28,6 +28,42 @@ Setting this attribute will allow users to configure their login process with tw By default, Google Authenticator App for two-factor authentication cycles in periods of 30 seconds. In order to allow a bigger period so to avoid out of sync issues. +#### twoFactorAuthenticationValidators (type: `array`) + +An array of arrays of channels availables for two factor authentication. The keys in the arrays have the following meaning: +class: it will be the validator class with namespace; +name: the name that will be displayed in the section to the user; +configurationUrl: the url to the action that will dispaly the configuration form for the validator; +codeDurationTime: time duration of the code in session in seconds (not applicable for Google authenticator); +smsSender: the reference to SmsSenderInterface for managing SMS send; +enabled: true if you want to enable the channel, false otherwise. + +The following is the default configuration: + +'google-authenticator'=>[ + 'class'=>\Da\User\Validator\TwoFactorCodeValidator::class, + 'description'=>Yii::t('usuario', 'Google Authenticator'), + 'configurationUrl'=>'user/settings/two-factor', + 'enabled'=>true +], +'email'=>[ + 'class'=>\Da\User\Validator\TwoFactorEmailValidator::class, + 'description'=>Yii::t('usuario', 'Email'), + 'configurationUrl'=>'user/settings/two-factor-email', + 'codeDurationTime'=>300, + 'enabled'=>true +], +'sms'=>[ + 'class'=>\Da\User\Validator\TwoFactorTextMessageValidator::class, + 'description'=>Yii::t('usuario', 'Text message'), + 'configurationUrl'=>'user/settings/two-factor-sms', + 'codeDurationTime'=>300, + 'smsSender'=>'smsSender', + 'enabled'=>true +] + +For instructions about implementation of SMS sending see at the following link: https://www.yiiframework.com/extension/yetopen/yii2-sms-aruba + #### twoFactorAuthenticationForcedPermissions (type: `array`, default: `[]`) The list of permissions for which two factor authentication is mandatory. In order to perform the check in every action you must configure a filter into your config file like this: @@ -45,7 +81,6 @@ use Da\User\Filter\TwoFactorAuthenticationEnforceFilter; ... This will redirect the user to their account page until the two factor authentication is enabled. - #### enableGdprCompliance (type: `boolean`, default: `false`) Setting this attribute enables a serie of measures to comply with EU GDPR regulation, like data consent, right to be forgotten and data portability. @@ -197,6 +232,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 on {0}', $app->name), ] ``` diff --git a/docs/installation/mailer.md b/docs/installation/mailer.md index 870db41..0b355ef 100644 --- a/docs/installation/mailer.md +++ b/docs/installation/mailer.md @@ -14,6 +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 on {0}', $app->name), ] ``` diff --git a/src/User/Bootstrap.php b/src/User/Bootstrap.php index a614e7a..45bf065 100755 --- a/src/User/Bootstrap.php +++ b/src/User/Bootstrap.php @@ -29,6 +29,7 @@ use yii\base\InvalidConfigException; use yii\console\Application as ConsoleApplication; use yii\i18n\PhpMessageSource; use yii\web\Application as WebApplication; +use yii\helpers\ArrayHelper; /** * Bootstrap class of the yii2-usuario extension. Configures container services, initializes translations, @@ -133,7 +134,7 @@ class Bootstrap implements BootstrapInterface if (in_array($name, ['User', 'Profile', 'Token', 'SocialNetworkAccount', 'SessionHistory'])) { $di->set( "Da\\User\\Query\\{$name}Query", - function () use ($model) { + function() use($model) { return $model::find(); } ); @@ -164,6 +165,38 @@ class Bootstrap implements BootstrapInterface }); } + // Initialize array of two factor authentication validators available + $defaultTwoFactorAuthenticationValidators = + [ + 'google-authenticator'=>[ + 'class'=>\Da\User\Validator\TwoFactorCodeValidator::class, + 'description'=>Yii::t('usuario', 'Google Authenticator'), + 'configurationUrl'=>'user/settings/two-factor', + 'enabled'=>true + ], + 'email'=>[ + 'class'=>\Da\User\Validator\TwoFactorEmailValidator::class, + 'description'=>Yii::t('usuario', 'Email'), + 'configurationUrl'=>'user/settings/two-factor-email', + // Time duration of the code in seconds + 'codeDurationTime'=>300, + 'enabled'=>true + ], + 'sms'=>[ + 'class'=>\Da\User\Validator\TwoFactorTextMessageValidator::class, + 'description'=>Yii::t('usuario', 'Text message'), + 'configurationUrl'=>'user/settings/two-factor-sms', + // component for sending sms + 'smsSender'=>'smsSender', + // Time duration of the code in seconds + 'codeDurationTime'=>300, + 'enabled'=>true + ] + ]; + + $app->getModule('user')->twoFactorAuthenticationValidators = ArrayHelper::merge( + $defaultTwoFactorAuthenticationValidators, $app->getModule('user')->twoFactorAuthenticationValidators); + if ($app instanceof WebApplication) { // override Yii $di->set( @@ -175,6 +208,11 @@ class Bootstrap implements BootstrapInterface ] ); } + + + + + } catch (Exception $e) { die($e); } @@ -256,6 +294,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 on {0}', $app->name), ]; $module->mailParams = array_merge($defaults, $module->mailParams); diff --git a/src/User/Controller/SecurityController.php b/src/User/Controller/SecurityController.php index eb02d5e..4e123c4 100644 --- a/src/User/Controller/SecurityController.php +++ b/src/User/Controller/SecurityController.php @@ -20,6 +20,9 @@ use Da\User\Service\SocialNetworkAccountConnectService; use Da\User\Service\SocialNetworkAuthenticateService; use Da\User\Traits\ContainerAwareTrait; use Da\User\Traits\ModuleAwareTrait; +use Da\User\Validator\TwoFactorEmailValidator; +use Da\User\Validator\TwoFactorTextMessageValidator; +use Da\User\Model\User; use Yii; use yii\authclient\AuthAction; use yii\base\InvalidConfigException; @@ -30,6 +33,7 @@ use yii\filters\VerbFilter; use yii\web\Controller; use yii\web\Response; use yii\widgets\ActiveForm; +use yii\helpers\ArrayHelper; class SecurityController extends Controller { @@ -212,13 +216,31 @@ class SecurityController extends Controller return $this->goBack(); } - } + } + else{ + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $credentials=Yii::$app->session->get('credentials'); + $login= $credentials['login']; + $user = User::findOne(['email'=>$login]); + if( $user==null){ + $user = User::findOne(['username'=>$login]); + } + $tfType = $user->getAuthTfType(); + + $class = ArrayHelper::getValue($validators,$tfType.'.class'); + $object = $this + ->make($class, [$user, null, $this->module->twoFactorAuthenticationCycles]); + $object->generateCode(); + + } + return $this->render( 'confirm', [ 'model' => $form, - 'module' => $this->module, + 'module' => $this->module ] ); } diff --git a/src/User/Controller/SettingsController.php b/src/User/Controller/SettingsController.php index ac88424..048c457 100755 --- a/src/User/Controller/SettingsController.php +++ b/src/User/Controller/SettingsController.php @@ -30,10 +30,14 @@ use Da\User\Search\SessionHistorySearch; use Da\User\Service\EmailChangeService; use Da\User\Service\SessionHistory\TerminateUserSessionsService; use Da\User\Service\TwoFactorQrCodeUriGeneratorService; +use Da\User\Service\TwoFactorEmailCodeGeneratorService; +use Da\User\Service\TwoFactorSmsCodeGeneratorService; use Da\User\Traits\ContainerAwareTrait; use Da\User\Traits\ModuleAwareTrait; use Da\User\Validator\AjaxRequestModelValidator; use Da\User\Validator\TwoFactorCodeValidator; +use Da\User\Validator\TwoFactorEmailValidator; +use Da\User\Validator\TwoFactorTextMessageValidator; use Yii; use yii\base\DynamicModel; use yii\filters\AccessControl; @@ -115,6 +119,7 @@ class SettingsController extends Controller 'two-factor', 'two-factor-enable', 'two-factor-disable', + 'two-factor-mobile-phone' ], 'roles' => ['@'], ], @@ -448,20 +453,27 @@ class SettingsController extends Controller public function actionTwoFactor($id) { - /** - * - * - * @var User $user - */ + $choice=Yii::$app->request->post('choice'); + /** @var User $user */ $user = $this->userQuery->whereId($id)->one(); if (null === $user) { throw new NotFoundHttpException(); } - $uri = $this->make(TwoFactorQrCodeUriGeneratorService::class, [$user])->run(); - - return $this->renderAjax('two-factor', ['id' => $id, 'uri' => $uri]); + switch ($choice) { + case 'google-authenticator': + $uri = $this->make(TwoFactorQrCodeUriGeneratorService::class, [$user])->run(); + return $this->renderAjax('two-factor', ['id' => $id, 'uri' => $uri]); + case 'email': + $emailCode = $this->make(TwoFactorEmailCodeGeneratorService::class, [$user])->run(); + return $this->renderAjax('two-factor-email', ['id' => $id, 'code' => $emailCode]); + case 'sms': + // get mobile phone, if exists + $mobilePhone=$user->getAuthTfMobilePhone(); + $smsCode = $this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run(); + return $this->renderAjax('two-factor-sms', ['id' => $id, 'code' => $smsCode, 'mobilePhone' => $mobilePhone]); + } } public function actionTwoFactorEnable($id) @@ -482,18 +494,21 @@ class SettingsController extends Controller ]; } $code = Yii::$app->request->get('code'); + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $choice = Yii::$app->request->get('choice'); + $codeDurationTime = ArrayHelper::getValue($validators, $choice.'.codeDurationTime', 300); + $class = ArrayHelper::getValue($validators, $choice.'.class'); - $success = $this - ->make(TwoFactorCodeValidator::class, [$user, $code, $this->module->twoFactorAuthenticationCycles]) - ->validate(); - - $success = $success && $user->updateAttributes(['auth_tf_enabled' => '1']); + $object = $this + ->make($class, [$user, $code, $this->module->twoFactorAuthenticationCycles]); + $success = $object->validate(); + $success = $success && $user->updateAttributes(['auth_tf_enabled' => '1','auth_tf_type' => $choice]); + $message = $success ? $object->getSuccessMessage() : $object->getUnsuccessMessage($codeDurationTime); return [ 'success' => $success, - 'message' => $success - ? Yii::t('usuario', 'Two factor authentication successfully enabled.') - : Yii::t('usuario', 'Verification failed. Please, enter new code.') + 'message' => $message ]; } @@ -578,4 +593,39 @@ class SettingsController extends Controller $account->delete(); $this->trigger(SocialNetworkConnectEvent::EVENT_AFTER_DISCONNECT, $event); } + + public function actionTwoFactorMobilePhone($id) + { + Yii::$app->response->format = Response::FORMAT_JSON; + + /** + * + * + * @var User $user + */ + $user = $this->userQuery->whereId($id)->one(); + + if (null === $user) { + return [ + 'success' => false, + 'message' => Yii::t('usuario', 'User not found.') + ]; + } + $mobilePhone = Yii::$app->request->get('mobilephone'); + $currentMobilePhone = $user->getAuthTfMobilePhone(); + $success=false; + if ($currentMobilePhone==$mobilePhone) { + $success=true; + } else { + $success = $user->updateAttributes(['auth_tf_mobile_phone' => $mobilePhone]); + $success = $success && $this->make(TwoFactorSmsCodeGeneratorService::class, [$user])->run(); + } + + return [ + 'success' => $success, + 'message' => $success + ? Yii::t('usuario', 'Mobile phone number successfully enabled.') + : Yii::t('usuario', 'Error while enabling SMS two factor authentication. Please reload the page.'), + ]; + } } diff --git a/src/User/Event/MailEvent.php b/src/User/Event/MailEvent.php index 13e55b7..b16199a 100644 --- a/src/User/Event/MailEvent.php +++ b/src/User/Event/MailEvent.php @@ -27,6 +27,7 @@ class MailEvent extends Event const TYPE_RECOVERY = 'recovery'; const TYPE_CONFIRM = 'confirm'; const TYPE_RECONFIRM = 'reconfirm'; + const TYPE_TWOFACTORCODE = 'twofactorcode'; const EVENT_BEFORE_SEND_MAIL = 'beforeSendMail'; const EVENT_AFTER_SEND_MAIL = 'afterSendMail'; diff --git a/src/User/Factory/MailFactory.php b/src/User/Factory/MailFactory.php index 6cb7920..4018a30 100644 --- a/src/User/Factory/MailFactory.php +++ b/src/User/Factory/MailFactory.php @@ -114,6 +114,28 @@ class MailFactory return static::makeMailerService(MailEvent::TYPE_RECONFIRM, $from, $to, $subject, 'reconfirmation', $params); } + /** + * @param User $user + * @param String $code + * + * @throws InvalidConfigException + * @return MailService + */ + public static function makeTwoFactorCodeMailerService(User $user, String $code) + { + /** @var Module $module */ + $module = Yii::$app->getModule('user'); + $to = $user->email; + + $from = $module->mailParams['fromEmail']; + $subject = $module->mailParams['twoFactorMailSubject']; + $params = [ + 'code' => $code, + ]; + + return static::makeMailerService(MailEvent::TYPE_TWOFACTORCODE, $from, $to, $subject, 'twofactorcode', $params); + } + /** * Builds a MailerService. * diff --git a/src/User/Form/LoginForm.php b/src/User/Form/LoginForm.php index ca33b05..c1cd3f7 100644 --- a/src/User/Form/LoginForm.php +++ b/src/User/Form/LoginForm.php @@ -15,14 +15,19 @@ use Da\User\Helper\SecurityHelper; use Da\User\Model\User; use Da\User\Query\UserQuery; use Da\User\Traits\ModuleAwareTrait; +use Da\User\Traits\ContainerAwareTrait; use Da\User\Validator\TwoFactorCodeValidator; +use Da\User\Validator\TwoFactorEmailValidator; +use Da\User\Validator\TwoFactorTextMessageValidator; use Yii; use yii\base\InvalidParamException; use yii\base\Model; +use yii\helpers\ArrayHelper; class LoginForm extends Model { use ModuleAwareTrait; + use ContainerAwareTrait; /** * @var string login User's email or username @@ -107,14 +112,21 @@ class LoginForm extends Model 'twoFactorAuthenticationCodeValidate' => [ 'twoFactorAuthenticationCode', function ($attribute) { - if ($this->user === null || - !(new TwoFactorCodeValidator( - $this->user, - $this->twoFactorAuthenticationCode, - $this->module->twoFactorAuthenticationCycles - )) - ->validate()) { + + if ($this->user === null ) { $this->addError($attribute, Yii::t('usuario', 'Invalid two factor authentication code')); + }else{ + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $type = $this->user->auth_tf_type; + $class = ArrayHelper::getValue($validators,$type.'.class'); + $codeDurationTime = ArrayHelper::getValue($validators,$type.'.codeDurationTime', 300); + $validator = $this + ->make($class, [$this->user, $this->twoFactorAuthenticationCode, $this->module->twoFactorAuthenticationCycles]); + $success = $validator->validate(); + if (!$success) { + $this->addError($attribute, $validator->getUnsuccessLoginMessage($codeDurationTime)); + } } } ], diff --git a/src/User/Migration/m000000_000010_add_auth_tf_type_auth_tf_mobile_phone_columns_to_user_table.php b/src/User/Migration/m000000_000010_add_auth_tf_type_auth_tf_mobile_phone_columns_to_user_table.php new file mode 100644 index 0000000..b64c146 --- /dev/null +++ b/src/User/Migration/m000000_000010_add_auth_tf_type_auth_tf_mobile_phone_columns_to_user_table.php @@ -0,0 +1,30 @@ +addColumn('{{%user}}', 'auth_tf_type', $this->string(20)->after('auth_tf_enabled')->null()); + $this->addColumn('{{%user}}', 'auth_tf_mobile_phone', $this->string(20)->after('auth_tf_type')->null()); + + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn('{{%user}}', 'auth_tf_type'); + $this->dropColumn('{{%user}}', 'auth_tf_mobile_phone'); + } +} diff --git a/src/User/Model/User.php b/src/User/Model/User.php index eb30c83..dbd5484 100644 --- a/src/User/Model/User.php +++ b/src/User/Model/User.php @@ -36,28 +36,30 @@ use yii\web\IdentityInterface; * @property bool $gdpr_consent whether user has consent personal data processing * * Database fields: - * @property int $id - * @property string $username - * @property string $email - * @property string $unconfirmed_email - * @property string $password_hash - * @property string $auth_key - * @property string $auth_tf_key - * @property int $auth_tf_enabled - * @property string $registration_ip - * @property int $confirmed_at - * @property int $blocked_at - * @property int $flags - * @property int $created_at - * @property int $updated_at - * @property int $last_login_at - * @property int $gdpr_consent_date date of agreement of data processing - * @property string $last_login_ip - * @property int $password_changed_at - * @property int $password_age - * Defined relations: + * @property int $id + * @property string $username + * @property string $email + * @property string $unconfirmed_email + * @property string $password_hash + * @property string $auth_key + * @property string $auth_tf_key + * @property int $auth_tf_enabled + * @property string $auth_tf_type + * @property string $auth_tf_mobile_phone + * @property string $registration_ip + * @property int $confirmed_at + * @property int $blocked_at + * @property int $flags + * @property int $created_at + * @property int $updated_at + * @property int $last_login_at + * @property int $gdpr_consent_date date of agreement of data processing + * @property string $last_login_ip + * @property int $password_changed_at + * @property int $password_age + * Defined relations: * @property SocialNetworkAccount[] $socialNetworkAccounts - * @property Profile $profile + * @property Profile $profile */ class User extends ActiveRecord implements IdentityInterface { @@ -65,8 +67,8 @@ class User extends ActiveRecord implements IdentityInterface use ContainerAwareTrait; // following constants are used on secured email changing process - const OLD_EMAIL_CONFIRMED = 0b01; - const NEW_EMAIL_CONFIRMED = 0b10; + public const OLD_EMAIL_CONFIRMED = 0b01; + public const NEW_EMAIL_CONFIRMED = 0b10; /** * @var string Plain password. Used for model validation @@ -248,7 +250,9 @@ class User extends ActiveRecord implements IdentityInterface // two factor auth rules 'twoFactorSecretTrim' => ['auth_tf_key', 'trim'], 'twoFactorSecretLength' => ['auth_tf_key', 'string', 'max' => 16], - 'twoFactorEnabledNumber' => ['auth_tf_enabled', 'boolean'] + 'twoFactorEnabledNumber' => ['auth_tf_enabled', 'boolean'], + 'twoFactorTypeLength' => ['auth_tf_type', 'string', 'max' => 20], + 'twoFactorMobilePhoneLength' => ['auth_tf_mobile_phone', 'string', 'max' => 20], ]; } @@ -361,4 +365,22 @@ class User extends ActiveRecord implements IdentityInterface return $d->diff(new \DateTime(), true)->format("%a"); } + + /** + * Returns authentication two factor type enabled for the user + * @return integer + */ + public function getAuthTfType() + { + return $this->getAttribute('auth_tf_type'); + } + + /** + * Returns the mobile phone number used for sms authentication two factor for the user + * @return string + */ + public function getAuthTfMobilePhone() + { + return $this->getAttribute('auth_tf_mobile_phone'); + } } diff --git a/src/User/Module.php b/src/User/Module.php index 1212d13..2eee4fd 100755 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -100,6 +100,10 @@ class Module extends BaseModule * @var array list of permissions for which two factor authentication is mandatory */ public $twoFactorAuthenticationForcedPermissions = []; + /** + * @var array list of channels for two factor authentication availables + */ + public $twoFactorAuthenticationValidators = []; /** * @var int cycles of key generation are set on 30 sec. To avoid sync issues, increased validity up to 60 sec. * @see http://2fa-library.readthedocs.io/en/latest/ diff --git a/src/User/Service/TwoFactorEmailCodeGeneratorService.php b/src/User/Service/TwoFactorEmailCodeGeneratorService.php new file mode 100644 index 0000000..1589f40 --- /dev/null +++ b/src/User/Service/TwoFactorEmailCodeGeneratorService.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Service; + +use Da\TwoFA\Manager; +use Da\User\Contracts\ServiceInterface; +use Da\User\Model\User; +use Da\User\Factory\MailFactory; + +use Yii; + +class TwoFactorEmailCodeGeneratorService implements ServiceInterface +{ + /** + * @var User + */ + protected $user; + + /** + * TwoFactorEmailCodeGeneratorService constructor. + * + * @param User $user + */ + public function __construct(User $user) + { + $this->user = $user; + } + + /** + * @inheritdoc + */ + public function run() + { + $user = $this->user; + if (!$user->auth_tf_key) { + $user->auth_tf_key = (new Manager())->generateSecretKey(); + $user->updateAttributes(['auth_tf_key']); + } + // generate key + $code = random_int(0, 999999); + $code = str_pad($code, 6, 0, STR_PAD_LEFT); + // send email + $mailService = MailFactory::makeTwoFactorCodeMailerService($user, $code); + // check the sending emailYii::t( + if(!$mailService->run()){ + Yii::$app->session->addFlash('error', Yii::t('usuario','The email sending failed, please check your configuration.')); + return false; + }else{ + // put key in session + Yii::$app->session->set("email_code_time", date('Y-m-d H:i:s')); + Yii::$app->session->set("email_code", $code); + } + return $code; + } +} diff --git a/src/User/Service/TwoFactorSmsCodeGeneratorService.php b/src/User/Service/TwoFactorSmsCodeGeneratorService.php new file mode 100644 index 0000000..cda2fbb --- /dev/null +++ b/src/User/Service/TwoFactorSmsCodeGeneratorService.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Service; + +use Da\TwoFA\Manager; +use Da\User\Contracts\ServiceInterface; +use Da\User\Model\User; +use Da\User\Factory\MailFactory; +use yii\di\Instance; +use yetopen\smssender\SmsSenderInterface; +use yii\helpers\ArrayHelper; + +use Yii; + +class TwoFactorSmsCodeGeneratorService implements ServiceInterface +{ + /** + * @var User + */ + protected $user; + + /** + * @var Type + */ + protected $type; + + /** + * @var SmsSenderInterface + */ + protected $smsSender; + + /** + * TwoFactorSmsCodeGeneratorService constructor. + * + * @param User $user + */ + public function __construct(User $user) + { + $this->user = $user; + $this->type = 'sms'; + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $smsSender = ArrayHelper::getValue($validators,'sms'.'.smsSender'); + $this->smsSender = Instance::ensure($smsSender, SmsSenderInterface::class); + } + + /** + * @inheritdoc + */ + public function run() + { + // generate key + $code = random_int(0, 999999); + $code = str_pad($code, 6, 0, STR_PAD_LEFT); + // get the mobile phone of the user + $user = $this->user; + $mobilePhone=$user->getAuthTfMobilePhone(); + + if( null===$mobilePhone || $mobilePhone=='' ){ + return false; + } + // send sms + $success = $this->smsSender->send($mobilePhone, $code); + if($success){ + // put key in session + Yii::$app->session->set("sms_code_time", date('Y-m-d H:i:s')); + Yii::$app->session->set("sms_code", $code); + }else{ + Yii::$app->session->addFlash('error', Yii::t('usuario','The sms sending failed, please check your configuration.')); + return false; + } + return true; + } +} diff --git a/src/User/Validator/TwoFactorCodeValidator.php b/src/User/Validator/TwoFactorCodeValidator.php index 9308390..2c02575 100644 --- a/src/User/Validator/TwoFactorCodeValidator.php +++ b/src/User/Validator/TwoFactorCodeValidator.php @@ -15,9 +15,14 @@ use Da\TwoFA\Exception\InvalidSecretKeyException; use Da\TwoFA\Manager; use Da\User\Contracts\ValidatorInterface; use Da\User\Model\User; +use Da\User\Traits\ContainerAwareTrait; +use Da\User\Service\TwoFactorQrCodeUriGeneratorService; +use Yii; class TwoFactorCodeValidator implements ValidatorInterface { + use ContainerAwareTrait; + protected $user; protected $code; protected $cycles; @@ -46,4 +51,49 @@ class TwoFactorCodeValidator implements ValidatorInterface $manager = new Manager(); return $manager->setCycles($this->cycles)->verify($this->code, $this->user->auth_tf_key); } + + /** + * @return bool + * + */ + public function isValidationCodeToBeSent() + { + return false; + } + + /** + * @return string + * + */ + public function getSuccessMessage() + { + return Yii::t('usuario', 'Two factor authentication successfully enabled.'); + } + + /** + * @return string + * + */ + public function getUnsuccessMessage($codeDurationTime) + { + return Yii::t('usuario', 'Verification failed. Please, enter new code.'); + } + + /** + * @return string + * + */ + public function getUnsuccessLoginMessage($codeDurationTime) + { + return Yii::t('usuario', 'Verification failed. Please, enter new code.'); + } + + /** + * @return string + * + */ + public function generateCode() + { + return $this->make(TwoFactorQrCodeUriGeneratorService::class,[$this->user])->run(); + } } diff --git a/src/User/Validator/TwoFactorEmailValidator.php b/src/User/Validator/TwoFactorEmailValidator.php new file mode 100644 index 0000000..b7619fd --- /dev/null +++ b/src/User/Validator/TwoFactorEmailValidator.php @@ -0,0 +1,114 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Validator; + +use Da\TwoFA\Exception\InvalidSecretKeyException; +use Da\User\Model\User; +use Yii; +use yii\helpers\ArrayHelper; +use Da\User\Traits\ContainerAwareTrait; +use Da\User\Service\TwoFactorEmailCodeGeneratorService; + + +class TwoFactorEmailValidator extends TwoFactorCodeValidator +{ + use ContainerAwareTrait; + + protected $user; + protected $code; + protected $cycles; + protected $type; + + /** + * TwoFactorCodeValidator constructor. + * + * @param User $user + * @param $code + * @param int $cycles + */ + public function __construct(User $user, $code, $cycles = 0) + { + $this->user = $user; + $this->code = $code; + $this->cycles = $cycles; + $this->type = 'email'; + } + + /** + * @throws InvalidSecretKeyException + * @return bool|int + * + */ + public function validate() + { + if(is_null($this->code) || $this->code == '' ) + return false; + $emailCodeTime = new \DateTime(Yii::$app->session->get("email_code_time")); + $currentTime = new \DateTime('now'); + $interval = $currentTime->getTimestamp()-$emailCodeTime->getTimestamp(); + + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $codeDurationTime = ArrayHelper::getValue($validators,$this->type.'.codeDurationTime', 300); + + if($interval > $codeDurationTime ){ + return false; + } + $emailCode = Yii::$app->session->get("email_code"); + return $this->code==$emailCode; + } + + /** + * @return bool + * + */ + public function isValidationCodeToBeSent() + { + return true; + } + + /** + * @return string + * + */ + public function getSuccessMessage() + { + return Yii::t('usuario', 'Two factor authentication successfully enabled.'); + } + + /** + * @return string + * + */ + public function getUnsuccessMessage($codeDurationTime) + { + return Yii::t('usuario', 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.', [$codeDurationTime]); + } + + /** + * @return string + * + */ + public function getUnsuccessLoginMessage($codeDurationTime) + { + return Yii::t('usuario', 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.', [$codeDurationTime]); + } + + /** + * @return string + * + */ + public function generateCode() + { + return $this->make(TwoFactorEmailCodeGeneratorService::class,$this->user)->run(); + } +} diff --git a/src/User/Validator/TwoFactorTextMessageValidator.php b/src/User/Validator/TwoFactorTextMessageValidator.php new file mode 100644 index 0000000..42930f8 --- /dev/null +++ b/src/User/Validator/TwoFactorTextMessageValidator.php @@ -0,0 +1,105 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +namespace Da\User\Validator; + +use Da\TwoFA\Exception\InvalidSecretKeyException; +use Da\User\Model\User; +use Yii; +use yii\helpers\ArrayHelper; +use Da\User\Traits\ContainerAwareTrait; +use Da\User\Service\TwoFactorSmsCodeGeneratorService; + + +class TwoFactorTextMessageValidator extends TwoFactorCodeValidator +{ + use ContainerAwareTrait; + + protected $user; + protected $code; + protected $cycles; + + /** + * TwoFactorCodeValidator constructor. + * + * @param User $user + * @param $code + * @param int $cycles + */ + public function __construct(User $user, $code, $cycles = 0) + { + $this->user = $user; + + $this->code = $code; + $this->cycles = $cycles; + $this->type = 'sms'; + } + + /** + * @throws InvalidSecretKeyException + * @return bool|int + * + */ + public function validate() + { + if(is_null($this->code) || $this->code == '' ) + return false; + $smsCodeTime = new \DateTime(Yii::$app->session->get("sms_code_time")); + $currentTime = new \DateTime('now'); + $interval = $currentTime->getTimestamp()-$smsCodeTime->getTimestamp(); + $module = Yii::$app->getModule('user'); + $validators = $module->twoFactorAuthenticationValidators; + $codeDurationTime = ArrayHelper::getValue($validators,$this->type.'.codeDurationTime', 300); + + if($interval > $codeDurationTime ){ + return false; + } + $smsCode = Yii::$app->session->get("sms_code"); + return $this->code==$smsCode; + } + + /** + * @return string + * + */ + public function getSuccessMessage() + { + return Yii::t('usuario', 'Two factor authentication successfully enabled.'); + } + + /** + * @return string + * + */ + public function getUnsuccessMessage($codeDurationTime) + { + return Yii::t('usuario', 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.', [$codeDurationTime]); + } + + /** + * @return string + * + */ + public function getUnsuccessLoginMessage($codeDurationTime) + { + return Yii::t('usuario', 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.', [$codeDurationTime]); + } + + /** + * @return string + * + */ + public function generateCode() + { + $object = $this->make(TwoFactorSmsCodeGeneratorService::class,[$this->user]); + return $object->run(); + } +} diff --git a/src/User/resources/i18n/ca/usuario.php b/src/User/resources/i18n/ca/usuario.php index 85cb688..1ab5b64 100644 --- a/src/User/resources/i18n/ca/usuario.php +++ b/src/User/resources/i18n/ca/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -201,16 +213,22 @@ return [ 'Status' => '', 'Submit' => '', 'Switch identities is disabled.' => '', + 'Text message' => '', 'Terminate all sessions' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/da/usuario.php b/src/User/resources/i18n/da/usuario.php index 4aff8ed..7b01acf 100644 --- a/src/User/resources/i18n/da/usuario.php +++ b/src/User/resources/i18n/da/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/de-DU/usuario.php b/src/User/resources/i18n/de-DU/usuario.php index 077874f..e6c4fa0 100644 --- a/src/User/resources/i18n/de-DU/usuario.php +++ b/src/User/resources/i18n/de-DU/usuario.php @@ -280,9 +280,21 @@ return [ 'Every user having your role has two factor authentication mandatory, you must enable it' => '@@@@', 'Now you can resume the login process' => '@@@@', 'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '', + 'Code for two factor authentication on {0}' => '', 'Active' => '', 'Current' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', @@ -290,6 +302,14 @@ return [ 'Session history' => '', 'Status' => '', 'Submit' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Terminate all sessions' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', diff --git a/src/User/resources/i18n/de/usuario.php b/src/User/resources/i18n/de/usuario.php index ca6120d..0e10d59 100644 --- a/src/User/resources/i18n/de/usuario.php +++ b/src/User/resources/i18n/de/usuario.php @@ -280,6 +280,9 @@ return [ 'Active' => '', 'Current' => '', 'IP' => '', + 'Code for two factor authentication on {0}' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', 'Inactive' => '', 'Last activity' => '', 'Session ID' => '', @@ -288,6 +291,23 @@ return [ 'Terminate all sessions' => '', 'User ID' => '', 'User agent' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '', 'If you haven\'t received a password, you can reset it at' => '', 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', diff --git a/src/User/resources/i18n/es/usuario.php b/src/User/resources/i18n/es/usuario.php index 274c9ad..ad0a77e 100644 --- a/src/User/resources/i18n/es/usuario.php +++ b/src/User/resources/i18n/es/usuario.php @@ -276,6 +276,26 @@ 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 on {0}' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'If you haven\'t received a password, you can reset it at' => '', 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', 'Active' => '', @@ -291,7 +311,6 @@ return [ 'User agent' => '', '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}".' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', - 'An email has been sent with instructions for resetting your password' => '@@Se ha enviado un correo electrónico con instrucciones para restablecer su contraseña@@', - 'Two factor authentication protects you against stolen credentials' => '@@La autenticación de dos factores le protege del robo de credenciales@@', ]; diff --git a/src/User/resources/i18n/et/usuario.php b/src/User/resources/i18n/et/usuario.php index c29df1a..7e231ef 100644 --- a/src/User/resources/i18n/et/usuario.php +++ b/src/User/resources/i18n/et/usuario.php @@ -271,7 +271,19 @@ return [ 'Active' => '', 'Authentication rule class {0} can not be instantiated' => '', 'Current' => '', + 'Code for two factor authentication on {0}' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', @@ -282,6 +294,14 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', 'User agent' => '', @@ -290,6 +310,7 @@ return [ 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', '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}".' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', ]; diff --git a/src/User/resources/i18n/fa-IR/usuario.php b/src/User/resources/i18n/fa-IR/usuario.php index 660d45f..fcb54e9 100644 --- a/src/User/resources/i18n/fa-IR/usuario.php +++ b/src/User/resources/i18n/fa-IR/usuario.php @@ -174,6 +174,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Create new permission' => '', 'Create new role' => '', 'Create new rule' => '', @@ -191,14 +192,20 @@ return [ 'Enable two factor authentication' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Force password change at next login' => '', + 'Google Authenticator' => '', 'Here you can download your personal data in a comma separated values format.' => '', 'I agree processing of my personal data and the use of cookies to facilitate the operation of this site. For more information read our {privacyPolicy}' => '', 'IP' => '', 'Impersonate this user' => '', 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid password' => '', 'Invalid two factor authentication code' => '', 'Invalid value' => '', @@ -208,6 +215,9 @@ return [ 'Last login IP' => '', 'Last login time' => '', 'Last password change' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Never' => '', 'New rule' => '', 'Not found' => '', @@ -215,6 +225,8 @@ return [ 'Once you have deleted your data, you will not longer be able to sign in with this account.' => '', 'Password age' => '', 'Please be certain' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Registration on this website is disabled' => '', @@ -234,14 +246,22 @@ return [ 'Send password recovery email' => '', 'Submit' => '', 'Switch identities is disabled.' => '', + 'Text message' => '', 'The "recaptcha" component must be configured.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -283,6 +303,7 @@ return [ 'Your password has expired, you must change it now' => '', 'Your personal information has been removed' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0} cannot be blank.' => '', diff --git a/src/User/resources/i18n/fi/usuario.php b/src/User/resources/i18n/fi/usuario.php index 85cb688..1ab5b64 100644 --- a/src/User/resources/i18n/fi/usuario.php +++ b/src/User/resources/i18n/fi/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -201,16 +213,22 @@ return [ 'Status' => '', 'Submit' => '', 'Switch identities is disabled.' => '', + 'Text message' => '', 'Terminate all sessions' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/fr/usuario.php b/src/User/resources/i18n/fr/usuario.php index 29eaf22..61e6e4c 100644 --- a/src/User/resources/i18n/fr/usuario.php +++ b/src/User/resources/i18n/fr/usuario.php @@ -273,9 +273,21 @@ 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 on {0}' => '', 'Active' => '', 'Current' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'If you haven\'t received a password, you can reset it at' => '', 'IP' => '', 'Inactive' => '', @@ -285,10 +297,19 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', 'User agent' => '', '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}".' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', ]; diff --git a/src/User/resources/i18n/hr/usuario.php b/src/User/resources/i18n/hr/usuario.php index 4aff8ed..7b01acf 100644 --- a/src/User/resources/i18n/hr/usuario.php +++ b/src/User/resources/i18n/hr/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/hu/usuario.php b/src/User/resources/i18n/hu/usuario.php index 235a30b..a1db9f8 100644 --- a/src/User/resources/i18n/hu/usuario.php +++ b/src/User/resources/i18n/hu/usuario.php @@ -272,8 +272,20 @@ return [ 'According to the European General Data Protection Regulation (GDPR) we need your consent to work with your personal data.' => '', 'Active' => '', '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 on {0}' => '', 'Current' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', @@ -285,11 +297,20 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', 'User agent' => '', 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', 'Your consent is required to work with this site' => '', + 'Your two factor authentication method is based on "{0}".' => '', 'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '', ]; diff --git a/src/User/resources/i18n/it/usuario.php b/src/User/resources/i18n/it/usuario.php index 4b0bca1..c026247 100644 --- a/src/User/resources/i18n/it/usuario.php +++ b/src/User/resources/i18n/it/usuario.php @@ -63,6 +63,7 @@ return [ 'Children' => 'Figli', 'Class' => 'Classe', 'Close' => 'Chiudi', + '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}', @@ -105,10 +106,12 @@ return [ 'Error occurred while deleting user' => 'Si è verificato un errore durante l\'eliminazione dell\'utente', 'Error sending registration message to "{email}". Please try again later.' => 'C\'è stato un errore nell\'invio del messaggio di registrazione all\'indirizzo "{email}". Per favore ritenta più tardi.', 'Error sending welcome message to "{email}". Please try again later.' => 'C\'è stato un errore nell\'invio del messaggio di benvenuto all\'indirizzo "{email}". Per favore ritenta più tardi.', + 'Error while enabling SMS two factor authentication. Please reload the page.' => 'Errore in fase di attivazione dell\'autenticazione a due fattori tramite SMS. Ricarica la pagina', 'Export my data' => 'Esporta i miei dati', 'Finish' => 'Completa', 'Force password change at next login' => 'Forza il cambio password al prossimo accesso', 'Forgot password?' => 'Password dimenticata?', + 'Google Authenticator' => 'Autenticatore di Google', 'Gravatar email' => 'Email di Gravatar', 'Hello' => 'Ciao', 'Here you can download your personal data in a comma separated values format.' => 'Da qui puoi scaricare i tuoi dati in formato CSV.', @@ -121,6 +124,10 @@ return [ 'In order to complete your request, please click the link below' => 'Per completare la richiesta fai click sul collegamento qui sotto', 'In order to finish your registration, we need you to enter following fields' => 'Per finalizzare la registrazione devi fornire le seguenti informazioni', 'Information' => 'Informazioni', + 'Insert' => 'Inserisci', + 'Insert the code you received by SMS.' => 'Inserisci il codice ricevuto tramite SMS.', + 'Insert the code you received by email.' => 'Inserisci il codice ricevuto tramite email.', + 'Insert the mobile phone number where you want to receive text message in international format' => 'Inserisci il numero di telefono sul quale ricevere il messaggio di testo nel formato internazionale', 'Invalid login or password' => 'Utente o password non validi', 'Invalid or expired link' => 'Collegamento non valido o scaduto', 'Invalid password' => 'Password non valida', @@ -136,6 +143,9 @@ return [ 'Login' => 'Accedi', 'Logout' => 'Esci', 'Manage users' => 'Gestisci gli utenti', + 'Mobile phone not found, please check your profile' => 'Il numero di telefono non è stato trovato. Verifica il tuo profilo', + 'Mobile phone number' => 'Numero di cellulare', + 'Mobile phone number successfully enabled.' => 'Il numero di cellulare è stato abilitato', 'Name' => 'Nome', 'Networks' => 'Rete', 'Never' => 'Mai', @@ -156,6 +166,8 @@ return [ 'Please be certain' => 'Pensaci bene', 'Please click the link below to complete your password reset' => 'Per favore fai click sul collegamento sotto per completare il cambio password', 'Please fix following errors:' => 'Per favore correggi i seguenti errori:', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => 'Inserire il codice corretto. Il codice è valido per {0} secondi. Se si desidera ricevere un nuovo codice cliccare su \'Annulla\' e ripetere la procedura di autenticazione', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => 'Inserire il codice corretto. Il codice è valido per {0} secondi. Se si desidera ricevere un nuovo codice, chiudere questa finestra e ripetere la richiesta di abilitazione.', 'Privacy' => 'Privacy', 'Privacy settings' => 'Impostazioni privacy', 'Profile' => 'Profilo', @@ -192,10 +204,15 @@ return [ 'Something went wrong' => 'È successo qualcosa di strano', 'Submit' => 'Invia', 'Switch identities is disabled.' => 'Il cambio identità è disabilitato', + 'Text message' => 'Messaggio di testo tramite SMS', 'Thank you for signing up on {0}' => 'Grazie per esserti registrato su {0}', 'Thank you, registration is now complete.' => 'Grazie, la tua registrazione è completa.', 'The "recaptcha" component must be configured.' => 'Occorre configurare il componente "recaptcha".', 'The confirmation link is invalid or expired. Please try requesting a new one.' => 'Il link di conferma non è valido o scaduto. Per favore prova a richiederne uno nuovo', + 'The email address set is: "{0}".' => 'L\'indirizzo email impostato è: "{0}".', + 'The email sending failed, please check your configuration.' => 'L\'invio della email non è riuscito, verifica la configurazione', + 'The phone number set is: "{0}".' => 'Il numero di telefono impostato è: "{0}".', + 'The sms sending failed, please check your configuration.' => 'L\'invio del messaggio di testo non è riuscito, verifica il numero di cellulare o contatta l\'assistenza', 'The verification code is incorrect.' => 'Il codice di verifica non è corretto.', 'There is neither role nor permission with name "{0}"' => 'Non esiste un ruolo o permesso di nome "{0}', 'There was an error in saving user' => 'Errore in salvataggio utente', @@ -208,6 +225,8 @@ return [ 'Time zone is not valid' => 'Il fuso orario non è valido', 'Two Factor Authentication (2FA)' => 'Autenticazione a due fattori (2FA)', 'Two factor authentication code' => 'Codice di autenticazione a due fattori', + 'Two factor authentication code by SMS' => 'Codice di autenticazione a due fattori tramite SMS', + 'Two factor authentication code by email' => 'Codice di autenticazione a due fattori tramite email', 'Two factor authentication has been disabled.' => 'Autenticazione a due fattori disabilitata.', 'Two factor authentication protects you in case of stolen credentials' => 'L\'autenticazione a due fattori ti protegge in caso di furto di credenziali', 'Two factor authentication successfully enabled.' => 'Autenticazione a due fattori abilitata con successo.', @@ -275,21 +294,10 @@ return [ 'Your personal information has been removed' => 'I tuoi dati personali sono stati rimossi', 'Your profile has been updated' => 'Il tuo profilo è stato aggiornato', 'Your role requires 2FA, you won\'t be able to use the application until you enable it' => 'Il tuo ruolo richiede l\'autenticazione a due fattori, non potrai usare l\'applicazione finché non l\'avrai abilitata', + 'Your two factor authentication method is based on "{0}".' => 'La tua autenticazione a due fattori è basata su "{0}".', 'privacy policy' => 'politica della privacy', '{0, date, MMM dd, YYYY HH:mm}' => '{0, date, MMM dd, YYYY HH:mm}', '{0, date, MMMM dd, YYYY HH:mm}' => '{0, date, dd MMMM YYYY HH:mm}', '{0} cannot be blank.' => '{0} non può essere vuoto.', - 'If you haven\'t received a password, you can reset it at' => '', - 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', - 'Active' => '', - 'Current' => '', - 'IP' => '', - 'Inactive' => '', - 'Last activity' => '', - 'Session ID' => '', - 'Session history' => '', - 'Status' => '', - 'Terminate all sessions' => '', - 'User ID' => '', - 'User agent' => '', + 'This is the code to insert to enable two factor authentication' => '', ]; diff --git a/src/User/resources/i18n/kk/usuario.php b/src/User/resources/i18n/kk/usuario.php index 4aff8ed..7b01acf 100644 --- a/src/User/resources/i18n/kk/usuario.php +++ b/src/User/resources/i18n/kk/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/lt/usuario.php b/src/User/resources/i18n/lt/usuario.php index 85cb688..1ab5b64 100644 --- a/src/User/resources/i18n/lt/usuario.php +++ b/src/User/resources/i18n/lt/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -201,16 +213,22 @@ return [ 'Status' => '', 'Submit' => '', 'Switch identities is disabled.' => '', + 'Text message' => '', 'Terminate all sessions' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/nl/usuario.php b/src/User/resources/i18n/nl/usuario.php index 394afa5..5654719 100644 --- a/src/User/resources/i18n/nl/usuario.php +++ b/src/User/resources/i18n/nl/usuario.php @@ -273,11 +273,23 @@ return [ 'Active' => '', '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.' => '', 'Current' => '', + 'Code for two factor authentication on {0}' => '', 'Data privacy' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', 'If you haven\'t received a password, you can reset it at' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Rule class name' => '', 'Select rule...' => '', 'Session ID' => '', @@ -285,6 +297,14 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', diff --git a/src/User/resources/i18n/pl/usuario.php b/src/User/resources/i18n/pl/usuario.php index 60d799e..6ffa68c 100644 --- a/src/User/resources/i18n/pl/usuario.php +++ b/src/User/resources/i18n/pl/usuario.php @@ -278,12 +278,31 @@ return [ 'Inactive' => '', 'Last activity' => '', 'If you haven\'t received a password, you can reset it at' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Rule class name' => '', 'Select rule...' => '', 'Session ID' => '', 'Session history' => '', 'Status' => '', 'Submit' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Terminate all sessions' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', diff --git a/src/User/resources/i18n/pt-BR/usuario.php b/src/User/resources/i18n/pt-BR/usuario.php index c2d8a19..c9f397b 100644 --- a/src/User/resources/i18n/pt-BR/usuario.php +++ b/src/User/resources/i18n/pt-BR/usuario.php @@ -273,7 +273,19 @@ return [ 'Active' => '', '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.' => '', 'Current' => '', + 'Code for two factor authentication on {0}' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', @@ -285,6 +297,14 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', diff --git a/src/User/resources/i18n/pt-PT/usuario.php b/src/User/resources/i18n/pt-PT/usuario.php index bc33ab1..5e58439 100644 --- a/src/User/resources/i18n/pt-PT/usuario.php +++ b/src/User/resources/i18n/pt-PT/usuario.php @@ -264,15 +264,27 @@ return [ 'Children' => '', 'Class' => '', 'Current' => '', + 'Code for two factor authentication on {0}' => '', 'Data privacy' => '', 'Email' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'If you haven\'t received a password, you can reset it at' => '', 'IP' => '', 'Inactive' => '', 'Items' => '', 'Last activity' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Password' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Rule class name' => '', 'Select rule...' => '', 'Session ID' => '', @@ -280,6 +292,14 @@ return [ 'Status' => '', 'Submit' => '', 'Terminate all sessions' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', @@ -290,6 +310,7 @@ return [ 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', '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}".' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', ]; diff --git a/src/User/resources/i18n/ro/usuario.php b/src/User/resources/i18n/ro/usuario.php index 45ed666..42c5fab 100644 --- a/src/User/resources/i18n/ro/usuario.php +++ b/src/User/resources/i18n/ro/usuario.php @@ -273,17 +273,37 @@ return [ 'Active' => '', '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.' => '', 'Current' => '', + 'Code for two factor authentication on {0}' => '', 'Data privacy' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', 'If you haven\'t received a password, you can reset it at' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Rule class name' => '', 'Select rule...' => '', 'Session ID' => '', 'Session history' => '', 'Status' => '', 'Submit' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Terminate all sessions' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', diff --git a/src/User/resources/i18n/ru/usuario.php b/src/User/resources/i18n/ru/usuario.php index b3fb27d..d0200b6 100755 --- a/src/User/resources/i18n/ru/usuario.php +++ b/src/User/resources/i18n/ru/usuario.php @@ -287,34 +287,30 @@ 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 on {0}' => '', 'Data privacy' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'If you haven\'t received a password, you can reset it at' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'You received this email because someone, possibly you or someone on your behalf, have created an account at {app_name}' => '', 'Your role requires 2FA, you won\'t be able to use the application until you enable it' => '', - 'A message has been sent to your email address. ' => '@@Сообщение было отправлено на вашу электронную почту@@', - 'An email has been sent with instructions for resetting your password' => '@@Вам отправлено письмо с инструкциями по смене пароля@@', - 'Awesome, almost there. ' => '@@Замечательно, почти готово!@@', - 'Class "{0}" does not exist' => '@@Класс "{0}" не найден@@', - 'Disable Two-Factor Auth' => '@@Отключить двухфакторную авторизацию@@', - 'Enable Two-factor auth' => '@@Включить двухфакторную авторизацию@@', - 'Every user having your role has two factor authentication mandatory, you must enable it' => '@@@@', - 'Invalid two-factor code' => '@@Неверный код двухфакторной авторизации@@', - 'Last login' => '@@Последний вход@@', - 'Now you can resume the login process' => '@@@@', - 'Registration ip' => '@@IP при регистрации@@', - 'Rule class can not be instantiated' => '@@Класс правила не может быть создан@@', - 'Rule class must extend "yii\\rbac\\Rule"' => '@@Класс правила должен наследоваться от "yii\\rbac\\Rule"@@', - 'This will disable two-factor auth. Are you sure?' => '@@Вы уверены, что хотите отключить двухфакторную авторизацию?@@', - 'Two Factor Authentication' => '@@Двухфакторная авторизация@@', - 'Two factor authentication protects you against stolen credentials' => '@@Двухфакторная авторизация защитит вас от кражи параметров доступа@@', - 'Two factor successfully enabled.' => '@@Включена двухфакторная авторизация.@@', - 'Two-Factor Authentication' => '@@Двухфакторная авторизация@@', - 'Two-factor auth protects you against stolen credentials' => '@@Двухфакторная авторизация предотвращает кражу ваших данных для входа.@@', - 'Two-factor authentication code' => '@@Код двухфакторной авторизации@@', - 'Two-factor authorization has been disabled.' => '@@Двухфакторная авторизация отключена.@@', - 'Two-factor code' => '@@Код двухфакторной авторизации@@', - 'Unable to disable two-factor authorization.' => '@@Не удалось отключить двухфакторную авторизацию.@@', - 'We couldn\'t re-send the mail to confirm your address. ' => '@@Мы не можем повторно отправить письмо для подтверждения вашего адреса электронной почты.@@', - 'We have sent confirmation links to both old and new email addresses. ' => '@@Мы отправили письма на ваш старый и новый почтовые ящики. Вы должны перейти по обеим, чтобы завершить процесс смены адреса.@@', + 'Your two factor authentication method is based on "{0}".' => '', ]; diff --git a/src/User/resources/i18n/th/usuario.php b/src/User/resources/i18n/th/usuario.php index 4aff8ed..7b01acf 100644 --- a/src/User/resources/i18n/th/usuario.php +++ b/src/User/resources/i18n/th/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/tr-TR/usuario.php b/src/User/resources/i18n/tr-TR/usuario.php index 85cb688..6e1578c 100644 --- a/src/User/resources/i18n/tr-TR/usuario.php +++ b/src/User/resources/i18n/tr-TR/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/uk/usuario.php b/src/User/resources/i18n/uk/usuario.php index 9f5017c..1cc35ad 100644 --- a/src/User/resources/i18n/uk/usuario.php +++ b/src/User/resources/i18n/uk/usuario.php @@ -273,17 +273,37 @@ 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 on {0}' => '', 'Active' => '', 'Current' => '', 'Data privacy' => '', 'IP' => '', 'Inactive' => '', 'Last activity' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', + 'Google Authenticator' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Recovery message sent' => '', 'Session ID' => '', 'Session history' => '', 'Status' => '', 'Submit' => '', + 'Text message' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', + 'This is the code to insert to enable two factor authentication' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Terminate all sessions' => '', 'Unfortunately, you can not work with this site without giving us consent to process your data.' => '', 'User ID' => '', diff --git a/src/User/resources/i18n/vi/usuario.php b/src/User/resources/i18n/vi/usuario.php index 85cb688..6e1578c 100644 --- a/src/User/resources/i18n/vi/usuario.php +++ b/src/User/resources/i18n/vi/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/i18n/zh-CN/usuario.php b/src/User/resources/i18n/zh-CN/usuario.php index 85cb688..6e1578c 100644 --- a/src/User/resources/i18n/zh-CN/usuario.php +++ b/src/User/resources/i18n/zh-CN/usuario.php @@ -64,6 +64,7 @@ return [ 'Children' => '', 'Class' => '', 'Close' => '', + 'Code for two factor authentication on {0}' => '', 'Complete password reset on {0}' => '', 'Confirm' => '', 'Confirm account on {0}' => '', @@ -107,10 +108,12 @@ return [ 'Error occurred while deleting user' => '', 'Error sending registration message to "{email}". Please try again later.' => '', 'Error sending welcome message to "{email}". Please try again later.' => '', + 'Error while enabling SMS two factor authentication. Please reload the page.' => '', 'Export my data' => '', 'Finish' => '', 'Force password change at next login' => '', 'Forgot password?' => '', + 'Google Authenticator' => '', 'Gravatar email' => '', 'Hello' => '', 'Here you can download your personal data in a comma separated values format.' => '', @@ -126,6 +129,10 @@ return [ 'In order to finish your registration, we need you to enter following fields' => '', 'Inactive' => '', 'Information' => '', + 'Insert' => '', + 'Insert the code you received by SMS.' => '', + 'Insert the code you received by email.' => '', + 'Insert the mobile phone number where you want to receive text message in international format' => '', 'Invalid login or password' => '', 'Invalid or expired link' => '', 'Invalid password' => '', @@ -142,6 +149,9 @@ return [ 'Login' => '', 'Logout' => '', 'Manage users' => '', + 'Mobile phone not found, please check your profile' => '', + 'Mobile phone number' => '', + 'Mobile phone number successfully enabled.' => '', 'Name' => '', 'Networks' => '', 'Never' => '', @@ -162,6 +172,8 @@ return [ 'Please be certain' => '', 'Please click the link below to complete your password reset' => '', 'Please fix following errors:' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please click on \'Cancel\' and repeat the login request.' => '', + 'Please, enter the right code. The code is valid for {0} seconds. If you want to get a new code, please close this window and repeat the enabling request.' => '', 'Privacy' => '', 'Privacy settings' => '', 'Profile' => '', @@ -202,15 +214,21 @@ return [ 'Submit' => '', 'Switch identities is disabled.' => '', 'Terminate all sessions' => '', + 'Text message' => '', 'Thank you for signing up on {0}' => '', 'Thank you, registration is now complete.' => '', 'The "recaptcha" component must be configured.' => '', 'The confirmation link is invalid or expired. Please try requesting a new one.' => '', + 'The email address set is: "{0}".' => '', + 'The email sending failed, please check your configuration.' => '', + 'The phone number set is: "{0}".' => '', + 'The sms sending failed, please check your configuration.' => '', 'The verification code is incorrect.' => '', 'There is neither role nor permission with name "{0}"' => '', 'There was an error in saving user' => '', 'This account has already been connected to another user' => '', 'This email address has already been taken' => '', + 'This is the code to insert to enable two factor authentication' => '', 'This username has already been taken' => '', 'This will disable two factor authentication. Are you sure?' => '', 'This will remove your personal data from this site. You will no longer be able to sign in.' => '', @@ -218,6 +236,8 @@ return [ 'Time zone is not valid' => '', 'Two Factor Authentication (2FA)' => '', 'Two factor authentication code' => '', + 'Two factor authentication code by SMS' => '', + 'Two factor authentication code by email' => '', 'Two factor authentication has been disabled.' => '', 'Two factor authentication protects you in case of stolen credentials' => '', 'Two factor authentication successfully enabled.' => '', @@ -288,6 +308,7 @@ return [ 'Your personal information has been removed' => '', 'Your profile has been updated' => '', '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}".' => '', 'privacy policy' => '', '{0, date, MMM dd, YYYY HH:mm}' => '', '{0, date, MMMM dd, YYYY HH:mm}' => '', diff --git a/src/User/resources/views/mail/text/twofactorcode.php b/src/User/resources/views/mail/text/twofactorcode.php new file mode 100644 index 0000000..1725566 --- /dev/null +++ b/src/User/resources/views/mail/text/twofactorcode.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +/** + * @var String $code + */ +?> += Yii::t('usuario', 'Hello') ?>, + += Yii::t('usuario', 'This is the code to insert to enable two factor authentication') ?>: + += $code ?> + += Yii::t('usuario', 'If you did not make this request you can ignore this email') ?>. diff --git a/src/User/resources/views/mail/twofactorcode.php b/src/User/resources/views/mail/twofactorcode.php new file mode 100644 index 0000000..210f84c --- /dev/null +++ b/src/User/resources/views/mail/twofactorcode.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view + * the LICENSE file that was distributed with this source code. + */ + +use yii\helpers\Html; + +/** + * @var String $code + * @var \Da\User\Model\Token $token + */ +?> +
+ = Yii::t('usuario', 'Hello') ?>, +
++ = Yii::t('usuario', 'This is the code to insert to enable two factor authentication') ?>: +
++ = $code ?> +
++ = Yii::t('usuario', 'If you did not make this request you can ignore this email') ?>. +
diff --git a/src/User/resources/views/security/confirm.php b/src/User/resources/views/security/confirm.php index dfc465f..ed06474 100644 --- a/src/User/resources/views/security/confirm.php +++ b/src/User/resources/views/security/confirm.php @@ -47,7 +47,6 @@ $this->params['breadcrumbs'][] = $this->title; 'twoFactorAuthenticationCode', ['inputOptions' => ['autofocus' => 'autofocus', 'class' => 'form-control', 'tabindex' => '1']] ) ?> -+ = Yii::t( + 'usuario', + 'Insert the code you received by email.' + ) ?> +
++ = Yii::t( + 'usuario', + 'Insert the mobile phone number where you want to receive text message in international format' + ) ?> +
++ = Yii::t( + 'usuario', + 'Insert the code you received by SMS.' + ) ?> +
+