Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // Sueetie Modified - Adding Compressed theme/style.css and Sueetie Theme stylesheets

                Page.Header.Controls.Add(SueetieBlogUtils.AddBlogEngineThemeCSS());
                Page.Header.Controls.Add(MakeStyleSheetControl("/themes/" + this.CurrentTheme + "/style/shared.css"));
                Page.Header.Controls.Add(MakeStyleSheetControl("/themes/" + this.CurrentTheme + "/style/blogs.css"));
                Page.Header.Controls.Add(MakeStyleSheetControl("/themes/" + this.CurrentTheme + "/style/contact.css"));
                Page.Header.Controls.Add(new LiteralControl("<!--[if IE]><link rel=\"stylesheet\" href=\"/themes/" + this.CurrentTheme + "/style/ie.css\" type=\"text/css\" /><![endif]-->"));


                MembershipUser user = Membership.GetUser();

                UserLink.Text        = "Welcome, Guest!";
                UserLink.NavigateUrl = "/members/login.aspx";
                if (Page.User.Identity.IsAuthenticated)
                {
                    string _displayName = SueetieUsers.GetUserDisplayName(SueetieContext.Current.User.UserID, false);

                    if (SueetieConfiguration.Get().Core.UseForumProfile)
                    {
                        UserLink.NavigateUrl = SueetieUrls.Instance.MasterAccountInfo().Url;
                    }
                    else
                    {
                        UserLink.NavigateUrl = SueetieUrls.Instance.MyAccountInfo().Url;
                    }

                    UserLink.Text = string.Format(SueetieLocalizer.GetString("link_greetings_member"), _displayName);
                }
            }
        }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.IsPostBack)
     {
         this.Page.Header.Controls.Add(AddMetaTag("CommunityFramework", SiteStatistics.Instance.SueetieVersion));
         this.Page.Header.Controls.Add(SueetieBlogUtils.AddBlogEngineThemeCSS());
         this.Page.Header.Controls.Add(MakeStyleSheetControl("/themes/" + this.CurrentTheme + "/style/shared.css"));
         this.Page.Header.Controls.Add(MakeStyleSheetControl("/themes/" + this.CurrentTheme + "/style/blogs.css"));
         this.Page.Header.Controls.Add(new LiteralControl("<!--[if IE]><link rel=\"stylesheet\" href=\"/themes/" + this.CurrentTheme + "/style/ie.css\" type=\"text/css\" /><![endif]-->"));
     }
 }
Esempio n. 3
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            string _theme       = txtTheme.Text.ToLower().Trim();
            string _mobileTheme = txtMobileTheme.Text.ToLower().Trim();

            // Update Application and Group Themes
            // Each theme has to have an associated blog theme

            foreach (SueetieApplication _sueetieApplication in SueetieApplications.Get().All)
            {
                if (_sueetieApplication.ApplicationTypeID == (int)SueetieApplicationType.Blog && _sueetieApplication.GroupID == 0)
                {
                    try
                    {
                        SueetieBlogUtils.UpdateBlogTheme(_sueetieApplication.ApplicationKey, _theme);
                    }
                    catch (Exception ex)
                    {
                        SueetieLogs.LogException("Blog Theme Update Error: " + ex.Message + " Stacktrace: " + ex.StackTrace);
                    }
                }
            }
            SueetieForums.UpdateForumTheme(_theme);
            WikiThemes.UpdateWikiTheme(SueetieApplications.Get().Wiki.ApplicationKey, _theme);

            //// Update BlogEngine Group Themes - Will add to SueetieApplications logic
            // SueetieBlogUtils.UpdateBlogTheme("groups/demo/blog", _theme);
            // WikiThemes.UpdateWikiTheme("groups/demo/wiki", _theme);

            SueetieCommon.UpdateSiteSetting(new SiteSetting("Theme", _theme));
            SueetieCommon.UpdateSiteSetting(new SiteSetting("MobileTheme", _mobileTheme));

            if (SueetieUIHelper.GetCurrentTrustLevel() >= AspNetHostingPermissionLevel.High)
            {
                HttpRuntime.UnloadAppDomain();
            }
            else
            {
                SueetieLogs.LogException("Unable to restart Sueetie. Must have High/Unrestricted Trust to Unload Application.");
            }

            lblResults.Visible        = true;
            lblResults.Text           = "Current Themes updated!";
            lblResultsDetails.Visible = true;
            lblResultsDetails.Text    = "New application themes may not appear right away. Touch web.configs to restart the app if this is the case.";
        }
Esempio n. 4
0
    public string CreateBlogAdmin(string _userIDs)
    {
        string[] userIDs   = _userIDs.Split(',');
        string   newadmins = string.Empty;

        foreach (string userID in userIDs)
        {
            if (!string.IsNullOrEmpty(userID))
            {
                SueetieUser sueetieUser = SueetieUsers.GetUser(Convert.ToInt32(userID));
                SueetieBlogs.CreateBlogAdmin(sueetieUser);
                SueetieBlogUtils.CreateProfile(sueetieUser, "blog");
                if (!sueetieUser.IsBlogAdministrator)
                {
                    Roles.AddUserToRole(sueetieUser.UserName, "BlogAdministrator");
                }
                newadmins += sueetieUser.DisplayName + ",";
            }
        }

        return("The following are now site blog administrators: " + DataHelper.CommaTrim(newadmins));
    }