Esempio n. 1
0
        public virtual SeverityVote AddSeverityVote(User user, int severity)
        {
            var severityVote = new SeverityVote(user, severity);
            ((IList<SeverityVote>) SeverityVotes).Add(severityVote);

            return severityVote;
        }
Esempio n. 2
0
 public static UserSession New(User user, DateTime? expires = null)
 {
     return new UserSession
     {
         Id = Guid.NewGuid(),
         User = user,
         Expires = expires ?? DateTime.Now.AddDays(10)
     };
 }
        public static void WithUser(this ConfigurableBootstrapper.ConfigurableBootstrapperConfigurator config, User user)
        {
            var nancyContext = new NancyContext
                                   {
                                       CurrentUser = new FireTowerUserIdentity(user)
                                   };

            var contextFactory = new TestingContextFactory(nancyContext);

            config.ContextFactory(contextFactory);
        }
        public UserSession Create(User user)
        {
            var userSession = new UserSession
                                  {
                                      Id = _tokenGenerator.Generate(),
                                      User = user,
                                      Expires = _tokenExpirationProvider.GetExpiration(_timeProvider.Now())
                                  };

            _writeableRepository.Create(userSession);

            return userSession;
        }
Esempio n. 5
0
        public void Seed()
        {
            var location = new Location {LocationId = 106781442691621, LocationName = "San Pedro Sula, Cortes"};
            _session.Save(new User
                {
                    FirstName = "Byron",
                    LastName = "Sommardahl",
                    Name = "Byron Sommardahl",
                    FacebookId = 1817134138,
                    Locale = "es_ES",
                    Username = "******",
                    Verified = true,
                    Location = location
                });

            var user = new User
                {
                    FirstName = "Test",
                    LastName = "Test",
                    Name = "Test Test",
                    Email = "*****@*****.**",
                    EncryptedPassword = new HashPasswordEncryptor().Encrypt("password").Password,
                    FacebookId = 1937134326,
                    Locale = "es_ES",
                    Username = "******",
                    Verified = true,
                    Location = location
                };
            _session.Save(user);

            _session.Save(new UserSession
                {
                    Expires = DateTime.Now.AddYears(1),
                    User = user,
                    Id = Guid.NewGuid()
                });
        }
Esempio n. 6
0
 public SeverityVote(User user, int severity)
 {
     User = user;
     Severity = severity;
 }
Esempio n. 7
0
 public PutOutVote(User user, bool isPutOut)
 {
     User = user;
     IsPutOut = isPutOut;
 }
Esempio n. 8
0
 public ControlledVote(User user, bool isControlled)
 {
     User = user;
     IsControlled = isControlled;
 }
Esempio n. 9
0
 public virtual void addPutOutVote(User user, Guid disasterId, bool isPutOut)
 {
     var putOutVote = new PutOutVote(user, isPutOut);
     ((IList<PutOutVote>) PutOutVotes).Add(putOutVote);
 }
Esempio n. 10
0
 public virtual void AddControlledVote(User user, Guid disasterId, bool isControlled)
 {
     var controlledVote = new ControlledVote(user, isControlled);
     ((IList<ControlledVote>) ControlledVotes).Add(controlledVote);
 }
 public FireTowerUserIdentity(User user)
 {
     User = user;
 }