コード例 #1
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (SiteUtils.SslIsAvailable())
            {
                if ((WebConfigSettings.UseSslForMemberList) || (siteSettings.UseSslOnAllPages))
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            LoadSettings();
            PopulateLabels();

            if (!allowView)
            {
                WebUtils.SetupRedirect(this, SiteRoot + "/Default.aspx");
                return;
            }

            if (!IsPostBack)
            {
                PopulateControls();
            }
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            if (!Request.IsAuthenticated)
            {
                SiteUtils.RedirectToLoginPage(this);
                return;
            }

            SecurityHelper.DisableBrowserCache();

            LoadSettings();

            if (!UserCanEditModule(moduleId, Blog.FeatureGuid))
            {
                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            PopulateLabels();
            PopulateControls();
        }
コード例 #3
0
        private void EnforceSecuritySettings()
        {
            if (CurrentPage.PageId == -1)
            {
                return;
            }

            if (!CurrentPage.AllowBrowserCache)
            {
                SecurityHelper.DisableBrowserCache();
            }

            bool useSsl = false;

            if (SiteUtils.SslIsAvailable())
            {
                if (WebConfigSettings.ForceSslOnAllPages || siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl)
                {
                    useSsl = true;
                }
            }

            if (useSsl)
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
        }
コード例 #4
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load            += new EventHandler(this.Page_Load);
            this.btnUpdate.Click += new EventHandler(this.btnUpdate_Click);
            //this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnDelete.Click += new EventHandler(this.btnDelete_Click);

            SecurityHelper.DisableBrowserCache();


            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            SiteUtils.SetupEditor(edMessage, AllowSkinOverride, this);
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadSettings();
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            if (
                (!userCanEdit) ||
                (commentGuid == Guid.Empty) || (blog == null))
            {
                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            PopulateLabels();

            if (!IsPostBack)
            {
                PopulateControls();
            }
        }
コード例 #6
0
        private void Page_Load(object sender, EventArgs e)
        {
            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            isSiteEditor = SiteUtils.UserIsSiteEditor();


            if (WebUser.IsAdminOrContentAdmin || isSiteEditor || WebUser.IsInRoles(CurrentPage.EditRoles))
            {
                UserCanEdit = true;
            }

            LoadParams();
            showUserRevenue = (WebConfigSettings.ShowRevenueInGroups && isCommerceReportViewer);

            if (!UserCanViewPage(moduleId))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this);
                }
                else
                {
                    SiteUtils.RedirectToAccessDeniedPage(this);
                }
                return;
            }

            if (Page.IsPostBack)
            {
                return;
            }

            PopulateLabels();

            if ((Request.IsAuthenticated) && (currentUser == null))
            {
                currentUser = SiteUtils.GetCurrentSiteUser();
            }

            AddConnoicalUrl();
            SetupCss();

            //EditAltText = Resource.EditImageAltText;

            PopulateControls();
        }
コード例 #7
0
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load            += new EventHandler(this.Page_Load);
            this.btnUpdate.Click += new EventHandler(this.btnUpdate_Click);
            //this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnDelete.Click += new EventHandler(this.btnDelete_Click);

            SecurityHelper.DisableBrowserCache();
            isSiteEditor = SiteUtils.UserIsSiteEditor();

            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            LoadSettings();

            if (groupId > -1)
            {
                group    = new Group(groupId);
                moduleId = group.ModuleId;
                if (group.ItemId == -1)
                {
                    Response.Redirect(siteSettings.SiteRoot);
                }
                if (!group.AllowAnonymousPosts)
                {
                    if (!Request.IsAuthenticated)
                    {
                        SiteUtils.RedirectToLoginPage(this);
                        return;
                    }

                    pnlAntiSpam.Visible = false;
                    pnlEdit.Controls.Remove(pnlAntiSpam);
                }
                else
                {
                    if ((!useSpamBlockingForAnonymous) || (Request.IsAuthenticated))
                    {
                        pnlAntiSpam.Visible = false;
                        pnlEdit.Controls.Remove(pnlAntiSpam);
                    }
                }
            }
        }
