コード例 #1
0
 public static void InitGUIDs(this OnionUser user)
 {
     user.GUID = Guid.NewGuid();
     user.EmailConfirmationGUID = Guid.NewGuid();
     user.PasswordSaltGUID      = Guid.NewGuid();
     user.RecoveryGUID          = Guid.NewGuid();
 }
コード例 #2
0
        public static bool CheckPassword(this OnionUser user, string password)
        {
            string stringToHash = password + user.PasswordSaltGUID.ToString();

            if (user.Password == stringToHash.CreateMD5())
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        public static void SetPassword(this OnionUser user, string password)
        {
            string stringToHash = password + user.PasswordSaltGUID.ToString();

            user.Password = stringToHash.CreateMD5();
        }