Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-40180

Create and Edit User Details forms' Save and Update Details button are always greyed out when password fields are hidden/not rendered (via custom code)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: RESOLVED
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Test Plan:
      Hide

      Please add a Test Plan here.

      Show
      Please add a Test Plan here.

      Description

      I'm not sure if this is a valid issue because this depends on custom code we use to prevent the password fields in the Create User and Edit User details form from being rendered if the user logged via single sign on (ldap) because we don't those users changing their password through sakai.

      However, looking at the code in userEditValidation.js, perhaps this was something other institutions may have also done in the past

      // Validate the password from the form
      USER.validatePassword = function () {
      .
      .
      .
          // If there's a password field and the password policy is enabled, get the password valud and the user ID
          if (pw !== null && USER.isPasswordPolicyEnabled) {
      

      Notice that is says "If there's a password field"

      But then later in the code, regardless of whether or not there's a password field it tries to validate that the passwords match. And the matching must be run even if there's no password field because I believe there's another form validation check later on that will fail if the password matching hasn't been validated (again, even if there's no password field)

      But between 11.x and 12.0, there was a change in userEditValidation.js (SAK-32233 Merge velocity admin tools together)

      // Verify the passwords match
      USER.verifyPasswordsMatch = function () {
      .
      .
      .
          if (pw !== null) {
      .
      .
      .
          else {
      -        USER.passwordsMatch = true;
      +        return;
          }
      

      So now, because we don't render the password fields, the passwords will never match and the Save or Update details buttons are always greyed out

      I'm not sure, but this might also happen if USER.isPasswordPolicyEnabled = false, but I tried reviewing the code that sets that, but it was a bit confusing.

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  Unassigned Unassigned
                  Reporter:
                  austinUH Austin
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration