Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update useradd_password field to type password #12093

Closed
wants to merge 1 commit into from

Conversation

RMastop
Copy link
Contributor

@RMastop RMastop commented Sep 21, 2017

No need for showing the value of a password field.

Please issue pull request against the 3.x-dev branch only.

Piwik 2 is in LTS mode. This means we do not accept any pull request for 2.x except critical security bugs and major data loss bugs.

If you need to create a pull request for 2.x, then please also create the pull request against the 3.x-dev so we can merge both.

Happy hacking!

No need for showing the value of a password field.
@sgiehl
Copy link
Member

sgiehl commented Sep 22, 2017

Not sure if we should simply change the input type to password. I guess it common approach to have either on password field in clear text, or two fields (with repeat) to prove user didn't make a mistake when typing the password.

@mattab
Copy link
Member

mattab commented Sep 22, 2017

What I see often these days is leaving only one field, by default password protected, but having a checkbox next to it Show password and when clicked, the field becomes visible. this could be a good solution.

refs #6329

@mattab mattab added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label Sep 25, 2017
@mattab
Copy link
Member

mattab commented Sep 27, 2017

Hi @RMastop would you like to implement a new checkbox next to it Show password that would show the password when clicked?

@mattab
Copy link
Member

mattab commented Sep 27, 2017

An even better solution may be to add a little Show link in the field such as what Paypal does here:
show

@fdellwing
Copy link
Contributor

So, I use this toggle thing quite often and here are my thoughts on this:

The function itself is pretty easy, but it is not as easy to get this into piwik to look good because it is inside an table...

piwik1

<td>
<input id="useradd_password" placeholder="password" size="10" type="password">
<a href="#" style="position: absolute;margin: 16px 0 0 -30px;" onclick="toggle_pw">show</a>
</td>
function toggle_pw() {
  $(this).html(function(index, text) {
    return text == "show" ? "hide" : "show";
  });
  $(this).prev().attr('type', function(index, attr) {
    return attr == "password" ? "text" : "password";
  });
}

Because you would need to translate the "show" and "hide" it would be better to use a known symbol like these two:

http://fontawesome.io/icon/eye
http://fontawesome.io/icon/eye-slash

The JavaScript code would then look like this:

function toggle_pw() {
  $(this).toggleClass("fa-eye fa-eye-slash");
  $(this).prev().attr('type', function(index, attr) {
    return attr == "password" ? "text" : "password";
  });
}

One last problem in piwik would be, that the input width is pretty small, so if you use a long password, the text would go under the link/symbol.

I hope this helps :)

@sgiehl
Copy link
Member

sgiehl commented Feb 10, 2020

User management has been refactored meanwhile. The value of the password field when adding users isn't shown anymore, so closing this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants