Example #1
0
 //Function that checks for any changes in Active Directory
 //If so, it saves the new info in TARSUsers table
 public void CheckForActiveDirectoryChanges(LogOnModel model)
 {
 }
Example #2
0
        public ActionResult LogOn(LogOnModel model, string returnUrl)
        {
            LDAPConnection check = new LDAPConnection();

            if (ModelState.IsValid)
            {
            //               if (check.requestUser(model.UserName, model.Password))
            //                {
            model.UserName = "******";
            model.Password = "******";
            model.RememberMe = false;
                    TARSUserDBContext TARSUserDB = new TARSUserDBContext();
            //                    TARSUserDB.TARSUserList.Find(model.UserName);

                    //check for and save any updates to the user's info in active directory
                    CheckForActiveDirectoryChanges(model);

                    FormsAuthentication.SetAuthCookie(model.UserName, model.RememberMe);
                    if (Url.IsLocalUrl(returnUrl) && returnUrl.Length > 1 && returnUrl.StartsWith("/")
                        && !returnUrl.StartsWith("//") && !returnUrl.StartsWith("/\\"))
                    {
                        return Redirect(returnUrl);
                    }
                    else
                    {
                        return RedirectToAction("Index", "Home");
                    }
            //                }
            /*                else
                {
                   ModelState.AddModelError("", "The user name or password provided is incorrect.");
                }
            */
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }