Example #1
0
        /// <summary>
        /// UserCreateCompleted runs when a new user has been Created
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	07/12/2007	created
        /// </history>
        protected void UserCreateCompleted(object sender, UserUserControlBase.UserCreatedEventArgs e)
        {
            var strMessage = "";
            try
            {
                if (e.CreateStatus == UserCreateStatus.Success)
                {
                    //Assocate alternate Login with User and proceed with Login
                    AuthenticationController.AddUserAuthentication(e.NewUser.UserID, AuthenticationType, UserToken);

                    strMessage = CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, true);
                    if ((string.IsNullOrEmpty(strMessage)))
                    {
                        //First update the profile (if any properties have been passed)
                        UpdateProfile(e.NewUser, true);

                        ValidateUser(e.NewUser, true);
                    }
                }
                else
                {
                    AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true);
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// UserCreateCompleted runs when a new user has been Created
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	3/06/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void UserCreateCompleted(object sender, UserUserControlBase.UserCreatedEventArgs e)
        {
            string strMessage = "";
            try
            {
                if (e.CreateStatus == UserCreateStatus.Success)
                {
                    //hide the succesful captcha
                    captchaRow.Visible = false;

                    strMessage = CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, IsRegister);
                    if (IsRegister)
                    {
                        if ((string.IsNullOrEmpty(strMessage)))
                        {
                            Response.Redirect(RedirectURL, true);
                        }
                        else
                        {
                            object setting = GetSetting(PortalId, "Redirect_AfterRegistration");
                            if (Convert.ToInt32(setting) == Null.NullInteger)
                            {
                                DisableForm();
                                cmdRegister.Visible = false;
                                loginLink.Visible = true;
                            }
                            else //redirect to after registration page
                            {
                                Response.Redirect(RedirectURL, true);
                            }
                            DisableForm();
                            cmdRegister.Visible = false;
                            loginLink.Visible = true;
                        }
                    }
                    else
                    {
                        Response.Redirect(ReturnUrl, true);
                    }
                }
                else
                {
                    AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true);
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// UserUpdateCompleted runs when a user has been updated
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	3/02/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 private void UserRestored(object sender, UserUserControlBase.UserRestoredEventArgs e)
 {
     try
     {
         Response.Redirect(ReturnUrl, true);
         //Module failed to load
     }
     catch (Exception exc)
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// UserUpdateError runs when there is an error updating the user
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	2/07/2007	created
 /// </history>
 /// -----------------------------------------------------------------------------
 private void UserUpdateError(object sender, UserUserControlBase.UserUpdateErrorArgs e)
 {
     AddModuleMessage(e.Message, ModuleMessage.ModuleMessageType.RedError, true);
 }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// UserCreateCompleted runs when a new user has been Created
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	3/06/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 private void UserCreateCompleted(object sender, UserUserControlBase.UserCreatedEventArgs e)
 {
     try
     {
         if (e.CreateStatus == UserCreateStatus.Success)
         {
             CompleteUserCreation(e.CreateStatus, e.NewUser, e.Notify, false);
             Response.Redirect(ReturnUrl, true);
         }
         else
         {
             AddLocalizedModuleMessage(UserController.GetUserCreateStatus(e.CreateStatus), ModuleMessage.ModuleMessageType.RedError, true);
         }
     }
     catch (Exception exc) //Module failed to load
     {
         Exceptions.ProcessModuleLoadException(this, exc);
     }
 }