Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-552

Add support for a data attribute with input fields for auto-generating a password

    Details

      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.

        Issue Links

          Activity

            People

            • Assignee:
              tyson Tyson Phillips (Inactive)
              Reporter:
              tyson Tyson Phillips (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jun/18

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 days, 4 hours, 12 minutes
                3d 4h 12m

                  Agile