Password Field on Membership Request Web Part

Jul 29, 2014 at 1:54 AM
We are trying to modify the FBA Pack to allow the password field to be shown on the membership request web part (while also having approval turned on). We have modified several lines of code, trying to strip out the checks for the membership review list being on. Can you advise on what areas we would need to change in order to have the following:

-> Password Entry on the Membership Request Web Part
-> Approval through the Membership Review List

Thanks!
Adam
Coordinator
Jul 29, 2014 at 2:51 AM
There's some code that always turns the password field off if membership review is turned on. You'll have to disable that.

It doesn't work with the membership review because my initial thoughts were that the password would have to be stored in the membership review list, which would be insecure. If you want to do this though, you'll have to add a new field to the membership review list, and then store and retrieve the password from there.

Another way around it might be to simply store the password with the membership user that's created as a placeholder during the inital user registration. Right now when the member is approved, that user is deleted and recreated. Instead you could just use the existing user, which should have the user's password. This is on my todo list for the FBA Pack, but I have not gotten to it.
Jul 30, 2014 at 7:43 PM
We have searched the code fairly well for where that check occurs, yet we can't find it. Could you provide some direction on what file that check (if membership review is turned on) occurs in?

Thanks!
Adam
Coordinator
Jul 30, 2014 at 11:14 PM
MembershipRequestWebPart.cs Line 213
Jul 31, 2014 at 12:56 AM
I am wondering if there is somewhere else these checks are being done, because, we have changed the below code and the password fields are still not visible. We uncheck the "Auto Generate Password" checkbox and it re-checks it for us. This is what we have changed:
 public bool AutoGeneratePassword
        {
            get
            {
                //Passwords must be auto generated if reviewing membership requests
                //if (_Settings.ReviewMembershipRequests)
                //{
                //    return true;
                //}
                return false;
            }
            set { _AutoGeneratePassword = false; }
Coordinator
Jul 31, 2014 at 2:33 AM
I think what you have done should do it - I believe that's the only place that should be changed. My guess is that your changes are not getting deployed to the server. To check, make another change somewhere else in the code that will be visible on the server.
Aug 19, 2014 at 3:57 PM
I believe you could also do visible="true" for the password fields in the CreateUserTemplate user control. It's set to false by default which is what causes the validation of whether the fields should be displayed or not.