示例#1
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum));
                PageLinks.AddLink("Administration", YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.admin_admin));
                PageLinks.AddLink("Users", "");

                TimeZones.DataSource = YafStaticData.TimeZones();
                DataBind();
                TimeZones.Items.FindByValue("0").Selected = true;
            }
        }
示例#2
0
        private void BindData()
        {
            TimeZones.DataSource       = YafStaticData.TimeZones();
            ForumEditorList.DataSource = YAF.Editor.EditorHelper.GetEditorsTable();

            DataBind();

            // grab all the settings form the current board settings class
            SQLVersion.Text = PageContext.BoardSettings.SQLVersion;
            TimeZones.Items.FindByValue(PageContext.BoardSettings.TimeZoneRaw.ToString()).Selected       = true;
            ForumEditorList.Items.FindByValue(PageContext.BoardSettings.ForumEditor.ToString()).Selected = true;
            ForumEmailEdit.Text           = PageContext.BoardSettings.ForumEmail;
            EmailVerification.Checked     = PageContext.BoardSettings.EmailVerification;
            ShowMoved.Checked             = PageContext.BoardSettings.ShowMoved;
            BlankLinks.Checked            = PageContext.BoardSettings.BlankLinks;
            ShowGroupsX.Checked           = PageContext.BoardSettings.ShowGroups;
            AvatarWidth.Text              = PageContext.BoardSettings.AvatarWidth.ToString();
            AvatarHeight.Text             = PageContext.BoardSettings.AvatarHeight.ToString();
            AvatarUpload.Checked          = PageContext.BoardSettings.AvatarUpload;
            AvatarRemote.Checked          = PageContext.BoardSettings.AvatarRemote;
            AvatarSize.Text               = (PageContext.BoardSettings.AvatarSize != 0) ? PageContext.BoardSettings.AvatarSize.ToString() : "";
            AllowUserThemeX.Checked       = PageContext.BoardSettings.AllowUserTheme;
            AllowUserLanguageX.Checked    = PageContext.BoardSettings.AllowUserLanguage;
            UseFileTableX.Checked         = PageContext.BoardSettings.UseFileTable;
            ShowRSSLinkX.Checked          = PageContext.BoardSettings.ShowRSSLink;
            ShowForumJumpX.Checked        = PageContext.BoardSettings.ShowForumJump;
            AllowPrivateMessagesX.Checked = PageContext.BoardSettings.AllowPrivateMessages;
            AllowEmailSendingX.Checked    = PageContext.BoardSettings.AllowEmailSending;
            AllowSignaturesX.Checked      = PageContext.BoardSettings.AllowSignatures;
            RemoveNestedQuotesX.Checked   = PageContext.BoardSettings.RemoveNestedQuotes;
            MaxFileSize.Text              = (PageContext.BoardSettings.MaxFileSize != 0) ? PageContext.BoardSettings.MaxFileSize.ToString() : "";
            SmiliesColumns.Text           = PageContext.BoardSettings.SmiliesColumns.ToString();
            SmiliesPerRow.Text            = PageContext.BoardSettings.SmiliesPerRow.ToString();
            LockPosts.Text                 = PageContext.BoardSettings.LockPosts.ToString();
            PostsPerPage.Text              = PageContext.BoardSettings.PostsPerPage.ToString();
            TopicsPerPage.Text             = PageContext.BoardSettings.TopicsPerPage.ToString();
            DateFormatFromLanguage.Checked = PageContext.BoardSettings.DateFormatFromLanguage;
            AcceptedHTML.Text              = PageContext.BoardSettings.AcceptedHTML;
            DisableRegistrations.Checked   = PageContext.BoardSettings.DisableRegistrations;
            CreateNntpUsers.Checked        = PageContext.BoardSettings.CreateNntpUsers;
            ShowGroupsProfile.Checked      = PageContext.BoardSettings.ShowGroupsProfile;
            PostFloodDelay.Text            = PageContext.BoardSettings.PostFloodDelay.ToString();
            PollVoteTiedToIPX.Checked      = PageContext.BoardSettings.PollVoteTiedToIP;
            AllowPMNotifications.Checked   = PageContext.BoardSettings.AllowPMEmailNotification;
            ShowPageGenerationTime.Checked = PageContext.BoardSettings.ShowPageGenerationTime;
            AdPost.Text = PageContext.BoardSettings.AdPost;
            ShowAdsToSignedInUsers.Checked   = PageContext.BoardSettings.ShowAdsToSignedInUsers;
            DisplayPoints.Checked            = PageContext.BoardSettings.DisplayPoints;
            ShowQuickAnswerX.Checked         = PageContext.BoardSettings.ShowQuickAnswer;
            ShowDeletedMessages.Checked      = PageContext.BoardSettings.ShowDeletedMessages;
            ShowDeletedMessagesToAll.Checked = PageContext.BoardSettings.ShowDeletedMessagesToAll;
            EditTimeOut.Text                   = PageContext.BoardSettings.EditTimeOut.ToString();
            ShowYAFVersion.Checked             = PageContext.BoardSettings.ShowYAFVersion;
            UseNoFollowLinks.Checked           = PageContext.BoardSettings.UseNoFollowLinks;
            DisableNoFollowLinksAfterDay.Text  = PageContext.BoardSettings.DisableNoFollowLinksAfterDay.ToString();
            ShowRulesForRegistrationX.Checked  = PageContext.BoardSettings.ShowRulesForRegistration;
            ShowModeratorList.Checked          = PageContext.BoardSettings.ShowModeratorList;
            AllowLoginAndLogoff.Checked        = PageContext.BoardSettings.AllowLoginAndLogoff;
            DoUrlReferrerSecurityCheck.Checked = PageContext.BoardSettings.DoUrlReferrerSecurityCheck;

            // Ederon : 7/1/2007 added
            ShowBrowsingUsers.Checked = PageContext.BoardSettings.ShowBrowsingUsers;
            DisplayJoinDate.Checked   = PageContext.BoardSettings.DisplayJoinDate;
            ShowMedals.Checked        = PageContext.BoardSettings.ShowMedals;
            AllowPostToBlog.Checked   = PageContext.BoardSettings.AllowPostToBlog;

            // Mek : 08/18/2007 Added
            AllowReportAbuse.Checked = PageContext.BoardSettings.AllowReportAbuse;
            AllowReportSpam.Checked  = PageContext.BoardSettings.AllowReportSpam;

            // Ederon : 8/29/2007 added
            AllowEmailTopic.Checked = PageContext.BoardSettings.AllowEmailTopic;

            // Ederon : 7/14/2007 added
            UserBox.Text          = PageContext.BoardSettings.UserBox;
            UserBoxAvatar.Text    = PageContext.BoardSettings.UserBoxAvatar;
            UserBoxMedals.Text    = PageContext.BoardSettings.UserBoxMedals;
            UserBoxGroups.Text    = PageContext.BoardSettings.UserBoxGroups;
            UserBoxJoinDate.Text  = PageContext.BoardSettings.UserBoxJoinDate;
            UserBoxLocation.Text  = PageContext.BoardSettings.UserBoxLocation;
            UserBoxPoints.Text    = PageContext.BoardSettings.UserBoxPoints;
            UserBoxPosts.Text     = PageContext.BoardSettings.UserBoxPosts;
            UserBoxRank.Text      = PageContext.BoardSettings.UserBoxRank;
            UserBoxRankImage.Text = PageContext.BoardSettings.UserBoxRankImage;

            // Ederon : 11/21/2007 added
            ProfileViewPermissions.SelectedIndex = PageContext.BoardSettings.ProfileViewPermissions;

            // Ederon : 12/9/2007 added
            RequireLogin.Checked = PageContext.BoardSettings.RequireLogin;
            MembersListViewPermissions.SelectedIndex = PageContext.BoardSettings.MembersListViewPermissions;
            ActiveUsersViewPermissions.SelectedIndex = PageContext.BoardSettings.ActiveUsersViewPermissions;

            // Ederon : 12/14/2007 added
            ShowForumStatistics.Checked     = PageContext.BoardSettings.ShowForumStatistics;
            ShowActiveDiscussions.Checked   = PageContext.BoardSettings.ShowActiveDiscussions;
            ActiveDiscussionsCount.Text     = PageContext.BoardSettings.ActiveDiscussionsCount.ToString();
            SearchStringMinLength.Text      = PageContext.BoardSettings.SearchStringMinLength.ToString();
            SearchStringPattern.Text        = PageContext.BoardSettings.SearchStringPattern;
            SearchPermissions.SelectedIndex = PageContext.BoardSettings.SearchPermissions;

            // Ederon : 12/18/2007 added
            MaxPrivateMessagesPerUser.Text   = PageContext.BoardSettings.MaxPrivateMessagesPerUser.ToString();
            PrivateMessageMaxRecipients.Text = PageContext.BoardSettings.PrivateMessageMaxRecipients.ToString();

            // MDDubs : 2/7/2008 added
            AllowEmailChange.Checked = PageContext.BoardSettings.AllowEmailChange;

            // Ederon : 02/17/2009 added
            PictureAttachmentDisplayTreshold.Text = PageContext.BoardSettings.PictureAttachmentDisplayTreshold.ToString();

            // Caching
            ForumStatisticsCacheTimeout.Text   = PageContext.BoardSettings.ForumStatisticsCacheTimeout.ToString();
            ActiveDiscussionsCacheTimeout.Text = PageContext.BoardSettings.ActiveDiscussionsCacheTimeout.ToString();
            BoardModeratorsCacheTimeout.Text   = PageContext.BoardSettings.BoardModeratorsCacheTimeout.ToString();
            BoardCategoriesCacheTimeout.Text   = PageContext.BoardSettings.BoardCategoriesCacheTimeout.ToString();
            ReplaceRulesCacheTimeout.Text      = PageContext.BoardSettings.ReplaceRulesCacheTimeout.ToString();

            // Captcha Settings
            CaptchaSize.Text                 = PageContext.BoardSettings.CaptchaSize.ToString();
            EnableCaptchaForPost.Checked     = PageContext.BoardSettings.EnableCaptchaForPost;
            EnableCaptchaForRegister.Checked = PageContext.BoardSettings.EnableCaptchaForRegister;
            EnableCaptchaForGuests.Checked   = PageContext.BoardSettings.EnableCaptchaForGuests;

            // Search Settings
            ReturnSearchMax.Text      = PageContext.BoardSettings.ReturnSearchMax.ToString();
            UseFullTextSearch.Checked = PageContext.BoardSettings.UseFullTextSearch;

            MaxPostSize.Text = PageContext.BoardSettings.MaxPostSize.ToString();
        }
        private void BindData()
        {
            TimeZones.DataSource    = YafStaticData.TimeZones();
            Theme.DataSource        = YafStaticData.Themes();
            Theme.DataTextField     = "Theme";
            Theme.DataValueField    = "FileName";
            Language.DataSource     = YafStaticData.Languages();
            Language.DataTextField  = "Language";
            Language.DataValueField = "FileName";

            DataBind();

            // get an instance of the combined user data class.
            YafCombinedUserData userData = new YafCombinedUserData(CurrentUserID);

            Location.Text                 = userData.Profile.Location;
            HomePage.Text                 = userData.Profile.Homepage;
            Email.Text                    = userData.Email;
            Realname.Text                 = userData.Profile.RealName;
            Occupation.Text               = userData.Profile.Occupation;
            Interests.Text                = userData.Profile.Interests;
            Weblog.Text                   = userData.Profile.Blog;
            WeblogUrl.Text                = userData.Profile.BlogServiceUrl;
            WeblogID.Text                 = userData.Profile.BlogServicePassword;
            WeblogUsername.Text           = userData.Profile.BlogServiceUsername;
            MSN.Text                      = userData.Profile.MSN;
            YIM.Text                      = userData.Profile.YIM;
            AIM.Text                      = userData.Profile.AIM;
            ICQ.Text                      = userData.Profile.ICQ;
            Skype.Text                    = userData.Profile.Skype;
            PMNotificationEnabled.Checked = userData.PMNotification;
            Gender.SelectedIndex          = userData.Profile.Gender;

            ListItem timeZoneItem = TimeZones.Items.FindByValue(userData.TimeZone.ToString());

            if (timeZoneItem != null)
            {
                timeZoneItem.Selected = true;
            }

            OverrideForumThemeRow.Visible = PageContext.BoardSettings.AllowUserTheme;

            if (PageContext.BoardSettings.AllowUserTheme)
            {
                // Allows to use different per-forum themes,
                // While "Allow User Change Theme" option in hostsettings is true
                string themeFile = PageContext.BoardSettings.Theme;
                if (userData.ThemeFile != null)
                {
                    themeFile = userData.ThemeFile;
                }

                ListItem themeItem = Theme.Items.FindByValue(themeFile);
                if (themeItem != null)
                {
                    themeItem.Selected = true;
                }

                OverrideDefaultThemes.Checked = userData.OverrideDefaultThemes;
            }

            if (PageContext.BoardSettings.AllowUserLanguage)
            {
                string languageFile = PageContext.BoardSettings.Language;
                if (userData.LanguageFile != string.Empty)
                {
                    languageFile = userData.LanguageFile;
                }

                ListItem foundItem = Language.Items.FindByValue(languageFile);
                if (foundItem != null)
                {
                    foundItem.Selected = true;
                }
            }
        }
