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

            if (!Page.IsPostBack)
            {
                // bind the Roles repeater to a dataview with all sections.
                DataView rolesWithStatistics = SecurityGuiHelper.GetAllRolesWithStatisticsAsDataView();

                rpRoles.DataSource = rolesWithStatistics;
                rpRoles.DataBind();
            }
        }
コード例 #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
            bool hasAccess = SessionAdapter.HasSystemActionRight(ActionRights.SystemManagement);

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

            if (!Page.IsPostBack)
            {
                cldStartDate.SelectedDate = DateTime.Now;
                cldStartDate.VisibleDate  = DateTime.Now;
            }
        }
コード例 #3
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.SecurityManagement))
            {
                // 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)
                {
                    lblRoleDescription.Text = role.RoleDescription;
                }
            }
        }
コード例 #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
            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)
            {
                // Read all the current existing forums and their section names.
                ForumsWithSectionNameTypedList forumsWithSectionNames = ForumGuiHelper.GetAllForumsWithSectionNames();
                rpForums.DataSource = forumsWithSectionNames;
                rpForums.DataBind();
            }
        }
コード例 #5
0
ファイル: SendEmail.aspx.cs プロジェクト: priaonehaha/HnD
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        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 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);
            }

            if (Page.IsPostBack)
            {
                GetViewState();
                SetToNames();
            }
            else
            {
                SetViewState();
            }
        }
コード例 #6
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.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();
            }
        }
コード例 #7
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.SecurityManagement))
            {
                // 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);
                _roleDescription = role.RoleDescription;

                // bind the users listbox to an entitycollection with all users.
                UserCollection users = UserGuiHelper.GetAllUsersNotInRole(_roleID);

                lbxUsers.DataSource     = users;
                lbxUsers.DataTextField  = "NickName";
                lbxUsers.DataValueField = "UserID";
                lbxUsers.DataBind();
            }
        }
コード例 #8
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);
            }
        }
コード例 #9
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);
     }
 }
コード例 #10
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.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);
            }
        }
コード例 #11
0
ファイル: DeleteSection.aspx.cs プロジェクト: priaonehaha/HnD
        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)
            {
                // Get the section directly from the DB, instead from the in-memory cache
                SectionEntity section = SectionGuiHelper.GetSection(_sectionID);

                // Show results in the labels
                if (section != null)
                {
                    // Section found
                    // Get the forums in the section
                    ForumCollection forums = ForumGuiHelper.GetAllForumsInSection(_sectionID);
                    if (forums.Count > 0)
                    {
                        // section has forums. User is not able to delete the section. Show error message plus
                        // disable delete button
                        lblRuleError.Visible = true;
                        btnDelete.Disabled   = true;
                    }
                    lblSectionName.Text        = section.SectionName;
                    lblSectionDescription.Text = section.SectionDescription;
                }
                else
                {
                    // the section doesn't exist anymore
                    Response.Redirect("ModifyDeleteSection.aspx", true);
                }
            }
        }
コード例 #12
0
ファイル: DeleteForum.aspx.cs プロジェクト: priaonehaha/HnD
        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)
            {
                // Get the forum
                try
                {
                    ForumEntity forum = ForumGuiHelper.GetForum(_forumID);

                    // Show results in the labels
                    if (forum != null)
                    {
                        // the forum exists
                        lblForumName.Text        = forum.ForumName;
                        lblForumDescription.Text = forum.ForumDescription;
                    }
                    else
                    {
                        // the forum doesn't exist anymore
                        Response.Redirect("ModifyDeleteForum.aspx", true);
                    }
                }
                catch (Exception ex)
                {
                    // Bubble
                    throw ex;
                }
            }
        }
コード例 #13
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.SecurityManagement))
            {
                // 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 != null)
                {
                    tbxRoleDescription.Text = role.RoleDescription;
                }

                // get the system rights
                ActionRightCollection systemActionRights = SecurityGuiHelper.GetAllSystemActionRights();

                cblSystemRights.DataSource     = systemActionRights;
                cblSystemRights.DataTextField  = "ActionRightDescription";
                cblSystemRights.DataValueField = "ActionRightID";
                cblSystemRights.DataBind();

                // get the action rights set for this role
                RoleSystemActionRightCollection systemActionRightRoleCombinations = SecurityGuiHelper.GetSystemActionRightRolesForRole(_roleID);

                // check the checkboxes in the cblSystemRights list if the value matches a row in the datatable
                foreach (RoleSystemActionRightEntity currentEntity in systemActionRightRoleCombinations)
                {
                    cblSystemRights.Items.FindByValue(currentEntity.ActionRightID.ToString()).Selected = true;
                }
            }
        }
コード例 #14
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.SystemManagement);

            if (!userHasAccess)
            {
                // no, redirect to admin default page, since the user HAS access to the admin menu.
                Response.Redirect("Default.aspx", true);
            }
        }
コード例 #15
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);
                }
            }
        }
コード例 #16
0
ファイル: ManageIPBans.aspx.cs プロジェクト: priaonehaha/HnD
        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");
        }
コード例 #17
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);
            }
        }
コード例 #18
0
ファイル: ModifyForum.aspx.cs プロジェクト: priaonehaha/HnD
        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);
                }
            }
        }