Exemple #1
0
        /// <summary>
        /// 验证用户的口令
        /// </summary>
        /// <param name="userName"></param>
        /// <param name="passWord"></param>
        /// <returns></returns>
        public static AuthenUser CheckUserPasswrod(string userName, string passWord)
        {
            AuthenUser admin = GetAuthenUserByLoginName(userName);

            if (admin != null && admin.PassWord == AdapterHelper.Hash(passWord))
            {
                return(PushAuthenUserOnline(admin));
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
 /// <summary>
 /// 更改登录密码
 /// </summary>
 /// <param name="newPassword"></param>
 public static void ChangePassword(string newPassword)
 {
     newPassword = AdapterHelper.Hash(newPassword);
     adminAdapter.ChangePassword(GetCurrentUser().UserID, newPassword);
     GetCurrentUser().PassWord = newPassword;
 }