示例#4
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Ederon : guess we don't need to test CanLogin anymore
            if (/*!CanLogin ||*/ PageContext.BoardSettings.DisableRegistrations)
            {
                YafBuildLink.AccessDenied();
            }

            if (!IsPostBack)
            {
                PageLinks.AddLink(PageContext.BoardSettings.Name, YAF.Classes.Utils.YafBuildLink.GetLink(YAF.Classes.Utils.ForumPages.forum));
                PageLinks.AddLink(GetText("TITLE"));

                // handle the CreateUser Step localization
                Control createUserTemplateRef = CreateUserWizard1.CreateUserStep.ContentTemplateContainer;

                CompareValidator       passwordNoMatch         = (CompareValidator)createUserTemplateRef.FindControl("PasswordCompare");
                RequiredFieldValidator usernameRequired        = (RequiredFieldValidator)createUserTemplateRef.FindControl("UserNameRequired");
                RequiredFieldValidator passwordRequired        = (RequiredFieldValidator)createUserTemplateRef.FindControl("PasswordRequired");
                RequiredFieldValidator confirmPasswordRequired = (RequiredFieldValidator)createUserTemplateRef.FindControl("ConfirmPasswordRequired");
                RequiredFieldValidator emailRequired           = (RequiredFieldValidator)createUserTemplateRef.FindControl("EmailRequired");
                RequiredFieldValidator questionRequired        = (RequiredFieldValidator)createUserTemplateRef.FindControl("QuestionRequired");
                RequiredFieldValidator answerRequired          = (RequiredFieldValidator)createUserTemplateRef.FindControl("AnswerRequired");
                Button createUser = (Button)createUserTemplateRef.FindControl("StepNextButton");

                usernameRequired.ToolTip        = usernameRequired.ErrorMessage = GetText("NEED_USERNAME");
                passwordRequired.ToolTip        = passwordRequired.ErrorMessage = GetText("NEED_PASSWORD");
                confirmPasswordRequired.ToolTip = confirmPasswordRequired.ErrorMessage = GetText("RETYPE_PASSWORD");
                passwordNoMatch.ToolTip         = passwordNoMatch.ErrorMessage = GetText("NEED_MATCH");
                emailRequired.ToolTip           = emailRequired.ErrorMessage = GetText("NEED_EMAIL");
                questionRequired.ToolTip        = questionRequired.ErrorMessage = GetText("NEED_QUESTION");
                answerRequired.ToolTip          = answerRequired.ErrorMessage = GetText("NEED_ANSWER");
                createUser.ToolTip = createUser.Text = GetText("CREATE_USER");

                // handle other steps localization
                ((Button)FindWizardControl("ProfileNextButton")).Text = GetText("SAVE");
                ((Button)FindWizardControl("ContinueButton")).Text    = GetText("CONTINUE");

                // get the time zone data source
                DropDownList timeZones = ((DropDownList)FindWizardControl("TimeZones"));
                timeZones.DataSource = YafStaticData.TimeZones();

                if (!PageContext.BoardSettings.EmailVerification)
                {
                    // automatically log in created users
                    CreateUserWizard1.LoginCreatedUser   = true;
                    CreateUserWizard1.DisableCreatedUser = false;
                    // success notification localization
                    ((Literal)FindWizardControl("AccountCreated")).Text = YAF.Classes.UI.BBCode.MakeHtml(GetText("ACCOUNT_CREATED"), true, false);
                }
                else
                {
                    CreateUserWizard1.LoginCreatedUser   = false;
                    CreateUserWizard1.DisableCreatedUser = true;
                    // success notification localization
                    ((Literal)FindWizardControl("AccountCreated")).Text = YAF.Classes.UI.BBCode.MakeHtml(GetText("ACCOUNT_CREATED_VERIFICATION"), true, false);
                }

                if (PageContext.BoardSettings.EnableCaptchaForRegister)
                {
                    Session["CaptchaImageText"] = General.GetCaptchaString();
                    Image       imgCaptcha         = (Image)createUserTemplateRef.FindControl("imgCaptcha");
                    PlaceHolder captchaPlaceHolder = ( PlaceHolder )createUserTemplateRef.FindControl("CaptchaPlaceHolder");

                    imgCaptcha.ImageUrl        = String.Format("{0}resource.ashx?c=1", YafForumInfo.ForumRoot);
                    captchaPlaceHolder.Visible = true;
                }

                PlaceHolder questionAnswerPlaceHolder = ( PlaceHolder )createUserTemplateRef.FindControl("QuestionAnswerPlaceHolder");
                questionAnswerPlaceHolder.Visible = Membership.RequiresQuestionAndAnswer;

                CreateUserWizard1.FinishDestinationPageUrl = YafForumInfo.ForumURL;

                DataBind();

                timeZones.Items.FindByValue("0").Selected = true;
            }
        }