From 58d00bf6fb76327ecf972776d1736ec78f00848d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 5 Jan 2018 02:45:34 +0100 Subject: [PATCH 1/3] Fix password displayed as username in Firefox password manager dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When finishing the setup of Nextcloud through the WebUI (setting admin user and database) Firefox offers to save the username and password. However, the password was shown in both the username and password fields of the Firefox password manager dialog. The problem was that the password input element (in the HTML form) is cloned in a text input element, which is used to show the password in plain text when clicking on the "Show password" button. As it was a text input immediately followed by a password input Firefox seemed to assume that it had to be the username and ignored the real username field, no matter the value set for the "autocomplete" attribute. Now the cloned text input is added after the password input, so Firefox no longer thinks that the cloned text input is the username field and the password manager dialog shows the proper username instead. Signed-off-by: Daniel Calviño Sánchez --- core/js/jquery-showpassword.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js index fc9de2170f..5d518c78bc 100644 --- a/core/js/jquery-showpassword.js +++ b/core/js/jquery-showpassword.js @@ -74,7 +74,7 @@ // Create clone var $clone = cloneElement($input); - $clone.insertBefore($input); + $clone.insertAfter($input); // Set callback arguments if(callback.fn){ From c8c4ce2da5e5df61649588e0405aabbfa14dc9d7 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 10 Jan 2018 21:48:24 +0100 Subject: [PATCH 2/3] Bump strengthify to 0.5.3 Signed-off-by: Roeland Jago Douma --- bower.json | 2 +- core/vendor/strengthify/.bower.json | 10 +++++----- core/vendor/strengthify/jquery.strengthify.js | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bower.json b/bower.json index 3808a69816..d37a924468 100644 --- a/bower.json +++ b/bower.json @@ -25,7 +25,7 @@ "select2": "~3.4.8", "zxcvbn": "*", "snapjs": "~2.0.0-rc1", - "strengthify": "^0.5.2", + "strengthify": "^0.5.3", "underscore": "~1.8.0", "bootstrap": "~3.3.6", "backbone": "~1.2.3", diff --git a/core/vendor/strengthify/.bower.json b/core/vendor/strengthify/.bower.json index 9a5973c311..de9904137e 100644 --- a/core/vendor/strengthify/.bower.json +++ b/core/vendor/strengthify/.bower.json @@ -1,6 +1,6 @@ { "name": "strengthify", - "version": "0.5.2", + "version": "0.5.3", "homepage": "https://github.com/MorrisJobke/strengthify", "authors": [ "Eve Ragins '); + $addAfter.after('
'); if (options.drawBars) { getWrapperFor(elemId) From b83204bf2cac18ed2fa1f07770a172932392abcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 6 Jan 2018 00:13:23 +0100 Subject: [PATCH 3/3] Add strengthify bar after plain text input clone of password input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To show the password in plain text "showPassword" adds a text input after the password input and swaps their visibility depending on whether the password has to be shown in plain text or not. In a similar way, "strengthify" by default adds the strength bar after the input element it was called on. Due to this, if "showPassword" is called before "strengthify" on the same password input then the strength bar ends between the password input and the text input, and when the text input is shown it appears below the strength bar. To fix this now the strength bar is added after the text input in those places in which "strengthify" was called after "showPassword" on the same element. Signed-off-by: Daniel Calviño Sánchez --- apps/user_ldap/js/renewPassword.js | 1 + settings/js/settings/personalInfo.js | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/user_ldap/js/renewPassword.js b/apps/user_ldap/js/renewPassword.js index bea2c0409f..7a58832c98 100644 --- a/apps/user_ldap/js/renewPassword.js +++ b/apps/user_ldap/js/renewPassword.js @@ -46,5 +46,6 @@ $(document).ready(function() { t('core', 'Strong password') ], drawTitles: true, + $addAfter: $('input[name="newPassword-clone"]'), }); }); diff --git a/settings/js/settings/personalInfo.js b/settings/js/settings/personalInfo.js index 0a39e60776..99254c4209 100644 --- a/settings/js/settings/personalInfo.js +++ b/settings/js/settings/personalInfo.js @@ -395,6 +395,7 @@ $(document).ready(function () { t('settings', 'Strong password') ], drawTitles: true, + $addAfter: $('input[name="newpassword-clone"]'), }); // Load the big avatar