public ActionResult Index(CreateAdminAccountViewModel model)
        {
            if (Convert.ToBoolean(JPPConstants.SiteSettings.GetValue(JPPConstants.SiteSettings.AdminAccountCreated)))
                return RedirectToAction("Index", "Home");
            if (ModelState.IsValid)
            {
                String confirmationToken = WebSecurity.CreateUserAndAccount(
                        model.Username,
                        model.Password,
                        new
                        {
                            first_name = "Admin",
                            middle_name = "Admin",
                            last_name = "Admin",
                            is_player = false,
                            created_date = DateTime.Now,
                            status = (int)JPPConstants.UserStatus.Active,
                            first_login = false,
                            email = model.Email,
                            last_login_date = DateTime.Now,
                            display_name = "Admin",
                            privacy_settings = (int)JPPConstants.PrivacySettings.FriendsOnly,
                            has_agreed_to_tos = true,
                            communication_settings = (int)JPPConstants.CommunicationSettings.All,
                            notification_settings = 0
                        },
                        true);

                String[] roles = new String[1];
                roles[0] = JPPConstants.Roles.FullAdmin;
                JPPConstants.Roles.UpdateUserRoles(model.Username, roles);
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.AdminAccountCreated, "true");
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.AdminUsername, model.Username);
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.AdminEmail, model.Email);
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.SMTPServer, model.SMTPServer);
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.SMTPPort, model.Port.ToString());
                JPPConstants.SiteSettings.SetValue(JPPConstants.SiteSettings.SMTPPassword, model.SMTPPassword.ToString());

                String confirmLink = "http://" + Request.Url.Authority + "/InitializeSite/Confirm?token=" + confirmationToken;

                Email.Send(model.Email, "Admin Account Created", "Here is your registration confirmation link:\n\n" + "<a href='" + confirmLink + "'>" + confirmLink + "</a>", true);

                // All done
                ViewBag.EmailSent = true;

                return View();

            }

            return View(model);
        }
 //
 // GET: /InitializeSite/
 public ActionResult Index()
 {
     if (Convert.ToBoolean(JPPConstants.SiteSettings.GetValue(JPPConstants.SiteSettings.AdminAccountCreated)))
         return RedirectToAction("Index", "Home");
     ViewBag.EmailSent = false;
     var model = new CreateAdminAccountViewModel();
     return View(model);
 }