コード例 #8
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsBlogSection", "blog");

            LoadParams();



            if (!UserCanViewPage(moduleId, Blog.FeatureGuid))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this, Request.RawUrl);
                    return;
                }

                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            LoadSettings();

            DateTime selectedMonth = new DateTime(Year, Month, 1, CultureInfo.CurrentCulture.Calendar);

            try
            {
                selectedMonth = new DateTime(Year, Month, 1, CultureInfo.CurrentCulture.Calendar);
            }
            catch (Exception)
            { }

            heading.Text = Page.Server.HtmlEncode(BlogResources.BlogArchivesPrefixLabel
                                                  + selectedMonth.ToString("MMMM, yyyy"));

            if (blogModule != null)
            {
                Title = SiteUtils.FormatPageTitle(SiteInfo, blogModule.ModuleTitle + " - " + BlogResources.BlogArchivesPrefixLabel
                                                  + selectedMonth.ToString("MMMM, yyyy"));

                MetaDescription = string.Format(CultureInfo.InvariantCulture,
                                                BlogResources.ArchiveMetaDescriptionFormat,
                                                blogModule.ModuleTitle,
                                                selectedMonth.ToString("MMMM, yyyy"));
            }
        }
コード例 #9
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }

            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            LoadParams();

            if (!UserCanViewPage(ModuleId))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this);
                    return;
                }
                else
                {
                    SiteUtils.RedirectToAccessDeniedPage(this);
                    return;
                }
            }

            SetupCss();
            PopulateLabels();

            GetModuleSettings();
#if MONO
            this.rptGroups.DataBind();
#else
            this.DataBind();
#endif
            PopulateControls();
        }
コード例 #10
0
        //private int moduleId = -1;

        private void Page_Load(object sender, EventArgs e)
        {
            //moduleId = WebUtils.ParseInt32FromQueryString("mid", -1);
            //pnlContainer.ModuleId = moduleId;
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0))
            {
                AddClassToBody(CurrentPage.BodyCssClass);
            }

            AddClassToBody("blogviewpost");
        }
コード例 #11
0
        private void Page_Load(object sender, EventArgs e)
        {
            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            SecurityHelper.DisableBrowserCache();

            LoadSettings();

            if (!UserCanViewPage(moduleId, Forum.FeatureGuid))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this);
                }
                else
                {
                    SiteUtils.RedirectToAccessDeniedPage(this);
                }
                return;
            }
            //can't edit subscription without being signed in
            if (!Request.IsAuthenticated)
            {
                WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());
                return;
            }

            PopulateLabels();

            AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums");
        }
コード例 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            LoadParams();

            if (!UserCanViewPage(moduleId))
            {
                SiteUtils.RedirectToAccessDeniedPage();
                return;
            }

            LoadSettings();
            PopulateControls();
        }
コード例 #13
0
        //private int timeToLive = -1;


        protected void Page_Load(object sender, System.EventArgs e)
        {
            // nothing should post here
            if (Page.IsPostBack)
            {
                return;
            }

            LoadSettings();

            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || pageSettings.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }


            if (canView)
            {
                if (shouldRedirectToFeedburner)
                {
                    Response.Redirect(config.FeedburnerFeedUrl, true);
                }
                else
                {
                    RenderRss();
                }
            }
            else
            {
                RenderError("Invalid Request");
            }
        }
