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
            bool hasAccess = SessionAdapter.HasSystemActionRight(ActionRights.SecurityManagement);

            if (!hasAccess)
            {
                // no, redirect to admin default page, since the user HAS access to the admin menu.
                Response.Redirect("Default.aspx", true);
            }

            _roleID = HnDGeneralUtils.TryConvertToInt(Request.QueryString["RoleID"]);

            if (!Page.IsPostBack)
            {
                // Get Role
                RoleEntity role = SecurityGuiHelper.GetRole(_roleID);
                if (role != null)
                {
                    _roleDescription = role.RoleDescription;
                }
                else
                {
                    _roleDescription = "Not found";
                }

                // bind the users listbox to an entity collection with all users in the role
                UserCollection users = UserGuiHelper.GetAllUsersInRole(_roleID);
                lbxUsers.DataSource     = users;
                lbxUsers.DataTextField  = "NickName";
                lbxUsers.DataValueField = "UserID";
                lbxUsers.DataBind();
            }
        }
Esempio n. 2
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);
            }

            _sectionID = HnDGeneralUtils.TryConvertToInt(Request.QueryString["SectionID"]);

            if (!Page.IsPostBack)
            {
                // Load the section directly from the database and show it in the textboxes
                SectionEntity section = SectionGuiHelper.GetSection(_sectionID);

                if (section != null)
                {
                    // show it
                    tbxSectionName.Value       = section.SectionName;
                    tbxSectionDescription.Text = section.SectionDescription;
                    tbxOrderNo.Text            = section.OrderNo.ToString();
                }
                else
                {
                    // not found
                    Response.Redirect("Default.aspx", true);
                }
            }
        }
Esempio n. 3
0
        protected void Page_Load(object sender, 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
            bool userHasAccess = SessionAdapter.HasSystemActionRight(ActionRights.UserManagement);

            if (!userHasAccess)
            {
                // no, redirect to admin default page, since the user HAS access to the admin menu.
                Response.Redirect("Default.aspx", true);
            }

            // set these form variables to their required values, so the InsertParameters of the datasource control can pick them up when a new ip ban
            // entity is inserted.
            _userID.Value      = SessionAdapter.GetUserID().ToString();
            _currentDate.Value = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss");
        }
Esempio n. 4
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
            bool hasAccess = SessionAdapter.HasSystemActionRight(ActionRights.SecurityManagement);

            if (!hasAccess)
            {
                // no, redirect to admin default page, since the user HAS access to the admin menu.
                Response.Redirect("Default.aspx", true);
            }

            _roleID = HnDGeneralUtils.TryConvertToInt(Request.QueryString["RoleID"]);

            if (!Page.IsPostBack)
            {
                // get the role and show the description
                RoleEntity role = SecurityGuiHelper.GetRole(_roleID);
                if (!role.IsNew)
                {
                    _roleDescription = role.RoleDescription;
                }

                // store in viewstate.
                ViewState.Add("sRoleDescription", _roleDescription);

                // Get all sections, which do have a forum.
                DataView sections = SectionGuiHelper.GetAllSectionsWStatisticsAsDataView(true);

                cbxSections.DataSource     = sections;
                cbxSections.DataTextField  = "SectionName";
                cbxSections.DataValueField = "SectionID";
                cbxSections.DataBind();

                if (cbxSections.Items.Count > 0)
                {
                    cbxSections.Items[0].Selected = true;
                }

                FillForumList();

                // get the forum action rights
                ActionRightCollection actionRights = SecurityGuiHelper.GetAllActionRightsApplybleToAForum();

                cblForumRights.DataSource     = actionRights;
                cblForumRights.DataTextField  = "ActionRightDescription";
                cblForumRights.DataValueField = "ActionRightID";
                cblForumRights.DataBind();

                // Reflect action rights for current selected forum for this role
                ReflectCurrentActionRights();
            }
            else
            {
                // read role description from viewstate
                _roleDescription = ViewState["sRoleDescription"].ToString();
                _forumID         = HnDGeneralUtils.TryConvertToInt(cbxForums.SelectedItem.Value);
            }
        }
Esempio n. 5
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);
            }

            _forumID = HnDGeneralUtils.TryConvertToInt(Request.QueryString["ForumID"]);

            if (!Page.IsPostBack)
            {
                // read sections for the drop down list.
                SectionCollection sections = SectionGuiHelper.GetAllSections();
                cbxSections.DataSource = sections;
                cbxSections.DataBind();

                SupportQueueCollection supportQueues = CacheManager.GetAllSupportQueues();
                cbxSupportQueues.DataSource = supportQueues;
                cbxSupportQueues.DataBind();

                // Load the forum.
                ForumEntity forum = ForumGuiHelper.GetForum(_forumID);
                if (forum != null)
                {
                    // forum found
                    tbxForumDescription.Text = forum.ForumDescription;
                    tbxForumName.Value       = forum.ForumName;
                    tbxOrderNo.Text          = forum.OrderNo.ToString();

                    cbxSections.SelectedValue = forum.SectionID.ToString();

                    if (forum.DefaultSupportQueueID.HasValue)
                    {
                        cbxSupportQueues.SelectedValue = forum.DefaultSupportQueueID.Value.ToString();
                    }
                    chkHasRSSFeed.Checked = forum.HasRSSFeed;
                    cbxThreadListInterval.SelectedValue  = forum.DefaultThreadListInterval.ToString();
                    tbxMaxAttachmentSize.Text            = forum.MaxAttachmentSize.ToString();
                    tbxMaxNoOfAttachmentsPerMessage.Text = forum.MaxNoOfAttachmentsPerMessage.ToString();

                    if (forum.NewThreadWelcomeText != null)
                    {
                        tbxNewThreadWelcomeText.Text = forum.NewThreadWelcomeText;
                    }
                }
                else
                {
                    // not found
                    Response.Redirect("Default.aspx", true);
                }
            }
        }