Exemple #1
0
        /// <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="T:System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!UserManager.IsSuperUser())
            {
                Response.Redirect("~/Errors/AccessDenied.aspx");
            }

            _menuItems.Add(GetLocalResourceObject("Basic").ToString(), "page_white_gear.png");
            _menuItems.Add(GetLocalResourceObject("Authentication").ToString(), "lock.gif");
            _menuItems.Add(GetLocalResourceObject("Mail").ToString(), "email.gif");
            _menuItems.Add(GetLocalResourceObject("Logging").ToString(), "page_white_error.png");
            _menuItems.Add(GetLocalResourceObject("Subversion").ToString(), "svnLogo_sm.jpg");
            _menuItems.Add(GetLocalResourceObject("Notifications").ToString(), "email_go.gif");
            _menuItems.Add(GetLocalResourceObject("Attachments").ToString(), "attach.gif");
            _menuItems.Add(GetLocalResourceObject("POP3Mailbox").ToString(), "mailbox.png");
            _menuItems.Add(GetLocalResourceObject("Languages").ToString(), "page_white_world.png");
            _menuItems.Add(GetLocalResourceObject("UserCustomFields").ToString(), "user_edit.gif");

            AdminMenu.DataSource = _menuItems;
            AdminMenu.DataBind();

            if (!IsPostBack)
            {
                string tabIdStr = Request.QueryString["tid"];
                if (!String.IsNullOrEmpty(tabIdStr))
                {
                    int  result = 0;
                    bool flag   = Int32.TryParse(tabIdStr, out result);
                    if (flag && result >= 0 && result <= 8)
                    {
                        TabId = result;
                    }
                }
            }

            if (TabId != -1)
            {
                LoadTab(TabId);
            }
        }
Exemple #2
0
        void LoadAdminMenuItems()
        {
            MenuItems.Clear();

            MenuItems.Add(new AdminMenuItem {
                Id = 0, Text = GetLocalResourceObject("UserDetails").ToString(), Argument = "UserDetails", ImageUrl = "vcard.gif"
            });
            MenuItems.Add(new AdminMenuItem {
                Id = 1, Text = GetLocalResourceObject("UserRoles").ToString(), Argument = "UserRoles", ImageUrl = "shield.gif"
            });
            MenuItems.Add(new AdminMenuItem {
                Id = 2, Text = GetLocalResourceObject("UserPassword").ToString(), Argument = "UserPassword", ImageUrl = "key.gif"
            });
            MenuItems.Add(new AdminMenuItem {
                Id = 3, Text = GetLocalResourceObject("UserProfile").ToString(), Argument = "UserProfile", ImageUrl = "user.gif"
            });
            MenuItems.Add(new AdminMenuItem {
                Id = 4, Text = GetLocalResourceObject("UserDelete").ToString(), Argument = "UserDelete", ImageUrl = "user_delete.gif"
            });

            AdminMenu.DataSource = MenuItems;
            AdminMenu.DataBind();
        }
Exemple #3
0
        /// <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>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                IList <string> segments = Request.GetFriendlyUrlSegments();
                ProjectId = Int32.Parse(segments[0]);
            }
            catch
            {
                ProjectId = Request.QueryString.Get("pid", 0);
            }

            if (!UserManager.IsSuperUser())
            {
                if (!UserManager.HasPermission(ProjectId, Permission.AdminEditProject.ToString()))
                {
                    Response.Redirect("~/Errors/AccessDenied");
                }
            }

            if (!Page.IsPostBack)
            {
                litProjectName.Text         = ProjectManager.GetById(ProjectId).Name;
                lblExistingProjectName.Text = litProjectName.Text;

                var message = string.Format(GetLocalResourceObject("ConfirmDelete").ToString(), litProjectName.Text);
                DeleteButton.OnClientClick = String.Format("return confirm('{0}');", message);

                if (!UserManager.HasPermission(ProjectId, Permission.AdminDeleteProject.ToString()))
                {
                    DeleteButton.Visible = false;
                }

                if (!UserManager.HasPermission(ProjectId, Permission.AdminCloneProject.ToString()))
                {
                    linkCloneProject.Visible = false;
                }
            }

            _menuItems.Add(GetLocalResourceObject("Details").ToString(), "application_home.png");
            _menuItems.Add(GetLocalResourceObject("Categories").ToString(), "plugin.gif");
            _menuItems.Add(GetLocalResourceObject("Status").ToString(), "greencircle.png");
            _menuItems.Add(GetLocalResourceObject("Priorities").ToString(), "Critical.gif");
            _menuItems.Add(GetLocalResourceObject("Milestones").ToString(), "package.gif");
            _menuItems.Add(GetLocalResourceObject("IssueTypes").ToString(), "bug.gif");
            _menuItems.Add(GetLocalResourceObject("Resolutions").ToString(), "accept.gif");
            _menuItems.Add(GetLocalResourceObject("Members").ToString(), "users_group.png");
            _menuItems.Add(GetLocalResourceObject("SecurityRoles").ToString(), "shield.gif");
            _menuItems.Add(GetLocalResourceObject("Notifications").ToString(), "email_go.gif");
            _menuItems.Add(GetLocalResourceObject("CustomFields").ToString(), "textfield.gif");
            _menuItems.Add(GetLocalResourceObject("Mailboxes").ToString(), "email.gif");
            _menuItems.Add(GetLocalResourceObject("Subversion").ToString(), "svnLogo_sm.jpg");
            _menuItems.Add(GetLocalResourceObject("Defaults").ToString(), "Default.png");

            AdminMenu.DataSource = _menuItems;
            AdminMenu.DataBind();

            if (TabId != -1)
            {
                LoadTab(TabId);
            }
        }