private string CreateDNNUser(string UserName, string FirstName, string LastName, string Email, string Password, string Street, string City, string Region, string Country, string PostalCode, string Unit, string Telephone)
{
DotNetNuke.Entities.Users.UserInfo objUser = new DotNetNuke.Entities.Users.UserInfo();
objUser.AffiliateID = Null.NullInteger;
objUser.PortalID = this.PortalId;
objUser.IsSuperUser = false;
objUser.Email = Email;
objUser.FirstName = FirstName;
objUser.LastName = LastName;
objUser.Username = UserName;
objUser.DisplayName = FirstName +" " + LastName;
objUser.Membership.Approved = true;
objUser.Membership.Password = Password;
objUser.Membership.Email = Email ;
objUser.Membership.Username = UserName;
objUser.Membership.UpdatePassword = true;
objUser.Profile.Country = Country;
objUser.Profile.Street = Street;
objUser.Profile.City = City;
objUser.Profile.Region = Region;
objUser.Profile.PostalCode = PostalCode;
objUser.Profile.Unit = Unit;
objUser.Profile.Telephone = Telephone;
objUser.Profile.FirstName = FirstName;
objUser.Profile.LastName = LastName;
DotNetNuke.Security.Membership.UserCreateStatus objCreateStatus =
DotNetNuke.Entities.Users.UserController.CreateUser(ref objUser);
if (objCreateStatus == DotNetNuke.Security.Membership.UserCreateStatus.Success)
{
return string.Empty;
}
else
{
return objCreateStatus.ToString();
}
}
Dotnetnuke Module Creator fast and effective dotnetnuke module creation.
No comments:
Post a Comment