Copied to clipboard

Flag this post as spam?

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


  • Kevon K. Hayes 255 posts 281 karma points
    Mar 28, 2011 @ 23:23
    Kevon K. Hayes
    0

    Accessing Member Properties

    UMB Experts humour me here,

    I need to email a group of Umbraco Members and access custom properties.

    //Get the Users ...OK

    string[] roles = new string[n];
    string[] users = new string[n];

    roles = System.Web.Security.Roles.GetAllRoles();

    //Get Users in role
    users = Roles.GetUsersInRole(roles[i]); //iterated here because I could select
    multiple Roles/Umbraco MemberGroups...


    //OK lets get some properties...

    Uhhh... this is where I'm in outer-world darkness I cannot convert an Umbraco Member to an System.Web.Security.MembershipUser
    I can't use theses...
    -GetMemberFromLoginName(name)... Obsolete, returns empty collection
    -GetMemberFromEmail(email); Obsolete, returns empty collection

    so how would one iterate through the users array, convert the names into Umbraco Members, and then access the custom member properties?

  • jc 64 posts 101 karma points
    Mar 29, 2011 @ 00:02
    jc
    1

    Aaron Powell has a decent write up on getting/setting profile properties here:

    http://www.aaron-powell.com/umbraco-members-profiles

    If you're just wanting to access an existing profile outside of the current HttpContext, it would be something along the lines of;

    ProfileBase p = Profile.GetProfile(name);

     

    EDIT: Sorry, I thought you were talking about profile properties. Maybe this will help:

    MembershipUser mu = Membership.GetUser(email);
Please Sign in or register to post replies

Write your reply to:

Draft