Esempio n. 1
0
 private void UpdatePassword(SetupDefaultParametersViewModel setupDefaultParametersViewModel)
 {
     var randomCode = RandomStringGenerator.RandomString();
     var userEntity = new UserEntity
                          {
                              UserID = 1,
                              Password = PasswordHelper.GenerateHashedPassword(setupDefaultParametersViewModel.Password, randomCode),
                              UserCode = TripleDES.EncryptString(randomCode)
                          };
     _userRepository.UpdateUser(userEntity);
 }
Esempio n. 2
0
        public ActionResult Index()
        {
            var installStatus = GetInstallStatus();

            if (!installStatus)
                return RedirectToRoute("SetupIndex");

            var setupDefaultParametersViewModel = new SetupDefaultParametersViewModel
                                                  {
                                                      AkismetUrl = GetRootUrl().TrimEnd('/')
                                                  };

            return View(setupDefaultParametersViewModel);
        }
Esempio n. 3
0
        public ActionResult Index(SetupDefaultParametersViewModel setupDefaultParametersViewModel)
        {
            if (ModelState.IsValid)
            {
                if (VerifyFields(setupDefaultParametersViewModel))
                {
                    UpdatePassword(setupDefaultParametersViewModel);
                    UpdateSettings(setupDefaultParametersViewModel);

                    // Installation is complete. Update the application variable
                    HttpContext.Application["Installation_Status"] = "true";

                    return RedirectToAction("Index", "Home", new { Area = "" });
                }
            }

            return View(setupDefaultParametersViewModel);
        }
Esempio n. 4
0
 private bool VerifyFields(SetupDefaultParametersViewModel setupDefaultParametersViewModel)
 {
     if (setupDefaultParametersViewModel.Password != setupDefaultParametersViewModel.ConfirmPassword)
     {
         ModelState.AddModelError("Password", "Passwords do not match");
         return false;
     }
     return true;
 }
Esempio n. 5
0
 private void UpdateSettings(SetupDefaultParametersViewModel setupDefaultParametersViewModel)
 {
     _settingsRepository.BlogName = setupDefaultParametersViewModel.BlogName;
     _settingsRepository.BlogAkismetUrl = setupDefaultParametersViewModel.AkismetUrl;
     _settingsRepository.InstallationComplete = true;
 }