Copied to clipboard

Flag this post as spam?

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


  • Christian Simonsen 4 posts 24 karma points
    May 26, 2010 @ 11:05
    Christian Simonsen
    0

    Member.New event password prop is empty (Umbraco 4)

    Hi,

    I am using the Member.New event to send of an email to new members containing their credentials etc.

    But the Member object that is parsed to the Event dos not have any information in the Member.Password property, it’s a blank string. I have used the same solution in other places (getting the password from the member property) and it works fine.

    void Member_New(Member sender, umbraco.cms.businesslogic.NewEventArgs e)
    {
        if(!String.IsNullOrEmpty(sender.Password))
            // Do stuff. 
    }

    Anyone know why it’s empty at the time of  the New event? 

    Is there any way I could get the password at the time of the event?

    Cheers

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    May 26, 2010 @ 15:10
    Dirk De Grave
    0

    it's empty as it's not set at the time the member gets created in code using Member.MakeNew() (well, it's set to empty string, even tho you may have entered an initial password), so there's no way to get the password on the new event. I'd try using the Member.Save() event to get the password.

     

    Cheers,

    /Dirk

  • Christian Simonsen 4 posts 24 karma points
    May 26, 2010 @ 19:41
    Christian Simonsen
    0

    Good pointer, but the Save event is triggered every time the member is updated. I guess I could always add a flag to the member profile, but it seems like a weak solution. 

  • Aaron Powell 1708 posts 3046 karma points c-trib
    May 27, 2010 @ 00:42
    Aaron Powell
    0

    How are  you creating the member, why can't you have code run after that point?

  • Christian Simonsen 4 posts 24 karma points
    May 27, 2010 @ 12:47
    Christian Simonsen
    0

    I have embeded a CreateUserWizard into a template.

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Aug 21, 2010 @ 14:34
    Peter Gregory
    0

    If you are using the ui to create the member use the memberTasks.NewMember event.  This fires after the loginname and password are set.  the unencrypted password is a property you can access in this event along with the entire member object.

Please Sign in or register to post replies

Write your reply to:

Draft