public ActionResult Login(AccountModel model) { var user = _authenticationService.LogIn(model.Login, model.Password); ViewBag.LdapIsAuthentication = user != null; if (user != null && user.Identity.IsAuthenticated) { _authenticationService.CreateAuthenticationTicket(user); return RedirectToRoute(FileSystemRouteNames.ShowContentPath, new { org = WspContext.User.OrganizationId }); } return View(new AccountModel { LdapError = "The user name or password is incorrect" }); }
public ActionResult Login() { if (WspContext.User != null && WspContext.User.Identity.IsAuthenticated) { return RedirectToRoute(FileSystemRouteNames.ShowContentPath, new { org = WspContext.User.OrganizationId }); } var model = new AccountModel(); var settings = WspContext.Services.Organizations.GetWebDavSystemSettings(); if (settings != null) { model.PasswordResetEnabled = settings.GetValueOrDefault(EnterpriseServer.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false); } return View(model); }