diff --git a/application/core/plugins/TwoFactorAdminLogin/TwoFactorAdminLogin.php b/application/core/plugins/TwoFactorAdminLogin/TwoFactorAdminLogin.php index d3f672978a0..8ba587c45b4 100644 --- a/application/core/plugins/TwoFactorAdminLogin/TwoFactorAdminLogin.php +++ b/application/core/plugins/TwoFactorAdminLogin/TwoFactorAdminLogin.php @@ -34,40 +34,40 @@ class TwoFactorAdminLogin extends AuthPluginBase 'type' => 'string', 'label' => 'Issuer', 'default' => 'LimeSurvey Survey Software', - 'help' => 'Will be displayed in the app as issuer name.' + 'help' => 'This will be displayed in the 2FA app as issuer name.' ), 'digits' => array( 'type' => 'string', - 'label' => 'Digits (6 is needed for most tools)', + 'label' => 'Code length', 'default' => '6', - 'help' => 'The number of digits the resulting codes will be. Please leave it at 6 for Google-Authenticator.' + 'help' => 'The number of digits the resulting codes will be. Leave it at 6 for best compatibility.' ), 'period' => array( 'type' => 'string', - 'label' => 'Time period (30 is needed for most tools)', + 'label' => 'Time period', 'default' => '30', - 'help' => 'The number of seconds a code will be valid. Please leave it at 30 for Google-Authenticator.' + 'help' => 'The number of seconds a code will be valid. Please leave it at 30 for best compatibility.' ), 'leeway' => array( 'type' => 'string', 'label' => 'Discrepancy', - 'default' => '0', + 'default' => '5', 'help' => 'What amount of discrepancy in seconds is allowed for the client.' ), 'algorithm' => array( 'type' => 'select', - 'label' => 'Algorithm (SHA1 is needed for most tools)', + 'label' => 'Algorithm', 'default' => 'sha1', 'options' => [ 'sha1' => 'SHA1 (Default)', 'sha256 ' => 'SHA256', 'md5' => 'MD5', ], - 'help' => 'The algorithm used, please keep in mind, that most tools only work with SHA1 hashing' + 'help' => 'Please keep in mind, that most tools only work with SHA1 hashing.' ), 'force2fa' => array( 'type' => 'select', - 'label' => 'Force 2FA', + 'label' => 'Force 2FA on login', 'default' => '0', 'options' => [ '0 ' => 'No', @@ -79,7 +79,6 @@ class TwoFactorAdminLogin extends AuthPluginBase public function init() { - //System events $this->subscribe('direct'); $this->subscribe('newDirectRequest'); @@ -93,6 +92,7 @@ public function init() $this->subscribe('afterLoginFormSubmit'); $this->subscribe('newUserSession'); } + //############## Plugin event handlers ##############// /** * Listen to direct requests @@ -208,7 +208,7 @@ public function beforeAdminMenuRender() $aMenuItemUserOptions = [ 'isDivider' => false, 'isSmallText' => false, - 'label' => '2FA-Setting', + 'label' => gT('General'), 'href' => $this->api->createUrl('admin/pluginhelper/sa/fullpagewrapper/plugin/TwoFactorAdminLogin/method/userindex', []), 'iconClass' => 'fa fa-user-secret', ]; @@ -219,7 +219,7 @@ public function beforeAdminMenuRender() $aMenuItemAdminOptions = [ 'isDivider' => false, 'isSmallText' => false, - 'label' => '2FA-Administration', + 'label' => gT('Administration'), 'href' => $this->api->createUrl('admin/pluginhelper/sa/fullpagewrapper/plugin/TwoFactorAdminLogin/method/index', []), 'iconClass' => 'fa fa-users', ]; @@ -228,7 +228,7 @@ public function beforeAdminMenuRender() $aNewMenuOptions = [ 'isDropDown' => true, - 'label' => '2-Factor-Settings', + 'label' => gT('2FA settings'), 'href' => '#', 'menuItems' => $aMenuItems, 'iconClass' => 'fa fa-lock fa-lg', diff --git a/application/core/plugins/TwoFactorAdminLogin/models/TFAUser.php b/application/core/plugins/TwoFactorAdminLogin/models/TFAUser.php index 75bb4484d85..e1912c7b90f 100644 --- a/application/core/plugins/TwoFactorAdminLogin/models/TFAUser.php +++ b/application/core/plugins/TwoFactorAdminLogin/models/TFAUser.php @@ -12,11 +12,11 @@ class TFAUser extends User public function attributeLabels() { return [ - 'authType' => 'Type of 2-Factor-Authentication used', - 'secretKey' => 'Authentication base value', + 'authType' => gT('Two-factor authentication method'), + 'secretKey' => gT('Secret base key'), 'uid' => gT('User ID'), - 'firstLogin' => 'Logged in with 2FA', - 'forceNewFirstLogin' => 'Force to set 2FA' + 'firstLogin' => gT('Logged in with 2FA'), + 'forceNewFirstLogin' => gT('Force to enable 2FA') ]; } diff --git a/application/core/plugins/TwoFactorAdminLogin/models/TFAUserKey.php b/application/core/plugins/TwoFactorAdminLogin/models/TFAUserKey.php index 54911e84f7d..7e1a932206e 100644 --- a/application/core/plugins/TwoFactorAdminLogin/models/TFAUserKey.php +++ b/application/core/plugins/TwoFactorAdminLogin/models/TFAUserKey.php @@ -40,13 +40,14 @@ public function primaryKey() } /** @inheritdoc */ - public function attributeLabels() { + public function attributeLabels() + { return [ - 'authType' => 'Type of 2-Factor-Authentication used', - 'secretKey' => 'Authentication base value', + 'authType' => gT('Two-factor authentication method'), + 'secretKey' => gT('Secret base key'), 'uid' => gT('User ID'), - 'firstLogin' => 'Logged in with 2FA', - 'forceNewFirstLogin' => 'Force to set 2FA' + 'firstLogin' => gT('Logged in with 2FA'), + 'forceNewFirstLogin' => gT('Force to enable 2FA') ]; } diff --git a/application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php b/application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php index d64a4520bce..838ef0ee9b4 100644 --- a/application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php +++ b/application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php @@ -1,4 +1,3 @@ - @@ -7,28 +6,28 @@
- createUrl('plugins/direct', ['plugin' => 'TwoFactorAdminLogin', 'function' => 'directCallConfirmKey']), 'post', ["id"=>"TFA--modalform"])?> - + createUrl('plugins/direct', ['plugin' => 'TwoFactorAdminLogin', 'function' => 'directCallConfirmKey']), 'post', ["id" => "TFA--modalform"])?> +
- true ]); ?>
- - true]); ?> + + true]); ?>
- +
- - true]); ?> + + true]); ?>
- +
diff --git a/application/core/plugins/TwoFactorAdminLogin/views/userindex.php b/application/core/plugins/TwoFactorAdminLogin/views/userindex.php index 829bea4bb2e..9078af657e0 100644 --- a/application/core/plugins/TwoFactorAdminLogin/views/userindex.php +++ b/application/core/plugins/TwoFactorAdminLogin/views/userindex.php @@ -42,8 +42,8 @@ class="btn btn-default TFA--actionconfirm" data-href="createUrl("plugins/direct/plugin/TwoFactorAdminLogin/function/directCallDeleteKey")?>" id="TFA--unset2fa" - data-confirmtext="" - data-buttons="{confirm_cancel: '', confirm_ok: ''}" + data-confirmtext="" + data-buttons='{"confirm_cancel": "", "confirm_ok": ""}' data-uid="uid?>" data-errortext="" >