admin
-
6/24/2006 12:27:15 PM
Re: Self registration for public user
Hello,
Thank you for your message. You need to build a standard ASPX form and use Kentico CMS API to create users and assign them to chosen roles.
using Kentico.CMS.DataEngine; ...
DataClass userObj = new DataClass(“cms.user”); userObj.SetValue(“username”, “johns”); userObj.SetValue(“fullname”, “John Smith”); userObj.Insert();
GeneralConnection cn = new GeneralConnection(); object[,] paramsIdent = new object[ 2, 3 ]; paramsIdent[ 0, 0 ] = "@UserID"; paramsIdent[ 0, 1 ] = userObj.GetValue("userid"); paramsIdent[ 1, 0 ] = "@RoleID"; paramsIdent[ 1, 1 ] = roleId; //set appropriate value here cn.ExecuteQuery( "CMS.User.AddToRole", paramsIdent );
Best Regards,
|