private void CheckExternal() { if (ExternalLogin != null && ExternalID != null) { try { if (Mediachase.IBN.Business.Configuration.LicenseExpired) { throw new Mediachase.Ibn.LicenseExpiredException(); } int EUserID = Security.UserLoginByExternalGate((int)ExternalObjectType, ExternalObjectID, ExternalID, ExternalLogin); string path = HttpRuntime.AppDomainAppVirtualPath; if (path == "/") { path = ""; } SetAuthCookie(path + "/External", ExternalLogin, false, EUserID); HttpContext.Current.Items.Remove("userlight"); UserLight userLight = UserLight.Load(EUserID); UserLightPropertyCollection pc = userLight.Properties; HttpContext context = HttpContext.Current; context.Items.Add("userlight", userLight); //Response.Redirect(Server.UrlDecode(Request["ReturnUrl"])); // O.R. [2008-04-15] Response.Redirect(Request["ReturnUrl"], true); } catch { } } }
protected void Page_Load(object sender, System.EventArgs e) { // Add Tabs string link = String.Format("IncidentView.aspx?IncidentId={0}&Tab=FileLibrary&SubTab=0", IncidentId); blockControl.AddTab("0", LocRM.GetString("tFileStorage"), link, "../FileStorage/Modules/FileStorageControl.ascx"); link = String.Format("IncidentView.aspx?IncidentId={0}&Tab=FileLibrary&SubTab=1", IncidentId); blockControl.AddTab("1", LocRM.GetString("tFileList"), link, "../FileStorage/Modules/FilesList.ascx"); link = String.Format("IncidentView.aspx?IncidentId={0}&Tab=FileLibrary&SubTab=2", IncidentId); blockControl.AddTab("2", LocRM.GetString("tSearch"), link, "../FileStorage/Modules/FileSearch.ascx"); // Select Tab UserLightPropertyCollection pc = Security.CurrentUser.Properties; if ((SubTab == "0" || SubTab == "1" || SubTab == "2")) { pc[pcKey] = SubTab; } else if (pc[pcKey] == null) { pc[pcKey] = "0"; } blockControl.SelectTab(pc[pcKey]); }
/// <summary> /// Gets the value. /// </summary> /// <param name="cUid">The c uid.</param> /// <param name="key">The key.</param> /// <returns></returns> public override object GetValue(string cUid, string key) { string uid = GetKey(cUid, key); UserLightPropertyCollection pc = Security.CurrentUser.Properties; string value = pc[uid]; if (string.IsNullOrEmpty(value)) { //dvs: load default setting for all users if available value = PortalConfig.GetValue(uid); if (string.IsNullOrEmpty(value)) { return(value); } } // Step 1. String to XmlSerializedItem XmlSerializedItem item = McXmlSerializer.GetObject <XmlSerializedItem>(value); // Step 2. XmlSerializedItem to object return(McXmlSerializer.GetObject(item.Type, item.Data)); }
private ArrayList LoadProjectList() { UserLightPropertyCollection pc = Security.CurrentUser.Properties; ArrayList projectList = new ArrayList(); //UserLightPropertyCollection pc = Security.CurrentUser.Properties; string strProjectListType = pc["Report_ProjectListType"]; if (strProjectListType == null) { strProjectListType = "All"; } if (strProjectListType == "Custom") { string strProjectList = pc["Report_ProjectListData"]; if (strProjectList != null) { foreach (string strItem in strProjectList.Split(';')) { string strPrjId = strItem.Trim(); if (strPrjId != string.Empty) { projectList.Add(int.Parse(strPrjId)); } } } } else if (strProjectListType == "All") { using (IDataReader reader = Project.GetListProjects()) { while (reader.Read()) { projectList.Add((int)reader["ProjectId"]); } } } else if (strProjectListType == "Portfolio") { string strPortfolioId = pc["Report_ProjectListData"]; DataTable dt = Project.GetListProjectGroupedByPortfolio(int.Parse(strPortfolioId), 0, 0); foreach (DataRow row in dt.Rows) { int prid = int.Parse(row["ProjectId"].ToString()); if (prid > 0) { projectList.Add(prid); } } } return(projectList); }
protected void Page_Load(object sender, System.EventArgs e) { // Add Tabs string link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=Calendar&SubTab=DailyCalendar", ProjectId); blockControl.AddTab("DailyCalendar", LocRM.GetString("DailyCalendar"), link, "../Projects/Modules/ProjectCalendarWrapper2.ascx"); link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=Calendar&SubTab=WeeklyCalendar", ProjectId); blockControl.AddTab("WeeklyCalendar", LocRM.GetString("WeeklyCalendar"), link, "../Projects/Modules/ProjectCalendarWrapper2.ascx"); link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=Calendar&SubTab=MonthlyCalendar", ProjectId); blockControl.AddTab("MonthlyCalendar", LocRM.GetString("MonthlyCalendar"), link, "../Projects/Modules/ProjectCalendarWrapper2.ascx"); link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=Calendar&SubTab=YearlyCalendar", ProjectId); blockControl.AddTab("YearlyCalendar", LocRM.GetString("YearlyCalendar"), link, "../Projects/Modules/ProjectCalendarWrapper2.ascx"); // Select Tab UserLightPropertyCollection pc = Security.CurrentUser.Properties; if ((SubTab == "DailyCalendar" || SubTab == "MonthlyCalendar" || SubTab == "WeeklyCalendar" || SubTab == "YearlyCalendar")) { pc[pcKey] = SubTab; } else if (pc[pcKey] == null) { pc[pcKey] = "DailyCalendar"; } blockControl.SelectTab(pc[pcKey]); }
protected void Page_Load(object sender, System.EventArgs e) { // Add Tabs string link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=My&SubTab=ListView", ProjectId); blockControl.AddTab("ListView", LocRM.GetString("ListView"), link, "../Projects/Modules/WorksForResource.ascx"); if (Configuration.HelpDeskEnabled) { link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=My&SubTab=MyIncidents", ProjectId); blockControl.AddTab("MyIncidents", LocRM2.GetString("tMyIncidents"), link, "../Incidents/Modules/IncidentsList.ascx"); } // Select Tab UserLightPropertyCollection pc = Security.CurrentUser.Properties; if ((SubTab == "ListView" || SubTab == "MyIncidents")) { pc[pcKey] = SubTab; } else if (pc[pcKey] == null) { pc[pcKey] = "ListView"; } if (!Configuration.HelpDeskEnabled && pc[pcKey] == "MyIncidents") { pc[pcKey] = "ListView"; } blockControl.SelectTab(pc[pcKey]); }
public void Invoke(object Sender, object Element) { UserLightPropertyCollection _pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; _pc["fs_ViewStyle"] = "DetailsView"; ((System.Web.UI.Control)(Sender)).Page.Response.Redirect(((System.Web.UI.Control)(Sender)).Page.Request.RawUrl); }
protected void Page_Load(object sender, System.EventArgs e) { // Add Tabs string link; string text; DataTable dt; int iIncidents = 0; if (Configuration.HelpDeskEnabled) { dt = Incident.GetListIncidentsByFilterDataTable(ProjectId, 0, 0, 0, 0, PrimaryKeyId.Empty, PrimaryKeyId.Empty, 0, -1, 0, 0, 0, "", 0, 0); iIncidents = dt.Rows.Count; } dt = Document.GetListDocumentsByFilterDataTable(ProjectId, 0, 0, -1, 0, "", 0, PrimaryKeyId.Empty, PrimaryKeyId.Empty); int iDocuments = dt.Rows.Count; /// if (_canEdit) // { link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=6&SubTab=ResourceView", ProjectId); text = LocRM.GetString("ResourceView"); blockControl.AddTab("ResourceView", text, link, "../Projects/Modules/WorksForManagers.ascx"); // } link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=6&SubTab=GanttChart2", ProjectId); text = LocRM.GetString("GanttChart"); blockControl.AddTab("GanttChart2", text, link, "../Projects/Modules/GanttView2.ascx"); if (Configuration.HelpDeskEnabled) { link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=6&SubTab=AllIncidents", ProjectId); text = String.Format("{0} <span class='ibn-number'>({1})</span>", LocRM.GetString("tIssues"), iIncidents); blockControl.AddTab("AllIncidents", text, link, "../Incidents/Modules/IncidentsList.ascx"); } link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=6&SubTab=AllDocuments", ProjectId); text = String.Format("{0} <span class='ibn-number'>({1})</span>", LocRM2.GetString("tDocuments"), iDocuments); blockControl.AddTab("AllDocuments", text, link, "../Documents/Modules/DocumentList.ascx"); // Select Tab UserLightPropertyCollection pc = Security.CurrentUser.Properties; if ((SubTab == "ResourceView" || SubTab == "GanttChart2" || SubTab == "AllIncidents" || SubTab == "AllDocuments")) { pc[pcKey] = SubTab; } else if (pc[pcKey] == null) { pc[pcKey] = "ResourceView"; } if (!Configuration.HelpDeskEnabled && pc[pcKey] == "AllIncidents") { pc[pcKey] = "ResourceView"; } blockControl.SelectTab(pc[pcKey]); }
public bool IsEnable(object Sender, object Element) { bool retVal = false; UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; if (pc["ArticleListMain_Mode"] == null) { pc["ArticleListMain_Mode"] = Mediachase.Ibn.Web.UI.HelpDeskManagement.Modules.ArticleListMain.MODE_SEARCH; } if (pc["ArticleListMain_Search"] == null) { pc["ArticleListMain_Search"] = string.Empty; } switch (pc["ArticleListMain_Mode"]) { case Mediachase.Ibn.Web.UI.HelpDeskManagement.Modules.ArticleListMain.MODE_SEARCH: if (!string.IsNullOrEmpty(pc["ArticleListMain_Search"])) { retVal = true; } break; case Mediachase.Ibn.Web.UI.HelpDeskManagement.Modules.ArticleListMain.MODE_TAGS: retVal = true; break; } return(retVal); }
public void OrderChange(string newLayout, string contextKey) { LayoutContextKey key = UtilHelper.JsonDeserialize <LayoutContextKey>(contextKey); if (!key.IsAdmin) { key.ProfileId = null; key.UserId = Mediachase.IBN.Business.Security.CurrentUser.UserID; } CustomPageEntity page = CustomPageManager.GetCustomPage(key.PageUid, key.ProfileId, key.UserId); if (page == null) { throw new ArgumentException(String.Format("Cant read setting for page: {0}", key.PageUid)); } if (!(key.IsAdmin || Mediachase.Ibn.Business.Customization.ProfileManager.CheckPersonalization())) { UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; pc["userCollapseExpand_" + key.PageUid.ToString("N")] = newLayout; } else { CustomPageManager.UpdateCustomPage(key.PageUid, newLayout, page.TemplateId, key.ProfileId, key.UserId); } }
private void BindTabs() { UserLightPropertyCollection pc = Security.CurrentUser.Properties; if (Tab != null && (Tab == "0" || Tab == "1" || Tab == "2")) { pc[pcKey] = Tab; } else if (pc[pcKey] == null) { pc[pcKey] = "1"; } if (TypeId < 0) { ctrlTopTab.AddTab(LocRM.GetString("tFileStorage"), "0"); } else if (pc[pcKey] == "0") { pc[pcKey] = "1"; } ctrlTopTab.AddTab(LocRM.GetString("tFileList"), "1"); ctrlTopTab.AddTab(LocRM.GetString("tSearch"), "2"); string controlName = ""; string selectedTab = pc[pcKey]; if (!IsPostBack) { switch (selectedTab) { case "0": controlName = "../../FileStorage/Modules/FileStorageControl.ascx"; break; case "1": controlName = "../../FileStorage/Modules/FilesList.ascx"; break; case "2": controlName = "../../FileStorage/Modules/FileSearch.ascx"; break; default: break; } ViewState["controlName"] = controlName; ViewState["selectedTab"] = selectedTab; } else { controlName = (string)ViewState["controlName"]; selectedTab = (string)ViewState["selectedTab"]; } System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName); phItems.Controls.Add(control); ctrlTopTab.SelectItem(selectedTab); }
protected void lbViewAll_Click(object sender, System.EventArgs e) { UserLightPropertyCollection pc = Security.CurrentUser.Properties; int mask = (int)CalendarView.CalendarFilter.Task; pc["ListView_Type"] = mask.ToString(); Response.Redirect(String.Format("../Projects/ProjectView.aspx?ProjectID={0}&Tab=6&ABTab=ListView", ProjID.ToString())); }
//static methods #region GetProfileName public static string GetProfileName(UserLightPropertyCollection pc, string className) { if (pc[className + "_" + ProfileNameKey] == null) { pc[className + "_" + ProfileNameKey] = GetFirstAvailableListViewProfile(className); } return(pc[className + "_" + ProfileNameKey]); }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string[] checkedElems = MCGrid.GetCheckedCollection(((CommandManager)Sender).Page, cp.CommandArguments["GridId"]); ArrayList alMas = new ArrayList(); foreach (string elem in checkedElems) { string[] elemMas = elem.Split(new string[] { "::" }, StringSplitOptions.RemoveEmptyEntries); //type, id, _containerName, _containerKey if (elemMas.Length != 4) { continue; } if (elemMas[0] == "2") { int id = Convert.ToInt32(elemMas[1], CultureInfo.InvariantCulture); alMas.Add(id); } UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; System.Resources.ResourceManager LocRM = new System.Resources.ResourceManager("Mediachase.UI.Web.App_GlobalResources.Modules.Resources.strTemplate", typeof(CopySelectedHandler).Assembly); int iCount = 10; if (pc["ClipboardItemsCount"] != null) { iCount = int.Parse(pc["ClipboardItemsCount"].ToString()); } string ss = String.Empty; try { foreach (int iFileId in alMas) { string sNewFileClip = ""; if (pc["ClipboardFiles"] != null) { sNewFileClip = pc["ClipboardFiles"].ToString(); } sNewFileClip = WorkWithClipboard(iCount, iFileId.ToString() + "|" + sNewFileClip); pc["ClipboardFiles"] = sNewFileClip; } ss = String.Format(LocRM.GetString("tFilesAdded"), alMas.Count.ToString()); } catch { ss = LocRM.GetString("tFilesNotAdded"); } CommandManager cm = Sender as CommandManager; if (cm != null && !String.IsNullOrEmpty(ss)) { cm.InfoMessage = ss; } } } }
protected void Page_Load(object sender, System.EventArgs e) { pcCurrentUser = Security.CurrentUser.Properties; BindToolbars(); if (!Page.IsPostBack) { ApplyLocalization(); BindValues(); } }
public void Invoke(object Sender, object Element) { UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; pc["ArticleListMain_Mode"] = Mediachase.Ibn.Web.UI.HelpDeskManagement.Modules.ArticleListMain.MODE_SEARCH; pc["ArticleListMain_Tag"] = ""; pc["ArticleListMain_Search"] = ""; CHelper.RequireBindGrid(); }
protected void Page_Load(object sender, System.EventArgs e) { pcCurrentUser = Security.CurrentUser.Properties; if (pcCurrentUser["c_SortColumn"] == null) { pcCurrentUser["c_SortColumn"] = "CreationDate DESC"; } BindToolbar(); BindDataGrid(); }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string uid = cp.CommandArguments["ViewUid"]; UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; pc[IncidentListNew.IssueListViewNameKey] = uid; ((System.Web.UI.Control)(Sender)).Page.Response.Redirect(((System.Web.UI.Control)(Sender)).Page.Request.RawUrl); } }
protected void btnSave_ServerClick(object sender, EventArgs e) { int iNewFolderId = int.Parse(destFolderId.Value); ListManager.MoveList(new ListInfo(_listId), new ListFolder(iNewFolderId)); UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; pc["ListInfo_FolderId_EntityList_GroupItemKey"] = iNewFolderId.ToString(); CloseAndRefresh(); }
public void CancelAction() { UserLightPropertyCollection pc = Security.CurrentUser.Properties; PortalConfig.PortalShowAdminWizard = cbShowNextTime.Checked; if (pc["USetup_ShowStartupWizard"] == null || pc["USetup_ShowStartupWizard"] == "True") { Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "try{window.opener.top.right.location.href='../Workspace/default.aspx?BTab=Workspace&wizard=1';} catch (e) {} window.close();", true); } }
protected void Page_Load(object sender, System.EventArgs e) { pc = Security.CurrentUser.Properties; if (!IsPostBack) { BindDefaultValues(); BindSavedData(); BindClendarControl(); } btnApply.Text = LocRM.GetString("Apply"); }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string folderId = cp.CommandArguments["FolderId"]; UserLightPropertyCollection _pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; _pc["ListInfo_FolderId_EntityList_GroupItemKey"] = folderId; CHelper.RequireBindGrid(); } }
public void Invoke(object Sender, object Element) { if (Element is CommandParameters) { CommandParameters cp = (CommandParameters)Element; string uid = cp.CommandArguments["ViewUid"]; string className = cp.CommandArguments["ClassName"]; UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; EntityList.SetProfileName(pc, className, uid); ((System.Web.UI.Control)(Sender)).Page.Response.Redirect(((System.Web.UI.Control)(Sender)).Page.Request.RawUrl); } }
protected void Page_Load(object sender, System.EventArgs e) { UserLightPropertyCollection pc = Security.CurrentUser.Properties; // Add Tabs string link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=4&SubTab=0", ProjectId); bool IsFinance41 = (Finance.GetListActualFinancesByProject(int.Parse(this.Request["ProjectId"]), false).Rows.Count > 0); blockControl.AddTab("0", LocRM.GetString("tSpreadSheet"), link, "../Projects/Modules/FinanceSpreadSheet.ascx"); if ((SubTab == "0" || SubTab == "1" || SubTab == "2")) { pc[pcKey] = SubTab; } else if (pc[pcKey] == null) { pc[pcKey] = "0"; } bool projectSpreadSheetIsActive = ProjectSpreadSheet.IsActive(int.Parse(this.Request["ProjectId"])); if (!projectSpreadSheetIsActive) { link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=4&SubTab=1", ProjectId); if (IsFinance41) { blockControl.AddTab("1", LocRM.GetString("tActFinances"), link, "../Projects/Modules/FinanceActualList.ascx"); } if (pc[pcKey] != "2" && !IsFinance41) { pc[pcKey] = "0"; } } else { //blockControl.AddTab("0", LocRM.GetString("tSpreadSheet"), link, "../Projects/Modules/FinanceSpreadSheet.ascx"); link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=4&SubTab=1", ProjectId); blockControl.AddTab("1", LocRM.GetString("tActFinances"), link, "../Projects/Modules/FinanceActualList2.ascx"); } //IBN 4.1 Finances if (IsFinance41 && !projectSpreadSheetIsActive) { link = String.Format("ProjectView.aspx?ProjectId={0}&Tab=4&SubTab=2", ProjectId); blockControl.AddTab("2", LocRM.GetString("tAccounts"), link, "../Projects/Modules/FinanceAccountsList.ascx"); } // Select Tab blockControl.SelectTab(pc[pcKey]); }
private void UpdateProperties() { UserLightPropertyCollection pc = Security.CurrentUser.Properties; if (!cbAllow.Checked) { pc["USetup_ShowStartupWizard"] = "False"; } else { pc["USetup_ShowStartupWizard"] = "True"; } }
public string GenerateFinalStepScript() { UserLightPropertyCollection pc = Security.CurrentUser.Properties; PortalConfig.PortalShowAdminWizard = cbShowNextTime.Checked; if (pc["USetup_ShowStartupWizard"] == null || pc["USetup_ShowStartupWizard"] == "True") { return("try{window.opener.top.right.location.href='../Workspace/default.aspx?BTab=Workspace&wizard=1';} catch (e) {} window.close();"); } else { return("try{window.opener.top.location.href='" + ResolveClientUrl("~/Apps/Shell/Pages/default.aspx") + "';} catch (e) {} window.close();"); } }
public void Invoke(object sender, object element) { if (element is CommandParameters) { NameValueCollection qs = ((Control)sender).Page.Request.QueryString; string className = qs["ClassName"]; //ListInfo li = ListManager.GetListInfoByMetaClassName(className); UserLightPropertyCollection pc = Mediachase.IBN.Business.Security.CurrentUser.Properties; ClientScript.RegisterStartupScript(((Control)sender).Page, ((Control)sender).Page.GetType(), Guid.NewGuid().ToString("N"), string.Format("OpenPopUpWindow('{0}', 640, 480);", RssGenerator.CreateRssLink(((Control)sender).Page, className, null, EntityList.GetProfileName(pc, className))), true); //((Control)sender).Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString("N"), // string.Format("OpenPopUpWindow('{0}', 640, 480);", RssGenerator.CreateRssLink(((Control)sender).Page, Guid.NewGuid(), className, null, EntityList.GetProfileName(pc, className))), true); //((Control)sender).Page.Response.Redirect(RssGenerator.CreateRssLink(((Control)sender).Page, Guid.NewGuid(), className, null, EntityList.GetProfileName(pc, className))); } }
private void CheckQueryLogin() { if (RegularLogin != null && RegularPassword != null && RegularRedirect != null) { try { int iUserId = Security.UserLogin(RegularLogin, RegularPassword); if (Mediachase.IBN.Business.Configuration.LicenseExpired) { throw new Mediachase.Ibn.LicenseExpiredException(); } // !! Authorisation cookie SetAuthCookie(HttpRuntime.AppDomainAppVirtualPath, RegularLogin, false, iUserId); // not rederect UserLight userLight = UserLight.Load(iUserId); UserLightPropertyCollection pc = userLight.Properties; HttpContext context = HttpContext.Current; context.Items.Add("userlight", userLight); //Response.Redirect("~/" + Server.UrlDecode(RegularRedirect)); // O.R. [2008-04-15] Response.Redirect("~/" + RegularRedirect); } catch (InvalidAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (InvalidPasswordException) { Response.Redirect("~/Public/default.aspx"); } catch (NotActiveAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (ExternalOrPendingAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (Mediachase.Ibn.LicenseExpiredException) { Response.Redirect("~/Public/default.aspx"); } } }
private void CheckTicketLogin() { if (!String.IsNullOrEmpty(RegularLogin) && !String.IsNullOrEmpty(RegularTicket) && !String.IsNullOrEmpty(RegularRedirect)) { try { int iUserId = Security.UserLoginByTicket(RegularLogin, new Guid(RegularTicket)); if (Mediachase.IBN.Business.Configuration.LicenseExpired) { throw new Mediachase.Ibn.LicenseExpiredException(); } // !! Authorisation cookie SetAuthCookie(HttpRuntime.AppDomainAppVirtualPath, RegularLogin, false, iUserId); // not rederect UserLight userLight = UserLight.Load(iUserId); UserLightPropertyCollection pc = userLight.Properties; HttpContext context = HttpContext.Current; context.Items.Add("userlight", userLight); Response.Redirect("~/" + RegularRedirect); } catch (InvalidAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (InvalidTicketException) { Response.Redirect("~/Public/default.aspx"); } catch (NotActiveAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (ExternalOrPendingAccountException) { Response.Redirect("~/Public/default.aspx"); } catch (Mediachase.Ibn.LicenseExpiredException) { Response.Redirect("~/Public/default.aspx"); } } }
protected void Page_Load(object sender, System.EventArgs e) { string redirectUrl = "~/Public/WebLogin.aspx?" + Request.QueryString.ToString(); string windowsUserName = Request.ServerVariables["LOGON_USER"]; if (!string.IsNullOrEmpty(windowsUserName)) // Don't search for empty user name. { int userId = Security.UserLoginWindows(windowsUserName); if (userId > 0) { string ibnUserName = GetIbnUserName(userId); SetAuthCookie(HttpRuntime.AppDomainAppVirtualPath, ibnUserName); if (Request["ReturnUrl"] == null) { UserLight userLight = UserLight.Load(userId); UserLightPropertyCollection pc = userLight.Properties; HttpContext context = HttpContext.Current; if (context != null && context.Items.Contains("userlight")) { context.Items.Remove("userlight"); } context.Items.Add("userlight", userLight); if (Security.IsUserInGroup(InternalSecureGroups.Administrator) && PortalConfig.PortalShowAdminWizard) { redirectUrl = "~/Workspace/default.aspx?BTab=Workspace&AdminWizard=1"; } else { redirectUrl = "~/Apps/Shell/Pages/default.aspx"; } } else { redirectUrl = Request["ReturnUrl"]; } } } Response.Redirect(redirectUrl, true); }