Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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
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
Hey Eduardo ,
Simple as that :)
Many thanks
Rich,
You are welcome. (High five me please)
Regards,Eduardo Macho
You'll get Karma for your post being marked as a solution, but hey why not :)
For reference
Wiki page here http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions
Added a wiki entry for adding a user with a hashed password http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions/add-user-with-hashed-password
Thanks for posting the links. I couldn't find them before :(
Have a good day!!
is working on a reply...
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.
Continue discussion
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
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
Hey Eduardo ,
Simple as that :)
Many thanks
Rich
Rich,
You are welcome. (High five me please)
Regards,
Eduardo Macho
You'll get Karma for your post being marked as a solution, but hey why not :)
Rich
For reference
Wiki page here http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions
Added a wiki entry for adding a user with a hashed password http://our.umbraco.org/wiki/reference/api-cheatsheet/users,-user-types-and-permissions/add-user-with-hashed-password
Rich
Hi Rich,
Thanks for posting the links. I couldn't find them before :(
Have a good day!!
Sincere regards,
Eduardo Macho
is working on a reply...
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.