private void LoadSettings()
        {
            if ((WebUser.IsInRole("SfaManagers")) || (WebUser.IsInRole("sfaContentsAdmins")) ||
                (WebUser.IsAdmin))
            {
                this.canAdministrate = true;
            }
            else
            {
                this.canAdministrate = false;
            }

            SecurityHelper.DisableBrowserCache();

            AddClassToBody("administration");
            AddClassToBody("advtools");



            // Get the Current Loged on UserID
            SiteUser siteUser = SiteUtils.GetCurrentSiteUser();

            this.currUserID = siteUser.UserId;
            if (this.currUserID == -1)
            {
                return;
            }
            this.currUserFullName = GetUserFullName(this.currUserID);
        }
Esempio n. 2
0
        private void PopulateLabels()
        {
            Title = SiteUtils.FormatPageTitle(siteSettings, Resources.iQuranResources.AdminMenuiQuranManagerAdminLink);
            spnTitle.InnerText = Title;

            lnkAdminMenu.Text        = Resource.AdminMenuLink;
            lnkAdminMenu.ToolTip     = Resource.AdminMenuLink;
            lnkAdminMenu.NavigateUrl = SiteRoot + "/Admin/AdminMenu.aspx";

            lnkAdvanced.Text        = Resources.iQuranResources.AdvancedLink;
            lnkAdvanced.ToolTip     = Resources.iQuranResources.AdvancedToolsHeading;
            lnkAdvanced.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuranAdvanced.aspx";

            lnkiQuranManagerAdmin.Text        = Resources.iQuranResources.AdminMenuiQuranManagerAdminLink;
            lnkiQuranManagerAdmin.ToolTip     = Resources.iQuranResources.AdminMenuiQuranManagerAdminLink;
            lnkiQuranManagerAdmin.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuran/iQuranManager.aspx";

            lnkAddNew.Text        = Resources.iQuranResources.AddNewiQuranHeader;
            lnkAddNew.ToolTip     = Resources.iQuranResources.AddNewiQuranHeader;
            lnkAddNew.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuran/iQuranEdit.aspx";

            lnkAddNew.Visible = (WebUser.IsInRole("iQuranManagers")) || (WebUser.IsAdmin);

            btnSearchTitle.AlternateText = Resources.iQuranResources.SearchByTitleHeader;
            btnSearchTitle.ToolTip       = Resources.iQuranResources.SearchByTitleHeader;

            lblmessage.Visible = false;
            divMsg.Visible     = false;
        }
Esempio n. 3
0
        private void BindGrid()
        {
            bool isAdmin = ((WebUser.IsInRole("iQuranManagers")) || (WebUser.IsInRole("iQuranContentsAdmins")) || (WebUser.IsAdmin));
            // Get the Current Loged on UserID
            SiteUser siteUser = SiteUtils.GetCurrentSiteUser();
            int      userID   = siteUser.UserId;

            List <Quran> dataList = new List <Quran>();


            //0: all ,    1.active  ,     2.notactive  ,


            if (this.BindByWhat == "all")
            {
                dataList = Quran.GetPage_iQuran_All(false, siteSettings.SiteId, isAdmin, pageNumber, pageSize, out totalPages);
            }

            //Search For Title
            if (this.BindByWhat == "title")
            {
                dataList = Quran.GetPage_iQuran_ByTitle(false, siteSettings.SiteId, isAdmin, this.searchTitle, pageNumber, pageSize, out totalPages);
            }

            if ((this.BindByWhat == "active") || (this.BindByWhat == "notactive"))
            {
                dataList = Quran.GetPage_iQuran_ByActive(false, siteSettings.SiteId, searchIsActive, pageNumber, pageSize, out totalPages);
            }


            string pageUrl = string.Empty;

            pageUrl = SiteRoot
                      + "/Admin/AccessQuran/iQuran/iQuranManager.aspx?"
                      + "sort=" + this.sort
                      + "&amp;search=" + this.search
                      + "&amp;searchtitle=" + Server.UrlEncode(this.searchTitle)
                      + "&amp;pagenumber={0}";

            amsPager.PageURLFormat = pageUrl;
            amsPager.ShowFirstLast = true;
            amsPager.CurrentIndex  = pageNumber;
            amsPager.PageSize      = pageSize;
            amsPager.PageCount     = totalPages;
            amsPager.Visible       = (totalPages > 1);

            iQGrid.DataSource = dataList;
            iQGrid.PageIndex  = pageNumber;
            iQGrid.PageSize   = pageSize;
            iQGrid.DataBind();

            if (iQGrid.Rows.Count == 0)
            {
                lblmessage.Visible = true;
                divMsg.Visible     = true;
                lblmessage.Text    = Resources.iQuranMessagesResources.NoDataYet;
            }
        }
