Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1474 posts 3431 karma points c-trib
    Feb 01, 2013 @ 10:45
    Simon Dingley
    0

    Membership Problems after Upgrade from 4.0.2 > 4.11.3

    I have inherited a site which I've had to upgrade as the title suggests. I've resolved most issues, now encrypted all passwords but I continuing to have issues with membership which I seem unable to resolve.

    Web.config relevant parts look as follows:

        <authentication mode="Forms">
          <forms name="cpAuthCookie" loginUrl="~/login.aspx" protection="All" path="/" />
        </authentication>
        <!-- Membership Provider -->
        <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">
          <providers>
            <clear />
            <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="RegisteredMember" passwordFormat="Hashed" />
            <add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" passwordFormat="Hashed" />
          </providers>
        </membership>
        <!-- added by NH to support membership providers in access layer -->
        <roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
          <providers>
            <clear />
            <add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
          </providers>
        </roleManager>
        <profile defaultProvider="UmbracoMemberProfileProvider" enabled="true">
          <providers>
            <clear />
            <add name="UmbracoMemberProfileProvider" type="umbraco.providers.members.UmbracoProfileProvider, umbraco.providers" />
          </providers>
          <properties>
            <clear />
            <add name="firstName" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
            <add name="lastName" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
            <add name="emailPreferences" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
            <add name="mobile" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
            <add name="companyName" allowAnonymous ="false" provider="UmbracoMemberProfileProvider" type="System.String" />
          </properties>
        </profile>
    
    I am able to programatically create members ok after tweaking the existing code until it is rewritten and so the following works fine and inserts the relevant data into the fields in the member profile:
    var m = Membership.CreateUser(txtEmail.Text, txtPassword.Text, txtEmail.Text);
    var profile = ProfileBase.Create(m.UserName);
    
    profile["firstName"] = txtFirstName.Text;
    profile["lastName"] = txtLastName.Text;
    profile["emailPreferences"] = ddlEmailPreferences.SelectedItem.Value;
    profile["mobile"] = txtMobile.Text;
    profile.Save();
    
    Roles.AddUserToRole(m.UserName, "careerplayer Employer");
    

     

    However trying to login the user with the following after registration doesn't work:

    FormsAuthentication.SetAuthCookie(m.UserName, true);


    I'm sure it's related but also changing the password via the member profile in Umbraco does not save the change in the database - no password is changed. Changing member profile properties save fine.

    Any ideas or pointers would be much appreciated as this is the only thing holding this project up right now and may be the case that I am missing something obvious.

    Cheers, Simon

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Feb 01, 2013 @ 12:10
    Simon Dingley
    0

    Further to this I can report that no member details can be changed via the Members are of Umbraco so something is fundamentally wrong with the membership system following the upgrade. I'm sure it's a simple fix once it's tracked down.

Please Sign in or register to post replies

Write your reply to:

Draft