Ejemplo n.º 1
0
 public ActionResult InitialPwdChange()
 {
     ModifyPasswordModel model = new ModifyPasswordModel();
     model.UserName = App.Framework.Security.User.Current.UserName;
     model.UserCode = App.Framework.Security.User.Current.UserCode;
     return View(model);
 }
Ejemplo n.º 2
0
 public ActionResult PasswordChange(long? userId)
 {
     ModifyPasswordModel model = new ModifyPasswordModel();
     if (userId != null && userId !=0)
     {
         var user = BusinessPortal.Load<CSC.Business.Entity.User.User>(new GetUser {UserID = userId.Value});
         model.UserName = user.UserName;
         model.UserCode = user.UserCode;
     }else
     {
         model.UserName = App.Framework.Security.User.Current.UserName;
         model.UserCode = App.Framework.Security.User.Current.UserCode;
     }
     return View(model);
 }
Ejemplo n.º 3
0
        public ActionResult ModifyAuthPwd(CSC.Business.Entity.User.ModifyPasswordModel model)
        {
            SecurityPortal.ModifyUserAuthPwd(App.Framework.Security.User.Current.UserId, model.NewAuthPwd, UserExtension.Instance);

            this.ShowMessage(CSC.Resources.Account.ModifyAuthPwdSuccess, isSucessed: true);

            model = new ModifyPasswordModel();
            model.IsCurrentUser = true;

            return View("PasswordChange", model);
        }
Ejemplo n.º 4
0
        public ActionResult ModifyUserAuthPwd(CSC.Business.Entity.User.ModifyPasswordModel model)
        {
            int isModify = model.IsModifyUserPwd(Convert.ToInt32(model.UserID));

            switch (isModify)
            {
                case 0:
                    SecurityPortal.ModifyUserAuthPwd(Convert.ToInt64(model.UserID), model.NewAuthPwd, UserExtension.Instance);
                    this.ShowMessage(CSC.Resources.Account.ModifyAuthPwdSuccess, isSucessed: true);
                    break;
                case -1:
                    this.ShowMessage(CSC.Resources.Account.CancelModifyAuthPwd, isSucessed: true);
                    break;
                case -2:
                    this.ShowMessage(CSC.Resources.Account.UserNoExists_Auth, isSucessed: true);
                    break;
            }

            model = new ModifyPasswordModel();
            model.IsCurrentUser = false;

            return View("PasswordChange", model);
        }
Ejemplo n.º 5
0
 public ModifyUserLoginPwdAndAuthPwd(ModifyPasswordModel user)
 {
     this.user = user;
 }
Ejemplo n.º 6
0
 public ModifyUserAuthPwd(ModifyPasswordModel user)
 {
     this.user = user;
 }
Ejemplo n.º 7
0
        public void ModifyUserLoginPwdAndAuthPwd(long userID, string newLoginPwd, string newAuthPwd)
        {
            var model = new ModifyPasswordModel()
            {
                UserID = userID,
                LastUpdatedBy = userID
            };

            if (string.IsNullOrEmpty(newLoginPwd) && string.IsNullOrEmpty(newAuthPwd))
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID
                };
            }
            else if (string.IsNullOrEmpty(newLoginPwd))
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID,
                    NewAuthPwd = newAuthPwd
                };
            }
            else if (string.IsNullOrEmpty(newAuthPwd))
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID,
                    NewLoginPwd = newAuthPwd,
                };
            }
            else
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID,
                    NewLoginPwd = newLoginPwd,
                    NewAuthPwd = newAuthPwd
                };
            }

            BusinessPortal.Save(model);
        }
Ejemplo n.º 8
0
        public void ModifyUserLoginPwd(long userID, string newLoginPwd)
        {
            ModifyPasswordModel model = new ModifyPasswordModel()
            {
                UserID = userID,
                LastUpdatedBy = App.Framework.Security.User.Current.UserId
            };

            if (!string.IsNullOrEmpty(newLoginPwd))
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID,
                    LastUpdatedBy = App.Framework.Security.User.Current.UserId,
                    NewLoginPwd = newLoginPwd,
                    PwdExpiryDate = SecurityPortal.PasswordEffectiveDays
                };
            }

            BusinessPortal.Save(model);
        }
Ejemplo n.º 9
0
        public void ModifyUserAuthPwd(long userID, string newAuthPwd)
        {
            ModifyPasswordModel model = new ModifyPasswordModel()
            {
                UserID = userID,
                LastUpdatedBy = App.Framework.Security.User.Current.UserId
            };

            if (!string.IsNullOrEmpty(newAuthPwd))
            {
                model = new ModifyPasswordModel()
                {
                    UserID = userID,
                    LastUpdatedBy = App.Framework.Security.User.Current.UserId,
                    NewAuthPwd = newAuthPwd
                };
            }

            //BusinessPortal.Save(model);
            BusinessPortal.Delete(model);
        }