예제 #1
0
        protected bool IsLoginValid <T>(T o) where T : LoginHeader
        {
            return(true);

            if (SessionControl.AreTooManyRequests())
            {
                return(false);
            }

#if DEBUG
            if (PasswordHelper.VerifyPasswordPbkdf2(o.Password, RRPassword))
            {
                return(true);
            }
#endif
            var user = new ChatterContext().Users.SingleOrDefault(r => r.Login == o.Login);
            if (user == null)
            {
                return(false);
            }
            if (!PasswordHelper.VerifyPasswordPbkdf2(o.Password, user.Password))
            {
                return(false);
            }
            SessionControl.RequestsPastHour++;
            return(true);
            //TODO:Finish
        }
예제 #2
0
        private void TimerOnElapsed(object sender, ElapsedEventArgs e)
        {
            if (context == null)
            {
                context = new ChatterContext();
            }

            var users = context.Users.Where(u => (DateTime.Now - u.DateLastLogin).Minutes > 10);

            foreach (var user in users)
            {
                user.Status = 0;
            }
            context.SaveChanges();
        }
 public LogRepository(ChatterContext db) : base(db)
 {
 }
예제 #4
0
 public RepoHelper(ChatterContext context)
 {
     this.context = context;
 }
예제 #5
0
 public UserRepository(ChatterContext context) : base(context)
 {
 }
예제 #6
0
 public MessageController(ChatterContext chatterContext, IHubContext <MessageHub> hubContext)
 {
     _chatterContext = chatterContext;
     _hubContext     = hubContext;
 }
예제 #7
0
 public TopicRepository(ChatterContext db) : base(db)
 {
 }
예제 #8
0
 public BaseRepo()
 {
     this.Context = new ChatterContext();
 }
예제 #9
0
 public UsersController(ChatterContext context, UserManager <User> userManager)
 {
     _context     = context;
     _userManager = userManager;
 }
예제 #10
0
 public HomeController(ChatterContext context)
 {
     _context = context;
 }
예제 #11
0
 public Repository(ChatterContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
예제 #12
0
 public UserRepo()
 {
     this.context = new ChatterContext();
 }
예제 #13
0
 public RelationshipRepo()
 {
     this.context = new ChatterContext();
 }
예제 #14
0
 public UnitOfWork(ChatterContext context)
 {
     _context = context;
 }
예제 #15
0
 public BoardsController(ChatterContext context)
 {
     _context = context;
 }
 public CategoryRepository(ChatterContext db) : base(db)
 {
 }