コード例 #14
0
ファイル: Thread.aspx.cs プロジェクト: pierreshiny/mojoportal
        private void Page_Load(object sender, EventArgs e)
        {
            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            LoadParams();

            if (!threadParams.ParamsAreValid)
            {
                WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());
                return;
            }

            if (!UserCanViewPage(moduleId, Forum.FeatureGuid))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this);
                }
                else
                {
                    SiteUtils.RedirectToAccessDeniedPage(this);
                }
                return;
            }

            LoadSettings();
            PopulateLabels();

            if (Page.IsPostBack)
            {
                return;
            }

            AddConnoicalUrl();
            PopulateControls();

            if (UserCanEditModule(moduleId, Forum.FeatureGuid))
            {
                heading.LiteralExtraMarkup = "&nbsp;<a href='"
                                             + SiteRoot
                                             + "/Forums/EditThread.aspx?pageid=" + PageId.ToInvariantString()
                                             + "&amp;mid=" + moduleId.ToInvariantString()
                                             + "&amp;thread=" + threadId.ToInvariantString()
                                             + "' class='ModuleEditLink'>" + ForumResources.ForumThreadEditLabel + "</a>";
            }

            AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums");

            LoadSideContent(config.ShowLeftContent, config.ShowRightContent);
            LoadAltContent(ForumConfiguration.ShowTopContent, ForumConfiguration.ShowBottomContent);
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((SiteUtils.SslIsAvailable()) && (WebConfigSettings.UseSslForMyPage))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }

            if (!siteSettings.EnableMyPageFeature)
            {
                allowView = false;
            }

            if (!WebUser.IsInRoles(siteSettings.RolesThatCanViewMyPage))
            {
                allowView = false;
            }

            if (!allowView)
            {
                SiteUtils.RedirectToAccessDeniedPage();
                return;
            }


            //WebPartManager1 = WebPartManager.GetCurrentWebPartManager(Page);

            if (Request.IsAuthenticated)
            {
                currentUser = SiteUtils.GetCurrentSiteUser();

                isAutheticated = true;
                if (WebUser.IsAdminOrContentAdmin)
                {
                    isAdmin = true;
                }
                isSiteEditor = SiteUtils.UserIsSiteEditor();
            }

            SetupCss();
            EnsureUserPage();
            PopulateLabels();

            if (Request.IsAuthenticated)
            {
                // TODO: to support anonymous session
                // personalization need to figure out how thy are doing it
                // at pageflakes to enable edit mode when unauthenticated
                if (!IsPostBack)
                {
                    BindUserMenu();
                    WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode;

                    // I don't want the zone titles to display unless
                    // in catalog view. If set to String.Emtpy it doesn't
                    // make them blank but shows the server side id instead
                    // setting to a space works for clearing it
                    LeftWebPartZone.HeaderText   = " ";
                    CenterWebPartZone.HeaderText = " ";
                    RightWebPartZone.HeaderText  = " ";
                    CatalogZone1.HeaderText      = " ";
                }
            }

            if (!IsPostBack)
            {
                this.pnlAddPage.Visible    = false;
                this.pnlChangeName.Visible = false;
            }
        }
コード例 #16
0
        private void Page_Load(object sender, EventArgs e)
        {
            if (SiteUtils.SslIsAvailable() && (siteSettings.UseSslOnAllPages || CurrentPage.RequireSsl))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }
            LoadParams();

            if (!UserCanViewPage(moduleId, Blog.FeatureGuid))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this, Request.RawUrl);
                    return;
                }

                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            LoadSettings();


            if (!IsPostBack)
            {
                if ((moduleId > -1) && (categoryId > -1))
                {
                    using (IDataReader reader = Blog.GetCategory(categoryId))
                    {
                        if (reader.Read())
                        {
                            this.category = reader["Category"].ToString();
                        }
                    }

                    string prefixLabel = BlogResources.BlogCategoriesPrefixLabel;
                    if (displaySettings.OverrideCategoryPrefixLabel.Length > 0)
                    {
                        prefixLabel = displaySettings.OverrideCategoryPrefixLabel;
                    }

                    heading.Text = Page.Server.HtmlEncode(prefixLabel + category);

                    if (blogModule != null)
                    {
                        Title = SiteUtils.FormatPageTitle(siteSettings,
                                                          blogModule.ModuleTitle + " - " + prefixLabel + category);

                        MetaDescription = string.Format(CultureInfo.InvariantCulture,
                                                        BlogResources.CategoryMetaDescriptionFormat,
                                                        blogModule.ModuleTitle, category);
                    }
                }
            }

            LoadSideContent(config.ShowLeftContent, config.ShowRightContent);
            LoadAltContent(BlogConfiguration.ShowTopContent, BlogConfiguration.ShowBottomContent);
            AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsBlogSection", "blog");
        }
