Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...CompleteUserCreation(CreateStatus, user, true, IsRegister)CompleteUserCreation(CreateStatus, user, true, IsRegister)
Previous
 
Next
New Post
6/1/2013 1:42 AM
 

Hi all,

CompleteUserCreation(CreateStatus, user, true, IsRegister)

What is the purpose of this method?

This function is taking too much time to execute in my application.  if i remove this line, will this create any critical error?

Thanks & Regards,

sathishmarappan

 
New Post
6/2/2013 1:34 AM
Accepted Answer 
This method performs all kinds of post registration tasks. None of those tasks will prevent the user from being registered, but you may want to perform them nevertheless, as to abide by the standards.

It's easier to explain what this method does by just showing you the code. I guess you have access to that yourself to.. so just read it and see what it does...:

protected string CompleteUserCreation(UserCreateStatus createStatus, UserInfo newUser, bool notify, bool register)
{
string strMessage = "";
ModuleMessage.ModuleMessageType message = ModuleMessage.ModuleMessageType.RedError;
if (register)
{
//send notification to portal administrator of new user registration
//check the receive notification setting first, but if register type is Private, we will always send the notification email.
//because the user need administrators to do the approve action so that he can continue use the website.
if (PortalSettings.EnableRegisterNotification || PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.PrivateRegistration)
{
strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationAdmin, PortalSettings);
}

var loginStatus = UserLoginStatus.LOGIN_FAILURE;

//complete registration
switch (PortalSettings.UserRegistration)
{
case (int) Globals.PortalRegistrationType.PrivateRegistration:
strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPrivate, PortalSettings);

//show a message that a portal administrator has to verify the user credentials
if (string.IsNullOrEmpty(strMessage))
{
strMessage += string.Format(Localization.GetString("PrivateConfirmationMessage", Localization.SharedResourceFile), newUser.Email);
message = ModuleMessage.ModuleMessageType.GreenSuccess;
}
break;
case (int) Globals.PortalRegistrationType.PublicRegistration:
Mail.SendMail(newUser, MessageType.UserRegistrationPublic, PortalSettings);
UserController.UserLogin(PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", PortalSettings.PortalName, "", ref loginStatus, false);
break;
case (int) Globals.PortalRegistrationType.VerifiedRegistration:
Mail.SendMail(newUser, MessageType.UserRegistrationVerified, PortalSettings);
UserController.UserLogin(PortalSettings.PortalId, newUser.Username, newUser.Membership.Password, "", PortalSettings.PortalName, "", ref loginStatus, false);
break;
}
//affiliate
if (!Null.IsNull(User.AffiliateID))
{
var objAffiliates = new AffiliateController();
objAffiliates.UpdateAffiliateStats(newUser.AffiliateID, 0, 1);
}
//store preferredlocale in cookie
Localization.SetLanguage(newUser.Profile.PreferredLocale);
if (IsRegister && message == ModuleMessage.ModuleMessageType.RedError)
{
AddLocalizedModuleMessage(string.Format(Localization.GetString("SendMail.Error", Localization.SharedResourceFile), strMessage), message, (!String.IsNullOrEmpty(strMessage)));
}
else
{
AddLocalizedModuleMessage(strMessage, message, (!String.IsNullOrEmpty(strMessage)));
}
}
else
{
if (notify)
{
//Send Notification to User
if (PortalSettings.UserRegistration == (int) Globals.PortalRegistrationType.VerifiedRegistration)
{
strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationVerified, PortalSettings);
}
else
{
strMessage += Mail.SendMail(newUser, MessageType.UserRegistrationPublic, PortalSettings);
}
}
}
//Log Event to Event Log
var objEventLog = new EventLogController();
objEventLog.AddLog(newUser, PortalSettings, UserId, newUser.Username, EventLogController.EventLogType.USER_CREATED);
return strMessage;
}

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
6/3/2013 11:49 PM
 

Hi Erik, 

Thank you so much, Now i got it.

Regards,

sathishmarappan

 

 

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...CompleteUserCreation(CreateStatus, user, true, IsRegister)CompleteUserCreation(CreateStatus, user, true, IsRegister)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out