コード例 #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);
 }
コード例 #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);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #5
0
ファイル: User.cs プロジェクト: ritacc/RitaccTest
 public ModifyUserLoginPwdAndAuthPwd(ModifyPasswordModel user)
 {
     this.user = user;
 }
コード例 #6
0
ファイル: User.cs プロジェクト: ritacc/RitaccTest
 public ModifyUserAuthPwd(ModifyPasswordModel user)
 {
     this.user = user;
 }
コード例 #7
0
ファイル: UserExtension.cs プロジェクト: ritacc/RitaccTest
        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);
        }
コード例 #8
0
ファイル: UserExtension.cs プロジェクト: ritacc/RitaccTest
        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);
        }
コード例 #9
0
ファイル: UserExtension.cs プロジェクト: ritacc/RitaccTest
        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);
        }