Copied to clipboard

Flag this post as spam?

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


  • Rich Green 2246 posts 4008 karma points
    Nov 14, 2010 @ 08:51
    Rich Green
    0

    Add new user via API

    Can't find any sample code on how to do this, via the API I am looking to

     -add a new user

    -set their password

    -set their user type

    -retrieve the user id back 

    I'm using 4.5.2

    Would appreciate any help.

    Rich

  • Eduardo 106 posts 130 karma points
    Nov 14, 2010 @ 13:51
    Eduardo
    2

    Hi Rich,

    add a new user(not member) setting password, user type and retrieving all user information back

    var user = umbraco.BusinessLogic.User.MakeNew("Name","LoginName","Password",umbraco.BusinessLogic.UserType.GetUserType(id));

    int userId = user.Id;

    Hope this helps.

    Sincere regards,
    Eduardo Macho

  • Rich Green 2246 posts 4008 karma points
    Nov 14, 2010 @ 14:03
    Rich Green
    0

    Hey Eduardo ,

    Simple as that :)

    Many thanks

    Rich

  • Eduardo 106 posts 130 karma points
    Nov 14, 2010 @ 14:09
    Eduardo
    0

    Rich,

    You are welcome. (High five me please)

    Regards,
    Eduardo Macho

  • Rich Green 2246 posts 4008 karma points
    Nov 14, 2010 @ 14:27
    Rich Green
    0

    You'll get Karma for your post being marked as a solution, but hey why not :)

    Rich

  • Rich Green 2246 posts 4008 karma points
    Nov 14, 2010 @ 15:43
  • Eduardo 106 posts 130 karma points
    Nov 14, 2010 @ 15:46
    Eduardo
    0

    Hi Rich,

    Thanks for posting the links. I couldn't find them before :(

    Have a good day!!

    Sincere regards,
    Eduardo Macho

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies