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 }
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) { }
public RepoHelper(ChatterContext context) { this.context = context; }
public UserRepository(ChatterContext context) : base(context) { }
public MessageController(ChatterContext chatterContext, IHubContext <MessageHub> hubContext) { _chatterContext = chatterContext; _hubContext = hubContext; }
public TopicRepository(ChatterContext db) : base(db) { }
public BaseRepo() { this.Context = new ChatterContext(); }
public UsersController(ChatterContext context, UserManager <User> userManager) { _context = context; _userManager = userManager; }
public HomeController(ChatterContext context) { _context = context; }
public Repository(ChatterContext db) { Db = db; DbSet = db.Set <TEntity>(); }
public UserRepo() { this.context = new ChatterContext(); }
public RelationshipRepo() { this.context = new ChatterContext(); }
public UnitOfWork(ChatterContext context) { _context = context; }
public BoardsController(ChatterContext context) { _context = context; }
public CategoryRepository(ChatterContext db) : base(db) { }