Ejemplo n.º 1
0
        public int CheckIpWhiteList(string id, string Ip, string Mac, string location)
        {
            int             count = 0;
            var             res   = ValueController.GetIpTrue(id);
            ValueController vc    = new ValueController();

            if (res.Tables.Count != 0)
            {
                foreach (DataRow dr in res.Tables[0].Rows)
                {
                    if (Ip == dr[0].ToString())
                    {
                        count++;
                    }
                }
                if (count == 0)
                {
                    vc.PostActivityLog(id, "Login", "Failed");
                    var data2 = ModelManager.PostSecurityData(id, Ip, Mac, location);
                    //AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
                    //return View("IPErrorPage");
                }
            }
            return(count);
        }