Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.0.0.b4
-
Fix Version/s: 4.3.0-b1
-
Component/s: Client Interface, Staff Interface
-
Labels:None
Description
To setup password-autogeneration, add a set of data attributes to a clickable element, which will open a modal and allow you to generate a password.
The clickable element must have the class name generate-password to automatically be set as a password-generating modal.
The following data attributes must be set on the generate-password-class element:
- data-base-url The base URL of the Blesta installation. This is generally the value of $this->base_uri in php
- data-for-class The name of a CSS class to set the generated password to. HTML elements of this class will be set the password
- data-length The length of the password to generate (e.g. 10)
- data-options A string-representation of JSON data representing characters to include in the password generator. This must be formatted as described in unicode-passgen.
- The below example will include all latin alpha characters lower-case and upper-case from A to Z, but exclude the lower and upper-case letter 'i'.
- {"include": [{"chars": [["A", "Z"], ["a", "z"]]}], "exclude": [{"chars": [["i"], ["I"]]}]}
The following data attributes are optional:
- data-modal-title This is the title to set for the modal. By default, it will use the text of the generate-password element
- (Admin UI only) data-modal-close This is the name to set as the close button language, e.g. 'Close'
Password fields are used throughout the system, (in core, modules, etc.) many of which need 2 fields (one for the password, one for confirmation).
We would like to include a simple Blesta core-javascript function for generating a modal, allowing a password to be generated and auto-populate the password fields. It will show the user the plaintext password so they can copy it (like cPanel).
A simple "data-generate-password='unique_field'" attribute to the input field(s) would auto-set this modal to the form next to the field. I imagine the attribute should contain a unique value per SET of fields to which the password should apply.
e.g.
if we have password and confirm_password fields, they should both have the same attribute value so that we only display the "generate password" link next to the first field, instead of both, and both will still be updated when a password is generated.
Password strength estimator see https://github.com/dropbox/zxcvbn
Possibly could be adopted to generate passwords?
Question: How well does this work with non-english languages?