Esempio n. 4
0
        private bool ShouldAdd(mojoSiteMapNode mapNode)
        {
            if (mapNode == null)
            {
                return(false);
            }

            bool remove = false;

            if (mapNode.Roles == null)
            {
                if ((!isAdmin) && (!isContentAdmin) && (!isSiteEditor))
                {
                    remove = true;
                }
            }
            else
            {
                if ((!isAdmin) && (mapNode.Roles.Count == 1) && (mapNode.Roles[0].ToString() == "Admins"))
                {
                    remove = true;
                }

                if ((!isAdmin) && (!isContentAdmin) && (!isSiteEditor) && (!WebUser.IsInRoles(mapNode.Roles)))
                {
                    remove = true;
                }
            }

            if ((!isAdmin) && (!isContentAdmin) && (!isSiteEditor) && (!WebUser.IsInRoles(mapNode.ViewRoles)))
            {
                remove = true;
            }


            if (!mapNode.IncludeInMenu)
            {
                remove = true;
            }

            if (mapNode.IsPending && !WebUser.IsAdminOrContentAdminOrContentPublisherOrContentAuthor)
            {
                remove = true;
            }

            if ((mapNode.HideAfterLogin) && (WebUser.IsInRole("Authenticated")))
            {
                remove = true;
            }

            { return(!remove); }
        }
Esempio n. 5
0
        private void LoadSettings()
        {
            if ((WebUser.IsInRole("iQuranManagers")) || (WebUser.IsInRole("iQuranContentsAdmins")) || (WebUser.IsAdmin))
            {
                this.canAdministrate = true;
            }
            else
            {
                this.canAdministrate = false;
            }

            if (WebUser.IsAdmin)
            {
                IsUserAdmin = true;
            }

            SecurityHelper.DisableBrowserCache();

            lnkAdminMenu.Visible = (WebUser.IsAdmin);

            AddClassToBody("administration");
            AddClassToBody("rolemanager");
        }
        private void PopulateLabels()
        {
            Control c = Master.FindControl("Breadcrumbs");

            if (c != null)
            {
                BreadcrumbsControl crumbs = (BreadcrumbsControl)c;
                crumbs.ForceShowBreadcrumbs = true;
            }

            Title        = SiteUtils.FormatPageTitle(siteSettings, iQuranResources.AdvancedToolsHeading);
            heading.Text = iQuranResources.AdvancedToolsHeading;

            lnkAdminMenu.Text        = Resource.AdminMenuLink;
            lnkAdminMenu.ToolTip     = Resource.AdminMenuLink;
            lnkAdminMenu.NavigateUrl = SiteRoot + "/Admin/AdminMenu.aspx";

            if (!WebUser.IsAdmin)
            {
                lnkAdminMenu.Visible = false;
            }

            //Admins;iQuranManagers;iQuranContentsAdmins
            if ((WebUser.IsInRole("iQuranManagers")) || (WebUser.IsInRole("iQuranContentsAdmins")) || (WebUser.IsAdmin))
            {
                liiQuranManager.Visible      = true;
                lnkiQuranManager.Text        = iQuranResources.AdminMenuiQuranManagerAdminLink;
                lnkiQuranManager.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuran/iQuranManager.aspx";

                liiSuraManager.Visible      = true;
                lnkiSuraManager.Text        = iQuranResources.AdminMenuiSuraManagerAdminLink;
                lnkiSuraManager.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuran/iSuraManager.aspx";

                liiVerseManager.Visible      = true;
                lnkiVerseManager.Text        = iQuranResources.AdminMenuiVerseManagerAdminLink;
                lnkiVerseManager.NavigateUrl = SiteRoot + "/Admin/AccessQuran/iQuran/iVerseManager.aspx";
            }

            //if ((WebUser.IsInRole("uhsRfpManagers")) || (WebUser.IsAdmin))
            //{
            //	liCreateRFP.Visible = true;
            //	lnkCreateRFP.Text = SfaAdminResource.CreateRfp;
            //	lnkCreateRFP.NavigateUrl = SiteRoot + "/Admin/UHSRFP/RFP/RfpInitiate.aspx";

            //}


            //if ((WebUser.IsInRole("uhsRfpManagers")) || (WebUser.IsInRole("uhsRfpReviewers")) || (WebUser.IsAdmin))
            //{
            //	liRFPManager.Visible = true;
            //	lnkRFPManager.Text = AdminResource.AdminMenuRFPManagerAdminLink;
            //	lnkRFPManager.NavigateUrl = SiteRoot + "/Admin/UHSRFP/RFP/RfpManager.aspx";

            //}

            //if (WebUser.IsAdmin)
            //{
            //	liProposalReportsManager.Visible = true;
            //	lnkProposalReportsManager.Text = AdminResource.ProposalReportsManagerAdminLink;
            //	lnkProposalReportsManager.NavigateUrl = SiteRoot + "/Admin/UHSRFP/Reports/ProposalReportsManager.aspx";

            //	liRfpReportsManager.Visible = true;
            //	lnkRfpReportsManager.Text = AdminResource.RfpReportsManagerAdminLink;
            //	lnkRfpReportsManager.NavigateUrl = SiteRoot + "/Admin/UHSRFP/Reports/RfpReportsManager.aspx";
            //}

            //

            heading.Text = Resources.iQuranResources.AdvancedToolsHeading;
        }