Merge pull request #212 from YunoHost/good_practices_about_passwords

Add comments about good practices for choosing passwords
This commit is contained in:
Alexandre Aubin 2018-11-04 15:59:50 +01:00 committed by GitHub
commit 61d516be83
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 2 deletions

View file

@ -340,6 +340,7 @@
// Default values // Default values
args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string'; args[k].type = (typeof v.type !== 'undefined') ? v.type : 'string';
args[k].inputType = 'text'; args[k].inputType = 'text';
args[k].isPassword = false;
args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required'; args[k].required = (typeof v.optional !== 'undefined' && v.optional == "true") ? '' : 'required';
args[k].attributes = ""; args[k].attributes = "";
args[k].helpText = ""; args[k].helpText = "";
@ -458,6 +459,7 @@
if (v.name == 'password' || args[k].type == 'password') { if (v.name == 'password' || args[k].type == 'password') {
// Change html input type // Change html input type
args[k].inputType = 'password'; args[k].inputType = 'password';
args[k].isPassword = true;
} }
}); });

View file

@ -149,6 +149,8 @@
"free": "Free", "free": "Free",
"fs_type": "FS Type", "fs_type": "FS Type",
"gateway": "Gateway: ", "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", "home": "Home",
"hook_adminjs_group_configuration": "Configuration", "hook_adminjs_group_configuration": "Configuration",
"hook_conf_cron": "Regular tasks", "hook_conf_cron": "Regular tasks",

View file

@ -41,11 +41,15 @@
<div class="form-group"> <div class="form-group">
<label for="{{name}}" class="col-sm-12">{{label}}</label> <label for="{{name}}" class="col-sm-12">{{label}}</label>
{{#if helpText}} {{#if helpText}}
<span class="help-block help-block--help col-sm-12">{{{helpText}}}</span> <span class="help-block help-block--help col-sm-12">{{{helpText}}}</span>
{{/if}} {{/if}}
<div class="col-sm-12"> <div class="col-sm-12">
{{#if isPassword}}
<p class="text-warning">{{t 'good_practices_about_admin_password'}}</p>
{{/if}}
{{#if choices}} {{#if choices}}
<select id="{{name}}" name="{{name}}" required class="form-control" {{{attributes}}}> <select id="{{name}}" name="{{name}}" required class="form-control" {{{attributes}}}>

View file

@ -7,6 +7,8 @@
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
<div class="alert alert-warning">{{t 'good_practices_about_admin_password'}}</div>
<div class="form-group"> <div class="form-group">
<label for="password" class="col-sm-4 control-label">{{t 'administration_password'}}</label> <label for="password" class="col-sm-4 control-label">{{t 'administration_password'}}</label>
<div class="col-sm-8"> <div class="col-sm-8">

View file

@ -6,6 +6,8 @@
<div class="separator"></div> <div class="separator"></div>
<div class="alert alert-warning">{{t 'good_practices_about_admin_password'}}</div>
<form action="#/tools/adminpw" method="PUT" class="form-horizontal"> <form action="#/tools/adminpw" method="PUT" class="form-horizontal">
<div class="panel panel-default"> <div class="panel panel-default">

View file

@ -65,7 +65,7 @@
<label for="confirmation" class="col-sm-3 control-label">{{t 'password_confirmation'}}</label> <label for="confirmation" class="col-sm-3 control-label">{{t 'password_confirmation'}}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input type="password" id="confirmation" name="confirmation" class="form-control" placeholder="•••••" required> <input type="password" id="confirmation" name="confirmation" class="form-control" placeholder="•••••" required>
<div class="help-block">{{t 'password_description' password_min_length}}</div> <div class="help-block">{{t 'good_practices_about_user_password'}}</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -89,7 +89,7 @@
<label for="confirmation" class="col-sm-3 control-label">{{t 'password_confirmation'}}</label> <label for="confirmation" class="col-sm-3 control-label">{{t 'password_confirmation'}}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<input type="password" id="confirmation" name="confirmation" class="form-control" placeholder="•••••"> <input type="password" id="confirmation" name="confirmation" class="form-control" placeholder="•••••">
<div class="help-block">{{t 'password_description' password_min_length}}</div> <div class="help-block">{{t 'good_practices_about_user_password'}}</div>
</div> </div>
</div> </div>