From 0a5ac9d70a6ba58452e1883e29f881928d106c83 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 27 Oct 2018 23:05:57 +0000 Subject: [PATCH] Add comment about good practices for choosing passwords --- src/js/yunohost/controllers/apps.js | 2 ++ src/locales/en.json | 2 ++ src/views/app/app_install.ms | 4 ++++ src/views/postinstall/postinstall_3.ms | 2 ++ src/views/tools/tools_adminpw.ms | 2 ++ src/views/user/user_create.ms | 2 +- src/views/user/user_edit.ms | 2 +- 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index b1fe4cab..cd3160af 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -250,6 +250,7 @@ // Default values args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string'; args[k].inputType = 'text'; + args[k].isPassword = false; args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required'; args[k].attributes = ""; args[k].helpText = ""; @@ -368,6 +369,7 @@ if (v.name == 'password' || args[k].type == 'password') { // Change html input type args[k].inputType = 'password'; + args[k].isPassword = true; } }); diff --git a/src/locales/en.json b/src/locales/en.json index 857c211d..cdcfc316 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -145,6 +145,8 @@ "free": "Free", "fs_type": "FS Type", "gateway": "Gateway: ", + "good_practices_about_admin_password": "You are now about to define a new admin password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).", + "good_practices_about_user_password": "You are now about to define a new user password. The password should be at least 8 characters - though it is good practice to use longer password (i.e. a passphrase) and/or to use various kind of characters (uppercase, lowercase, digits and special characters).", "home": "Home", "hook_adminjs_group_configuration": "Configuration", "hook_conf_cron": "Regular tasks", diff --git a/src/views/app/app_install.ms b/src/views/app/app_install.ms index 11ee8bce..4d4bc075 100644 --- a/src/views/app/app_install.ms +++ b/src/views/app/app_install.ms @@ -41,11 +41,15 @@
+ {{#if helpText}} {{{helpText}}} {{/if}}
+ {{#if isPassword}} +

{{t 'good_practices_about_admin_password'}}

+ {{/if}} {{#if choices}} -
{{t 'password_description' password_min_length}}
+
{{t 'good_practices_about_user_password'}}
diff --git a/src/views/user/user_edit.ms b/src/views/user/user_edit.ms index 81dab868..d98b727f 100644 --- a/src/views/user/user_edit.ms +++ b/src/views/user/user_edit.ms @@ -89,7 +89,7 @@
-
{{t 'password_description' password_min_length}}
+
{{t 'good_practices_about_user_password'}}