public IdentityServerWithRecaptcha WithFailuresForIpAddress(string ipAddress, int numberOfFailures)
 {
     for (var failures = 0; failures < numberOfFailures; ++failures)
     {
         LoginStatistics.IncrementFailedLoginsForUserAndIpAddress(string.Empty, IPAddress.Parse(ipAddress));
     }
     return(this);
 }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Context.User.Identity.Name))
            {
                try
                {
                    LoginStatistics item = new LoginStatistics();

                    item.UserName = Context.User.Identity.Name;

                    item.WhenLastDate = DateTime.Now;

                    item.Ip = Request.UserHostAddress;

                    item.Client = 0;

                    DataHelper.AddLoginStatistic(item);
                }
                catch { }
            }

            ListNews = DataHelper.GetActiveNewsLast5();
        }