99 Posts
SimonD
4 years ago
6
Topic

Hello,

I would like to use 'User Grp Password' group of fields on front end to let user choose if they want a password or not when registering.

But for all my tests it seems that passwords stored in user table are not the ones typed in the password and password2 fields.

I always need to reset the password by usingthe link 'forgot password'.

I'm using a position override to customize the restriation form.

Any idea about what is happening?

Thank you

Get a Book for SEBLOD
99 Posts
SimonD
4 years ago
0
Level 1

Hello,

In my registration form I've put Password, Password2 and User Grp Password because I would like to play with access and workflow to display the 2 password fields when user register for the first time and Grp Password when he edit his profile.

By removing the 2 paswword fields and keeping only Grp Password everything is working as expected.

4 years ago
2
Level 1

Hi SimonD,  

By default it's already like that in the Site Form View:    


So, I think that the problem come from you custom code.

Regards.

99 Posts
SimonD
4 years ago
0
Level 2

Hi Lionel,

Thank you for your reply.

I will check again my position override.

Regards

99 Posts
SimonD
4 years ago
0
Level 2

HI Lionel,

I've reviewed my registration form.

I'm using a position override (seb_one/positions/user/site/mainbody.php).

In wich I've put this basic code:

<?php echo $cck->renderField('user_username') ; ?>
<?php echo $cck->renderField('user_email') ; ?>
<?php echo $cck->renderField('user_grp_password') ; ?>
<?php echo $cck->renderField('user_password') ; ?>
<?php echo $cck->renderField('user_password2') ; ?>
<div class="clearfix"></div>
<hr />
<?php echo $cck->renderField('button_cancel') ; ?>
<?php echo $cck->renderField('button_save_close') ; ?>

In the edit Profil form, when I switch the Update Password radio to Yes, password field is displayed twice and password2 field is displayed twice as well.

When disabling the position override, everything is back to normal.

What is missing in my position override?

Regards

4 years ago
1
Level 1

Hi SimonD,

not sure why you are using Position Override for that, as you simply display fields like they are normally.   

Remove your Position Override, and all will be fine.


Now, if you really need an Override, you can do this:

if ( $config['isNew'] ) { // Creation
    echo $cck->renderField('user_password');
    echo $cck->renderField('user_password2');
} else { // Edition
    echo $cck->renderField('user_grp_password');
}


Regards.

99 Posts
SimonD
4 years ago
0
Level 2

Hi Lionel,

Yes, I over simplified the code of the override for my question. 

But as I'm using a temlate based on Bootstrap 4, there are some more markups.

Anyway thank you for your reply. It is working.

I didn't know the $config['isNew'] test.

Regards

Get a VIP membership