private void Page_Load(object sender, System.EventArgs e) { // If the user doesn't have any access rights to management stuff, the user should // be redirected to the default of the global system. if (!SessionAdapter.HasSystemActionRights()) { // doesn't have system rights. redirect. Response.Redirect("../Default.aspx", true); } // Check if the user has the right systemright if (!SessionAdapter.HasSystemActionRight(ActionRights.UserManagement)) { // no, redirect to admin default page, since the user HAS access to the admin menu. Response.Redirect("Default.aspx", true); } if (!Page.IsPostBack) { cmbUserTitle.DataSource = UserGuiHelper.GetAllUserTitles(); cmbUserTitle.DataTextField = "UserTitleDescription"; cmbUserTitle.DataValueField = "UserTitleID"; cmbUserTitle.DataBind(); } }
private void Page_Load(object sender, System.EventArgs e) { // If the user doesn't have any access rights to management stuff, the user should // be redirected to the default of the global system. if (!SessionAdapter.HasSystemActionRights()) { // doesn't have system rights. redirect. Response.Redirect("../Default.aspx", true); } // Check if the user has the right systemright if (!SessionAdapter.HasSystemActionRight(ActionRights.SystemManagement)) { // no, redirect to admin default page, since the user HAS access to the admin menu. Response.Redirect("Default.aspx", true); } if (!Page.IsPostBack) { // load the data into the dropdown boxes. RoleCollection allRoles = SecurityGuiHelper.GetAllRoles(); cbxDefaultRoleNewUsers.DataSource = allRoles; cbxDefaultRoleNewUsers.DataTextField = "RoleDescription"; cbxDefaultRoleNewUsers.DataValueField = "RoleID"; cbxDefaultRoleNewUsers.DataBind(); cbxAnonymousUserRole.DataSource = allRoles; cbxAnonymousUserRole.DataTextField = "RoleDescription"; cbxAnonymousUserRole.DataValueField = "RoleID"; cbxAnonymousUserRole.DataBind(); UserTitleCollection userTitles = UserGuiHelper.GetAllUserTitles(); cbxDefaultUserTitleNewUsers.DataSource = userTitles; cbxDefaultUserTitleNewUsers.DataTextField = "UserTitleDescription"; cbxDefaultUserTitleNewUsers.DataValueField = "UserTitleID"; cbxDefaultUserTitleNewUsers.DataBind(); // preselect the current values of the system parameters. SystemDataEntity systemData = CacheManager.GetSystemData(); cbxDefaultRoleNewUsers.SelectedValue = systemData.DefaultRoleNewUser.ToString(); cbxAnonymousUserRole.SelectedValue = systemData.AnonymousRole.ToString(); cbxDefaultUserTitleNewUsers.SelectedValue = systemData.DefaultUserTitleNewUser.ToString(); tbxActiveThreadsThreshold.Text = systemData.HoursThresholdForActiveThreads.ToString(); tbxMinNumberOfNonStickyVisibleThreads.Text = systemData.MinNumberOfNonStickyVisibleThreads.ToString(); tbxMinNumberOfThreadsToFetch.Text = systemData.MinNumberOfThreadsToFetch.ToString(); tbxPageSizeInSearchResults.Text = systemData.PageSizeSearchResults.ToString(); chkSendReplyNotifications.Checked = systemData.SendReplyNotifications; ViewState.Add("ID", systemData.ID); } }