Hello
It is incredible to tell that I have installed YAF for exactly same purpose in mind. To go even further, I want to enable my users to write to forum and get replies right inside my software. A sort of built-in technical support and discussion board.
Therefore, I m writing right now full fledged web service. Though I m bit embarraced with the emerging inner support for web service in curent SVN. Look at YafWebService.cs. Though it is very limited so far.
So i m in wonder, if we may unite efforts to write something ourselves or just await for the authors of this excellent product to finish their development.
Up to your question, it is very easily resolved through the present DB layer. This is my very ugly first prototype i wrote today:
---------------------------------------------------------------------
static public int CreateUser(int blogid, string login, string password, string email, string address)
{
if (UserMembershipHelper.UserExists(login, email))
{
// "Username or email are already registered."
return 0;
}
string hashinput = DateTime.Now.ToString() + email + Security.CreatePassword(20);
string hash = FormsAuthentication.HashPasswordForStoringInConfigFile(hashinput, "md5");
MembershipCreateStatus status;
MembershipUser user = Membership.CreateUser(login, password, email, "Address", address, true, out status);
if (status != MembershipCreateStatus.Success)
{
// error of some kind
// "Membership Error Creating User: " + status.ToString()
return 0;
}
// setup inital roles (if any) for this user
RoleMembershipHelper.SetupUserRoles(blogid, login);
// create the user in the YAF DB as well as sync roles...
int? userID = RoleMembershipHelper.CreateForumUser(user, blogid);
// create profile
YafUserProfile userProfile = null; //PageContext.GetProfile(newUsername);
// setup their inital profile information
userProfile.Location = address;
userProfile.Save();
// save the time zone...
//YAF.Classes.Data.DB.user_save(UserMembershipHelper.GetUserIDFromProviderUserKey(user.ProviderUserKey), PageContext.PageBoardID, null, null, Convert.ToInt32(TimeZones.SelectedValue), null, null, null, null, null);
// success
return userID;
}