Beispiel #1
0
 /// <summary>
 /// PasswordUpdated runs when the password is updated
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	03/15/2006  Created
 /// </history>
 protected void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e)
 {
     PasswordUpdateStatus status = e.UpdateStatus;
     if (status == PasswordUpdateStatus.Success)
     {
         AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true);
         var user = ctlPassword.User;
         user.Membership.LastPasswordChangeDate = DateTime.Now;
         user.Membership.UpdatePassword = false;
         LoginStatus = user.IsSuperUser ? UserLoginStatus.LOGIN_SUPERUSER : UserLoginStatus.LOGIN_SUCCESS;
         UserLoginStatus userstatus = UserLoginStatus.LOGIN_FAILURE;
         UserController.CheckInsecurePassword(user.Username, user.Membership.Password, ref userstatus);
         LoginStatus = userstatus;
         ValidateUser(user, true);
     }
     else
     {
         AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true);
     }
 }
        /// <summary>
        /// PasswordUpdated runs when the Password has been updated or reset
        /// </summary>
        /// <history>
        /// 	[cnurse]	3/08/2006	created
        /// </history>
        private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e)
        {

            PasswordUpdateStatus status = e.UpdateStatus;

            if (status == PasswordUpdateStatus.Success)
            {
                //Send Notification to User
                try
                {
                    Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings);
                    AddModuleMessage("PasswordChanged", ModuleMessageType.GreenSuccess, true);
                }
                catch (Exception ex)
                {
                    AddModuleMessage("PasswordMailError", ModuleMessageType.YellowWarning, true);
                    Exceptions.LogException(ex);
                }
            }
            else
            {
                AddModuleMessage(status.ToString(), ModuleMessageType.RedError, true);
            }

        }
        /// <summary>
        /// PasswordQuestionAnswerUpdated runs when the Password Q and A have been updated.
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	3/09/2006	created
        /// </history>
        protected void PasswordQuestionAnswerUpdated( object sender, Password.PasswordUpdatedEventArgs e )
        {
            PasswordUpdateStatus status = e.UpdateStatus;

            if( status == PasswordUpdateStatus.Success )
            {
                AddModuleMessage( "PasswordQAChanged", ModuleMessageType.GreenSuccess, true );
            }
            else
            {
                AddModuleMessage( status.ToString(), ModuleMessageType.RedError, true );
            }
        }
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// PasswordUpdated runs when the Password has been updated or reset
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	3/08/2006	created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void PasswordUpdated(object sender, Password.PasswordUpdatedEventArgs e)
        {
            if (IsUserOrAdmin == false)
            {
                return;
            }
            PasswordUpdateStatus status = e.UpdateStatus;

            if (status == PasswordUpdateStatus.Success)
            {
                //Send Notification to User
                try
                {
                    var accessingUser = (UserInfo) HttpContext.Current.Items["UserInfo"];
                    if (accessingUser.UserID != User.UserID)
                    {
                        //The password was changed by someone else
                        Mail.SendMail(User, MessageType.PasswordReminder, PortalSettings);
                    }
                    else
                    {
                        //The User changed his own password
                        Mail.SendMail(User, MessageType.UserUpdatedOwnPassword, PortalSettings);
                    }
                    AddModuleMessage("PasswordChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true);
                }
                catch (Exception ex)
                {
                    AddModuleMessage("PasswordMailError", ModuleMessage.ModuleMessageType.YellowWarning, true);
                    Exceptions.LogException(ex);
                }
            }
            else
            {
                AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true);
            }
        }
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// PasswordQuestionAnswerUpdated runs when the Password Q and A have been updated.
 /// </summary>
 /// <remarks>
 /// </remarks>
 /// <history>
 /// 	[cnurse]	3/09/2006	created
 /// </history>
 /// -----------------------------------------------------------------------------
 private void PasswordQuestionAnswerUpdated(object sender, Password.PasswordUpdatedEventArgs e)
 {
     if (IsUserOrAdmin == false)
     {
         return;
     }
     PasswordUpdateStatus status = e.UpdateStatus;
     if (status == PasswordUpdateStatus.Success)
     {
         AddModuleMessage("PasswordQAChanged", ModuleMessage.ModuleMessageType.GreenSuccess, true);
     }
     else
     {
         AddModuleMessage(status.ToString(), ModuleMessage.ModuleMessageType.RedError, true);
     }
 }
        /// <summary>
        /// PasswordUpdated runs when the password is updated
        /// </summary>
        /// <history>
        /// 	[cnurse]	03/15/2006  Created
        /// </history>
        protected void PasswordUpdated( object sender, Password.PasswordUpdatedEventArgs e )
        {
            PasswordUpdateStatus status = e.UpdateStatus;

            if( status == PasswordUpdateStatus.Success )
            {
                AddModuleMessage( "PasswordChanged", ModuleMessageType.GreenSuccess, true );

                //Authorize User
                UserInfo _User = ctlPassword.User;
                _User.Membership.LastPasswordChangeDate = DateTime.Now;
                _User.Membership.UpdatePassword = false;
                UserAuthorized( _User, true );
            }
            else
            {
                AddModuleMessage( status.ToString(), ModuleMessageType.RedError, true );
            }
        }