예제 #1
0
 public SchoolMetadata()
 {
     Header = new SchoolData();
     Positions = new List<Position>();
     People = new List<Person>();
     About = new AboutContent();
 }
예제 #2
0
        public JsonResult Authenticate(AuthRequest req)
        {
            if (req == null) req = new AuthRequest();
            var helper = ServiceProvider.Resolve<StorageHelper>();
            SchoolData schooldata = new SchoolData();

            string username = helper.StandardUsername;

            if (helper.AdminPassword.Equals(req.Passcode)) username = helper.AdminUsername;

            var validated = Membership.ValidateUser(username, req.Passcode);
            if (validated)
            {
                schooldata = helper.Schools.FirstOrDefault(q => q.Passcode == req.Passcode);

            }

            return Json(new { IsValidated = validated, SchoolData = schooldata });
        }