Example #1
0
        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);
            }
        }
        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.SecurityManagement))
            {
                // no, redirect to admin default page, since the user HAS access to the admin menu.
                Response.Redirect("Default.aspx", true);
            }

            _roleID = 0;

            if (!Page.IsPostBack)
            {
                // Get all roles
                RoleCollection roles = SecurityGuiHelper.GetAllRoles();

                cbxRoles.DataSource     = roles;
                cbxRoles.DataTextField  = "RoleDescription";
                cbxRoles.DataValueField = "RoleID";
                cbxRoles.DataBind();

                if (cbxRoles.Items.Count > 0)
                {
                    cbxRoles.Items[0].Selected = true;
                    _roleID = HnDGeneralUtils.TryConvertToInt(cbxRoles.SelectedItem.Value);
                }

                // get the audit actions
                AuditActionCollection auditActions = SecurityGuiHelper.GetAllAuditActions();

                cblAuditActions.DataSource     = auditActions;
                cblAuditActions.DataTextField  = "AuditActionDescription";
                cblAuditActions.DataValueField = "AuditActionID";
                cblAuditActions.DataBind();

                // Reflect action rights for current selected forum for this role
                ReflectCurrentAuditActions();
            }
            else
            {
                _roleID = HnDGeneralUtils.TryConvertToInt(cbxRoles.SelectedItem.Value);
            }
        }
Example #3
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            _description = "user";
            if (_multiSelect)
            {
                _description = "users";
            }

            if (!Page.IsPostBack)
            {
                RoleCollection roles = SecurityGuiHelper.GetAllRoles();
                cbxRoles.DataSource     = roles;
                cbxRoles.DataTextField  = "RoleDescription";
                cbxRoles.DataValueField = "RoleID";
                cbxRoles.DataBind();
            }
        }