Password element

joit

Active Member
Hi,

If I use the password element instead of a field set to password, it isn't pre filled if the user opens his account details. I think it could be dangerous because the user could easily change his password without knowing it. Is there a way to have it pre-filled (with bullets showing?)

Thanks
Hannes
 
Not sure what you mean with "easily...without knowing".
If you use the password element you have two fields for the password + the confirmation + the texts inside these two fields "Passwort eingeben", "Password best?tigen".
This "blank" password is the same in J!'s user profile edit.
You can additionally add a tooltip "only fill in if you want to set a new password...."
 
If I use the password element instead of a field set to password, it isn't pre filled if the user opens his account details.
I thought you are using the jUser form plugin.
If it's setup correctly there shouldn't be such a "validation message" if it's an existing user.
 
Now I am confused ;)
I use the juser plugin and it works great for registration (add a record). But if the user edits the registration form all fields are filled out except the password element. If the user doesn't edit the password and saves the form, there comes this error message that there is no password provided.
The behavior of a field which type is set to password is better. It is filled out with bullets if you edit the form and you don't have to fill it out again. Is it possible to have this behavior for the password element, too?

Gesendet von meinem SM-G850F mit Tapatalk
 
I'll take a look. I'm about to head to the airport, going to spend a few days with @mediaateam (Robbie Adaire), our new partner. I'll try and find some time to look at this while I'm there.

-- hugh
 
I can't replicate this.

http://screencast.com/t/0oLqIK7qxO0

As you can see, I'm editing an existing profile. The password is empty. I submit it, with a break point in the code where the password element validates. if thgere is a $rowid (so the form is being edited), it skips the empty validation test and returns true. The next break point is in the juser plugin, where it saves. Then you can see my J! users table, and the password field remains unchanged.

So I guess we need to figure out what the difference in our setup is.

Where is your form / element, so I can check them?

-- hugh
 
If think there's a little misunderstanding. You wrote:
The password is empty.
And this is the problem!
The password element should be prefilled with XXXXX if you edit an existing form.
You can check with a field set to password as password element
 
Not sure what you mean.

As Troester says, we do the same thing J! does. When editing with the password element, we show a blank password. We don't even bother reading the existing value from the table, which is salted and encrypted anyway, so we have no way of knowing what it is. And if you don't enter anything, nothing is changed. And this works in conjunction with the juser form plugin:

http://screencast.com/t/UAnYnZg0Uk9

This time round, I did it with a profile table that has a value in the password field. Same result as my previous screencast.

And I can't replicate what you said in an earlier post about ...

If the user doesn't edit the password and saves the form, there comes this error message that there is no password provided.

That's what I'm having a problem with, is replicating that.

-- hugh
 
Did you set up the jUser plugin correctly?
If you want to edit an existing user you must have an element which is storing the user's id assigned in the plugin settings (no! user element, just a field or a dbjoin to #__users).
 
as I said before, please try a field plugin set to password for the password element (like in pic "field.png"). It behaves differently (correctly for me). The password is displayed with some dots (pic pw.png). That's great!

This
When editing with the password element, we show a blank password. We don't even bother reading the existing value from the table, which is salted and encrypted anyway, so we have no way of knowing what it is.
is only true for the password plugin. The bad thing about the password plugin is, that you have to re-enter it when editing the form if you have a not empty validation on it.

I hope I could make my point clear?
The jUser plugin is set up correctly.
 

Attachments

  • field.png
    field.png
    21.9 KB · Views: 174
  • pw.png
    pw.png
    12.9 KB · Views: 179
Last edited:
The bad thing about the password plugin is, that you have to re-enter it when editing the form if you have a not empty validation on it.
Use the password plugin but don't set a nonempty validation.
This is "included"
 
I N D E E D ! ! !

Thanks. for pointing this out.
Now 1 little thing. Don't you think it makes sense to prefill the password element with some dots if you edit the form?
 
We just follow J!'s lead on that one. They don't put blobs in, so we don't.

The main problem is, in order for their to be blobs, there has to be characters in those input fields. And we have no idea what the password is, all we have is the encrypted string. So we can't preset that field to anything.

-- hugh
 
So where do the blobs in the field element come from (pw.png)?

Gesendet von meinem SM-G850F mit Tapatalk
 
I wouldn't mind how many blobs there are. If you could 5 blobs there if the password field is not empty that would be great.
 
You can add a JLayout override for .\plugins\fabrik_element\password\layouts\fabrik-element-password-form.php
and replace the placeholder with **** in existing records.
Code:
...
$rowId         = JFactory::getApplication()->input->get('rowid', '', 'string');

foreach ($d->pw1Attributes as $key => $val)
{
    if ($rowId > 0 && $key == 'placeholder') $val ='*****'; //replace placeholder with *** in existing records
    $pw1Attributes[] = $key . '="' . $val . '" ';
}

$pw1Attributes = implode("\n", $pw1Attributes);


foreach ($d->pw2Attributes as $key => $val)
{
    if ($rowId > 0 && $key == 'placeholder') $val ='*****'; //replace placeholder with *** in existing records
    $pw2Attributes[] = $key . '="' . $val . '" ';
}
...
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top