コード例 #17
0
ファイル: ForumView.aspx.cs プロジェクト: wqshabib/mojoportal
        private void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                return;
            }

            if ((siteSettings != null) && (CurrentPage != null))
            {
                if ((SiteUtils.SslIsAvailable()) &&
                    ((siteSettings.UseSslOnAllPages) || (CurrentPage.RequireSsl))
                    )
                {
                    SiteUtils.ForceSsl();
                }
                else
                {
                    SiteUtils.ClearSsl();
                }
            }

            LoadParams();

            if ((forum == null) || (!forumParams.ParamsAreValid))
            {
                WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());
                return;
            }

            // if we get here then the module exists on the page and matches the forum module id
            // so check view permission
            if (!UserCanViewPage(ModuleId, Forum.FeatureGuid))
            {
                if (!Request.IsAuthenticated)
                {
                    SiteUtils.RedirectToLoginPage(this);
                    return;
                }
                else
                {
                    SiteUtils.RedirectToAccessDeniedPage(this);
                    return;
                }
            }
            //this page has no content other than links
            SiteUtils.AddNoIndexFollowMeta(Page);

            LoadSettings();

            if ((!forum.Visible) && (!userCanEdit))
            {
                SiteUtils.RedirectToAccessDeniedPage(this);
                return;
            }

            PopulateLabels();
            PopulateControls();

            AnalyticsSection = ConfigHelper.GetStringProperty("AnalyticsForumSection", "forums");


            LoadSideContent(config.ShowLeftContent, config.ShowRightContent);
            LoadAltContent(ForumConfiguration.ShowTopContent, ForumConfiguration.ShowBottomContent);
        }
コード例 #18
0
ファイル: SiteMap.aspx.cs プロジェクト: wqshabib/mojoportal
        protected void Page_Load(object sender, EventArgs e)
        {
            if ((SiteUtils.SslIsAvailable()) && ((WebConfigSettings.UseSslForSiteMap) || (siteSettings.UseSslOnAllPages)))
            {
                SiteUtils.ForceSsl();
            }
            else
            {
                SiteUtils.ClearSsl();
            }

            Title        = SiteUtils.FormatPageTitle(siteSettings, Resource.SiteMapLink);
            heading.Text = Resource.SiteMapLink;

            //this page has no content other than nav
            SiteUtils.AddNoIndexFollowMeta(Page);


            resolveFullUrlsForMenuItemProtocolDifferences = WebConfigSettings.ResolveFullUrlsForMenuItemProtocolDifferences;
            if (resolveFullUrlsForMenuItemProtocolDifferences)
            {
                secureSiteRoot   = WebUtils.GetSecureSiteRoot();
                insecureSiteRoot = secureSiteRoot.Replace("https", "http");
            }

            isSecureRequest = SiteUtils.IsSecureRequest();
            isMobileSkin    = SiteUtils.UseMobileSkin();
            isAdmin         = WebUser.IsAdmin;
            if (!isAdmin)
            {
                isContentAdmin = WebUser.IsContentAdmin;
            }
            if ((!isAdmin) && (!isContentAdmin))
            {
                isSiteEditor = SiteUtils.UserIsSiteEditor();
            }

            useMenuTooltipForCustomCss = StyleCombiner.UseMenuTooltipForCustomCss;

            MetaDescription = string.Format(CultureInfo.InvariantCulture,
                                            Resource.MetaDescriptionSiteMapFormat, siteSettings.SiteName);

            siteMapDataSource = (SiteMapDataSource)this.Page.Master.FindControl("SiteMapData");

            siteMapDataSource.SiteMapProvider = "mojosite" + siteSettings.SiteId.ToInvariantString();

            if (Request.Params["startnode"] != null)
            {
                string      startNode = Server.UrlDecode(Request.Params["startnode"]);
                SiteMapNode node
                    = siteMapDataSource.Provider.FindSiteMapNode(startNode);
                if (node != null)
                {
                    siteMapDataSource.StartingNodeUrl = startNode;
                }
            }

            useImagesInSiteMap = WebConfigSettings.UsePageImagesInSiteMap;

            AddClassToBody("sitemappage");


            RenderSiteMap();
        }