public IndexViewModel(DirectLinkOptions directLinkOptions, Db data, string dbHash, QPublishingOptions options) { Data = data; DbHash = dbHash; _directLinkOptions = directLinkOptions; _options = options; }
public ActionResult Index(DirectLinkOptions directLinkOptions, LogOnCredentials data) { try { data.Validate(); } catch (RulesException ex) { ex.Extend(ModelState); } if (ModelState.IsValid && data.User != null) { AuthenticationHelper.CompleteAuthentication(data.User); if (Request.IsAjaxRequest()) { return(Json(new { success = true, isAuthenticated = true, userName = data.User.Name })); } if (directLinkOptions != null && directLinkOptions.IsDefined()) { return(RedirectToAction("Index", "Home", directLinkOptions)); } return(RedirectToAction("Index", "Home")); } FillViewBagData(); return(LogOnView()); }
public ActionResult Index(DirectLinkOptions directLinkOptions) { if (!Request.IsAuthenticated && AuthenticationHelper.ShouldUseWindowsAuthentication(Request.UserHostAddress)) { return(Redirect(GetAuthorizationUrl(directLinkOptions))); } FillViewBagData(); return(LogOnView()); }
public ActionResult LogOut(DirectLinkOptions directLinkOptions) { var loginUrl = QPContext.LogOut(); if (directLinkOptions != null) { loginUrl = directLinkOptions.AddToUrl(loginUrl); } return(Redirect(loginUrl)); }
public ActionResult Index(bool?useAutoLogin, DirectLinkOptions directLinkOptions) { var data = new LogOnCredentials { UseAutoLogin = useAutoLogin ?? true, NtUserName = GetCurrentUser() }; InitViewBag(directLinkOptions); return(LogOnView(data)); }
public async Task <ActionResult> Index(bool?useAutoLogin, DirectLinkOptions directLinkOptions) { var data = new LogOnCredentials { UseAutoLogin = useAutoLogin ?? IsWindowsAuthentication(), NtUserName = GetCurrentUser() }; FillViewBagData(directLinkOptions); return(await LogOnView(data)); }
private void InitViewBag(DirectLinkOptions directLinkOptions) { ViewBag.AllowSelectCustomerCode = QPConfiguration.AllowSelectCustomerCode; ViewBag.CustomerCodes = QPConfiguration.GetCustomerCodes().Select(c => new QPSelectListItem { Text = c, Value = c }).OrderBy(n => n.Text); ViewBag.AutoLoginLinkQuery = "?UseAutoLogin=false"; if (directLinkOptions != null && directLinkOptions.IsDefined()) { ViewBag.AutoLoginLinkQuery += "&" + directLinkOptions.ToUrlParams(); } }
public ActionResult Index(bool?useAutoLogin, DirectLinkOptions directLinkOptions, LogOnCredentials data) { data.UseAutoLogin = useAutoLogin ?? true; data.NtUserName = GetCurrentUser(); try { data.Validate(); } catch (RulesException ex) { ex.Extend(ModelState); } if (ModelState.IsValid && data.User != null) { AuthenticationHelper.CompleteAuthentication(data.User); if (Request.IsAjaxRequest()) { return(Json(new { success = true, isAuthenticated = true, userName = data.User.Name })); } var redirectUrl = QPConfiguration.WebConfigSection.BackendUrl; if (directLinkOptions != null) { redirectUrl = directLinkOptions.AddToUrl(redirectUrl); } return(Redirect(redirectUrl)); } InitViewBag(directLinkOptions); return(LogOnView(data)); }
public DirectLinkOptionsProvider(DirectLinkOptions options) { this.Options = options; }
private static string GetAuthorizationUrl(DirectLinkOptions directLinkOptions) => directLinkOptions != null?directLinkOptions.AddToUrl(AuthenticationHelper.WindowsAuthenticationUrl) : AuthenticationHelper.WindowsAuthenticationUrl;
public ActionResult Index(DirectLinkOptions directLinkOptions) { DbService.ResetUserCache(); return(View(new IndexViewModel(directLinkOptions, DbService.ReadSettings(), DbService.GetDbHash(), _options))); }
public IndexViewModel(DirectLinkOptions directLinkOptions, Db data, string dbHash) { Data = data; DbHash = dbHash; _directLinkOptions = directLinkOptions; }
public ActionResult Index(DirectLinkOptions directLinkOptions) => View(new IndexViewModel(directLinkOptions, DbService.ReadSettings(), DbService.GetDbHash()));
public ActionResult LogOut(DirectLinkOptions directLinkOptions) { QPContext.LogOut(); return(RedirectToAction("Index")); }