Пример #1
0
 public TeamMember(User user, Role role, bool isPageAdmin, bool isCreator = false)
 {
     FirstName = user.FirstName;
     LastName = user.LastName;
     Email = user.Email;
     GravatarEmail = user.GravatarEmail;
     Role = role;
     UserName = user.UserName;
     Slug = user.UserName.GenerateSlug();
     IsPageAdmin = isPageAdmin;
     UserId = user.Id;
     Image = GetImage();
     IsCreator = isCreator;
 }
Пример #2
0
        public ActionResult Edit(User user)
        {
            var oldUser = RavenSession.Load<User>(CurrentUser.Id);

            oldUser.GravatarEmail = user.GravatarEmail;
            oldUser.Email = user.Email;
            oldUser.FirstName = user.FirstName;
            oldUser.LastName = user.LastName;
            oldUser.Description = user.Description;
            oldUser.DisplayEmail = user.DisplayEmail;
            oldUser.GitHub = user.GitHub;

            RavenSession.SaveChanges();

            return RedirectToAction("edit", "user", new { username = CurrentUser.Slug });
        }
Пример #3
0
 public EventActionUser(User user)
 {
     Id = user.Id;
     Username = user.UserName;
 }
Пример #4
0
 public IssueUser(User user)
 {
     UserId = user.Id;
     DisplayName = user.UserName;
     Image = user.GetImage();
 }
Пример #5
0
        public ActionResult Register(User user)
        {
            user.Created = DateTime.Now;
            user.Password = BCrypt.Net.BCrypt.HashPassword(user.Password);
            user.Slug = user.UserName.GenerateSlug();

            if (string.IsNullOrEmpty(user.GravatarEmail))
                user.GravatarEmail = user.Email;

            RavenSession.Store(user);
            RavenSession.SaveChanges();
            LoginUser(user.Id);

            return RedirectToAction("Index","Home");

            return View();
        }
Пример #6
0
        public ActionResult Manage(User user)
        {
            if (CurrentUser == null)
                return Redirect("/user/login");

            return View();
        }