Ejemplo n.º 1
0
 private static void blowUpIfEmployeeCannotLogin(User user)
 {
     if (user == null)
     {
         throw new InvalidCredentialException(
             "That user doesn't exist or is not valid.");
     }
 }
Ejemplo n.º 2
0
        public ActionResult Edit(UserForm form)
        {
            if (ModelState.IsValid)
            {
                //mapping from conferenceform to conference
                User user = new User();
                _userMapper.MapToModel1(form, user);

                //saving the conference with the repository
                _userRepository.Save(user);
                form = _userMapper.Map(user);
                return View(form);
            }

            return View(form);
        }
Ejemplo n.º 3
0
 public void LogIn(User user)
 {
     blowUpIfEmployeeCannotLogin(user);
     FormsAuthentication.RedirectFromLoginPage(user.Username, false);
 }
Ejemplo n.º 4
0
 public bool PasswordMatches(User user, string password)
 {
     string passwordHash = _cryptographer.GetPasswordHash(password, user.PasswordSalt);
     return passwordHash.Equals(user.PasswordHash);
 }