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:
|