Esempio n. 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="EventArgs"/> instance containing the event data.
        /// </param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (this.IsPostBack)
            {
                return;
            }

            this.CreateUserWizard1.MembershipProvider = Config.MembershipProvider;

            this.PageLinks.AddRoot();
            this.PageLinks.AddLink(this.GetText("TITLE"));

            // handle the CreateUser Step localization
            this.SetupCreateUserStep();

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

            var dstUser = (CheckBox)this.CreateUserWizard1.FindWizardControlRecursive("DSTUser");

            dstUser.Text = this.GetText("CP_EDITPROFILE", "DST");

            var facebookRegister = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("FacebookRegister");
            var twitterRegister  = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("TwitterRegister");
            var googleRegister   = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("GoogleRegister");

            var loginButton = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("LoginButton");

            var authPanel = (Panel)this.CreateUserWizard1.FindWizardControlRecursive("AuthPanel");

            if (this.PageContext.IsGuest && !Config.IsAnyPortal && Config.AllowLoginAndLogoff)
            {
                loginButton.Visible = true;
                loginButton.Text    = this.GetText("LOGIN_INSTEAD");
            }

            if (Config.FacebookAPIKey.IsSet() && Config.FacebookSecretKey.IsSet())
            {
                facebookRegister.Visible = authPanel.Visible = true;
                facebookRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Facebook");
            }

            if (Config.TwitterConsumerKey.IsSet() && Config.TwitterConsumerSecret.IsSet())
            {
                twitterRegister.Visible = authPanel.Visible = true;
                twitterRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Twitter");
            }

            if (Config.GoogleClientID.IsSet() && Config.GoogleClientSecret.IsSet())
            {
                googleRegister.Visible = authPanel.Visible = true;
                googleRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Google");
            }

            // get the time zone data source
            var timeZones = (DropDownList)this.CreateUserWizard1.FindWizardControlRecursive("TimeZones");

            timeZones.DataSource = StaticDataHelper.TimeZones();

            // get the country data source
            var country = (ImageListBox)this.CreateUserWizard1.FindWizardControlRecursive("Country");

            country.ImageLocation = YafForumInfo.GetURLToContent("images/flags/{0}.png");
            country.DataSource    = StaticDataHelper.Country();

            if (this.Get <YafBoardSettings>().EnableIPInfoService&& this.UserIpLocator == null)
            {
                // vzrus: we should always get not null class here
                this.UserIpLocator = new IPDetails().GetData(
                    this.Get <HttpRequestBase>().GetUserRealIPAddress(),
                    "text",
                    false,
                    this.PageContext().CurrentForumPage.Localization.Culture.Name,
                    string.Empty,
                    string.Empty);
            }

            if (!this.Get <YafBoardSettings>().EmailVerification)
            {
                // automatically log in created users
                this.CreateUserWizard1.LoginCreatedUser   = false;
                this.CreateUserWizard1.DisableCreatedUser = false;

                // success notification localization
                ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                    this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED"), false, true, false);
            }
            else
            {
                this.CreateUserWizard1.LoginCreatedUser   = false;
                this.CreateUserWizard1.DisableCreatedUser = true;

                // success notification localization
                ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                    this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED_VERIFICATION"), false, true, false);
            }

            this.CreateUserWizard1.ContinueDestinationPageUrl = YafForumInfo.ForumURL;
            this.CreateUserWizard1.FinishDestinationPageUrl   = YafForumInfo.ForumURL;

            this.DataBind();

            // fill location field
            if (this.Get <YafBoardSettings>().EnableIPInfoService)
            {
                try
                {
                    this.FillLocationData(country);
                }
                catch (Exception exception)
                {
                    this.Logger.Log(
                        null,
                        this,
                        "Error whith Location Data for IP: {0}, exception is: {1}".FormatWith(
                            this.Get <HttpRequestBase>().GetUserRealIPAddress(),
                            exception));
                }
            }

            // Auto Fill user time zone
            timeZones.Items.FindByValue(TimeZoneInfo.Local.Id).Selected = true;

            this.CreateUserWizard1.FindWizardControlRecursive("UserName").Focus();

            if (this.Get <YafBoardSettings>().CaptchaTypeRegister == 2)
            {
                this.SetupRecaptchaControl();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            this.Country.DataSource     = StaticDataHelper.Country();
            this.Country.DataValueField = "Value";
            this.Country.DataTextField  = "Name";

            if (this.User.Item2.Profile_Country.IsSet())
            {
                this.LookForNewRegionsBind(this.User.Item2.Profile_Country);
            }

            this.DataBind();

            if (this.Get <BoardSettings>().UseFarsiCalender&& this.CurrentCultureInfo.IsFarsiCulture())
            {
                this.Birthday.Text =
                    this.User.Item2.Profile_Birthday > DateTimeHelper.SqlDbMinTime() ||
                    this.User.Item2.Profile_Birthday.IsNullOrEmptyDBField()
                        ? PersianDateConverter.ToPersianDate(this.User.Item2.Profile_Birthday).ToString("d")
                        : PersianDateConverter.ToPersianDate(PersianDate.MinValue).ToString("d");
            }
            else
            {
                this.Birthday.Text =
                    this.User.Item2.Profile_Birthday > DateTimeHelper.SqlDbMinTime() ||
                    this.User.Item2.Profile_Birthday.IsNullOrEmptyDBField()
                        ? this.User.Item2.Profile_Birthday.Date.ToString(
                        this.CurrentCultureInfo.DateTimeFormat.ShortDatePattern,
                        CultureInfo.InvariantCulture)
                        : DateTimeHelper.SqlDbMinTime().Date.ToString(
                        this.CurrentCultureInfo.DateTimeFormat.ShortDatePattern,
                        CultureInfo.InvariantCulture);
            }

            this.Birthday.ToolTip = this.GetText("COMMON", "CAL_JQ_TT");

            this.DisplayName.Text = this.User.Item1.DisplayName;
            this.City.Text        = this.User.Item2.Profile_City;
            this.Location.Text    = this.User.Item2.Profile_Location;
            this.HomePage.Text    = this.User.Item2.Profile_Homepage;
            this.Realname.Text    = this.User.Item2.Profile_RealName;
            this.Occupation.Text  = this.User.Item2.Profile_Occupation;
            this.Interests.Text   = this.User.Item2.Profile_Interests;
            this.Weblog.Text      = this.User.Item2.Profile_Blog;
            this.ICQ.Text         = this.User.Item2.Profile_ICQ;

            this.Facebook.Text = ValidationHelper.IsNumeric(this.User.Item2.Profile_Facebook)
                ? $"https://www.facebook.com/profile.php?id={this.User.Item2.Profile_Facebook}"
                : this.User.Item2.Profile_Facebook;

            this.Twitter.Text         = this.User.Item2.Profile_Twitter;
            this.Xmpp.Text            = this.User.Item2.Profile_XMPP;
            this.Skype.Text           = this.User.Item2.Profile_Skype;
            this.Gender.SelectedIndex = this.User.Item2.Profile_Gender;

            if (this.User.Item2.Profile_Country.IsSet())
            {
                var countryItem = this.Country.Items.FindByValue(this.User.Item2.Profile_Country.Trim());
                if (countryItem != null)
                {
                    countryItem.Selected = true;
                }
            }

            if (this.User.Item2.Profile_Region.IsSet())
            {
                var regionItem = this.Region.Items.FindByValue(this.User.Item2.Profile_Region.Trim());
                if (regionItem != null)
                {
                    regionItem.Selected = true;
                }
            }

            if (!this.ProfileDefinitions.Any())
            {
                return;
            }

            this.CustomProfile.DataSource = this.ProfileDefinitions;
            this.CustomProfile.DataBind();
            this.CustomProfile.Visible = true;
        }
Esempio n. 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="EventArgs"/> instance containing the event data.
        /// </param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (this.IsPostBack)
            {
                return;
            }

            this.CreateUserWizard1.MembershipProvider = Config.MembershipProvider;

            // handle the CreateUser Step localization
            this.SetupCreateUserStep();

            var loginButton = this.CreateUserStepContainer.FindControlAs <ThemeButton>("LoginButton");

            // handle other steps localization
            ((Button)this.CreateUserWizard1.FindWizardControlRecursive("ContinueButton")).Text =
                this.GetText("CONTINUE");

            var dstUser = (CheckBox)this.CreateUserWizard1.FindWizardControlRecursive("DSTUser");

            dstUser.Text = this.GetText("EDIT_PROFILE", "DST");

            var facebookRegister = (ThemeButton)this.CreateUserWizard1.FindWizardControlRecursive("FacebookRegister");
            var twitterRegister  = (ThemeButton)this.CreateUserWizard1.FindWizardControlRecursive("TwitterRegister");
            var googleRegister   = (ThemeButton)this.CreateUserWizard1.FindWizardControlRecursive("GoogleRegister");

            var authPanel = (PlaceHolder)this.CreateUserWizard1.FindWizardControlRecursive("AuthPanel");

            if (this.PageContext.IsGuest && !Config.IsAnyPortal && Config.AllowLoginAndLogoff)
            {
                loginButton.Visible     = true;
                loginButton.Text        = this.GetText("LOGIN_INSTEAD");
                loginButton.NavigateUrl = BuildLink.GetLink(ForumPages.Login);
            }

            if (this.Get <BoardSettings>().AllowSingleSignOn)
            {
                if (Config.FacebookAPIKey.IsSet() && Config.FacebookSecretKey.IsSet())
                {
                    facebookRegister.Visible = authPanel.Visible = true;
                    facebookRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Facebook");
                }

                if (Config.TwitterConsumerKey.IsSet() && Config.TwitterConsumerSecret.IsSet())
                {
                    twitterRegister.Visible = authPanel.Visible = true;
                    twitterRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Twitter");
                }

                if (Config.GoogleClientID.IsSet() && Config.GoogleClientSecret.IsSet())
                {
                    googleRegister.Visible = authPanel.Visible = true;
                    googleRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Google");
                }
            }

            // get the time zone data source
            var timeZones = (DropDownList)this.CreateUserWizard1.FindWizardControlRecursive("TimeZones");

            timeZones.DataSource = StaticDataHelper.TimeZones();

            // get the country data source
            var country = (CountryImageListBox)this.CreateUserWizard1.FindWizardControlRecursive("Country");

            country.DataSource = StaticDataHelper.Country();

            if (!this.Get <BoardSettings>().EmailVerification)
            {
                // automatically log in created users
                this.CreateUserWizard1.LoginCreatedUser   = false;
                this.CreateUserWizard1.DisableCreatedUser = false;

                // success notification localization
                ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                    this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED"), false, true);
            }
            else
            {
                this.CreateUserWizard1.LoginCreatedUser   = false;
                this.CreateUserWizard1.DisableCreatedUser = true;

                // success notification localization
                ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                    this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED_VERIFICATION"), false, true);
            }

            this.CreateUserWizard1.ContinueDestinationPageUrl = BoardInfo.ForumURL;
            this.CreateUserWizard1.FinishDestinationPageUrl   = BoardInfo.ForumURL;

            this.DataBind();

            // fill location field
            if (this.Get <BoardSettings>().EnableIPInfoService)
            {
                try
                {
                    this.FillLocationData(country);
                }
                catch (Exception exception)
                {
                    this.Logger.Log(
                        null,
                        this,
                        $"Error whith Location Data for IP: {this.Get<HttpRequestBase>().GetUserRealIPAddress()}, exception is: {exception}");
                }
            }

            // Auto Fill user time zone
            timeZones.Items.FindByValue(TimeZoneInfo.Local.Id).Selected = true;
            dstUser.Checked = TimeZoneInfo.Local.SupportsDaylightSavingTime;

            this.CreateUserWizard1.FindWizardControlRecursive("UserName").Focus();

            if (this.Get <BoardSettings>().CaptchaTypeRegister == 2)
            {
                this.SetupRecaptchaControl();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// The bind data.
        /// </summary>
        private void BindData()
        {
            this.TimeZones.DataSource = StaticDataHelper.TimeZones();
            if (this.Get <YafBoardSettings>().AllowUserTheme)
            {
                this.Theme.DataSource     = StaticDataHelper.Themes();
                this.Theme.DataTextField  = "Theme";
                this.Theme.DataValueField = "FileName";
            }

            if (this.Get <YafBoardSettings>().AllowUserLanguage)
            {
                this.Culture.DataSource     = StaticDataHelper.Cultures();
                this.Culture.DataValueField = "CultureTag";
                this.Culture.DataTextField  = "CultureNativeName";
            }

            this.Country.DataSource     = StaticDataHelper.Country();
            this.Country.DataValueField = "Value";
            this.Country.DataTextField  = "Name";

            if (this.UserData.Profile.Country.IsSet())
            {
                this.LookForNewRegionsBind(this.UserData.Profile.Country);
            }

            if (this.Get <YafBoardSettings>().AllowUsersTextEditor)
            {
                this.ForumEditor.DataSource     = this.Get <IModuleManager <ForumEditor> >().ActiveAsDataTable("Editors");
                this.ForumEditor.DataValueField = "Value";
                this.ForumEditor.DataTextField  = "Name";
            }

            this.DataBind();

            if (this.Get <YafBoardSettings>().UseFarsiCalender&& this.CurrentCultureInfo.IsFarsiCulture())
            {
                this.Birthday.Text = this.UserData.Profile.Birthday > DateTimeHelper.SqlDbMinTime() ||
                                     this.UserData.Profile.Birthday.IsNullOrEmptyDBField()
                                         ? PersianDateConverter.ToPersianDate(this.UserData.Profile.Birthday)
                                     .ToString("d")
                                         : PersianDateConverter.ToPersianDate(PersianDate.MinValue).ToString("d");
            }
            else
            {
                this.Birthday.Text = this.UserData.Profile.Birthday > DateTimeHelper.SqlDbMinTime() ||
                                     this.UserData.Profile.Birthday.IsNullOrEmptyDBField()
                                         ? this.UserData.Profile.Birthday.Date.ToString(
                    this.CurrentCultureInfo.DateTimeFormat.ShortDatePattern,
                    CultureInfo.InvariantCulture)
                                         : DateTimeHelper.SqlDbMinTime()
                                     .Date.ToString(
                    this.CurrentCultureInfo.DateTimeFormat.ShortDatePattern,
                    CultureInfo.InvariantCulture);
            }

            this.Birthday.ToolTip = this.GetText("COMMON", "CAL_JQ_TT");

            this.DisplayName.Text    = this.UserData.DisplayName;
            this.City.Text           = this.UserData.Profile.City;
            this.Location.Text       = this.UserData.Profile.Location;
            this.HomePage.Text       = this.UserData.Profile.Homepage;
            this.Email.Text          = this.UserData.Email;
            this.Realname.Text       = this.UserData.Profile.RealName;
            this.Occupation.Text     = this.UserData.Profile.Occupation;
            this.Interests.Text      = this.UserData.Profile.Interests;
            this.Weblog.Text         = this.UserData.Profile.Blog;
            this.WeblogUrl.Text      = this.UserData.Profile.BlogServiceUrl;
            this.WeblogID.Text       = this.UserData.Profile.BlogServicePassword;
            this.WeblogUsername.Text = this.UserData.Profile.BlogServiceUsername;
            this.MSN.Text            = this.UserData.Profile.MSN;
            this.YIM.Text            = this.UserData.Profile.YIM;
            this.AIM.Text            = this.UserData.Profile.AIM;
            this.ICQ.Text            = this.UserData.Profile.ICQ;

            this.Facebook.Text = ValidationHelper.IsNumeric(this.UserData.Profile.Facebook)
                                     ? "https://www.facebook.com/profile.php?id={0}".FormatWith(
                this.UserData.Profile.Facebook)
                                     : this.UserData.Profile.Facebook;

            this.Twitter.Text         = this.UserData.Profile.Twitter;
            this.Google.Text          = this.UserData.Profile.Google;
            this.Xmpp.Text            = this.UserData.Profile.XMPP;
            this.Skype.Text           = this.UserData.Profile.Skype;
            this.Gender.SelectedIndex = this.UserData.Profile.Gender;

            if (this.UserData.Profile.Country.IsSet())
            {
                ListItem countryItem = this.Country.Items.FindByValue(this.UserData.Profile.Country.Trim());
                if (countryItem != null)
                {
                    countryItem.Selected = true;
                }
            }

            if (this.UserData.Profile.Region.IsSet())
            {
                ListItem regionItem = this.Region.Items.FindByValue(this.UserData.Profile.Region.Trim());
                if (regionItem != null)
                {
                    regionItem.Selected = true;
                }
            }

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

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

            this.DSTUser.Checked = this.UserData.DSTUser;
            this.HideMe.Checked  = this.UserData.IsActiveExcluded &&
                                   (this.Get <YafBoardSettings>().AllowUserHideHimself || this.PageContext.IsAdmin);

            if (this.Get <YafBoardSettings>().MobileTheme.IsSet() &&
                UserAgentHelper.IsMobileDevice(HttpContext.Current.Request.UserAgent) ||
                HttpContext.Current.Request.Browser.IsMobileDevice)
            {
                this.UseMobileThemeRow.Visible = true;
                this.UseMobileTheme.Checked    = this.UserData.UseMobileTheme;
            }

            if (this.Get <YafBoardSettings>().AllowUserTheme&& this.Theme.Items.Count > 0)
            {
                // Allows to use different per-forum themes,
                // While "Allow User Change Theme" option in hostsettings is true
                string themeFile = this.Get <YafBoardSettings>().Theme;

                if (this.UserData.ThemeFile.IsSet())
                {
                    themeFile = this.UserData.ThemeFile;
                }

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

            if (this.Get <YafBoardSettings>().AllowUsersTextEditor&& this.ForumEditor.Items.Count > 0)
            {
                // Text editor
                string textEditor = this.UserData.TextEditor.IsSet()
                                        ? this.UserData.TextEditor
                                        : this.Get <YafBoardSettings>().ForumEditor;

                ListItem editorItem = this.ForumEditor.Items.FindByValue(textEditor);
                if (editorItem != null)
                {
                    editorItem.Selected = true;
                }
            }

            if (!this.Get <YafBoardSettings>().AllowUserLanguage || this.Culture.Items.Count <= 0)
            {
                return;
            }

            // If 2-letter language code is the same we return Culture, else we return a default full culture from language file
            ListItem foundCultItem = this.Culture.Items.FindByValue(this.GetCulture(true));

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

            if (!Page.IsPostBack)
            {
                this.Realname.Focus();
            }
        }
Esempio n. 5
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="EventArgs"/> instance containing the event data.</param>
        protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.CreateUserWizard1.MembershipProvider = Config.MembershipProvider;

                this.PageLinks.AddLink(this.Get <YafBoardSettings>().Name, YafBuildLink.GetLink(ForumPages.forum));
                this.PageLinks.AddLink(this.GetText("TITLE"));

                // handle the CreateUser Step localization
                this.SetupCreateUserStep();

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

                var facebookRegister = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("FacebookRegister");
                var twitterRegister  = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("TwitterRegister");
                var googleRegister   = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("GoogleRegister");

                var loginButton = (LinkButton)this.CreateUserWizard1.FindWizardControlRecursive("LoginButton");

                var authPanel = (Panel)this.CreateUserWizard1.FindWizardControlRecursive("AuthPanel");

                if (this.PageContext.IsGuest && !Config.IsAnyPortal && Config.AllowLoginAndLogoff)
                {
                    loginButton.Visible = true;
                    loginButton.Text    = this.GetText("LOGIN_INSTEAD");
                }

                if (Config.FacebookAPIKey.IsSet() && Config.FacebookSecretKey.IsSet())
                {
                    facebookRegister.Visible = authPanel.Visible = true;
                    facebookRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Facebook");
                }

                if (Config.TwitterConsumerKey.IsSet() && Config.TwitterConsumerSecret.IsSet())
                {
                    twitterRegister.Visible = authPanel.Visible = true;
                    twitterRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Twitter");
                }

                if (Config.GoogleClientID.IsSet() && Config.GoogleClientSecret.IsSet())
                {
                    googleRegister.Visible = authPanel.Visible = true;
                    googleRegister.Text    = this.GetTextFormatted("REGISTER_AUTH", "Google");
                }

                // get the time zone data source
                var timeZones = (DropDownList)this.CreateUserWizard1.FindWizardControlRecursive("TimeZones");
                timeZones.DataSource = StaticDataHelper.TimeZones();

                // get the country data source
                var country = (DropDownList)this.CreateUserWizard1.FindWizardControlRecursive("Country");
                country.DataSource = StaticDataHelper.Country();

                if (this.Get <YafBoardSettings>().EnableIPInfoService&& this._UserIpLocator == null)
                {
                    // vzrus: we should always get not null class here
                    this._UserIpLocator = new IPDetails().GetData(
                        this.Get <HttpRequestBase>().GetUserRealIPAddress(),
                        "text",
                        false,
                        this.PageContext().CurrentForumPage.Localization.Culture.Name,
                        string.Empty,
                        string.Empty);
                }

                if (!this.Get <YafBoardSettings>().EmailVerification)
                {
                    // automatically log in created users
                    this.CreateUserWizard1.LoginCreatedUser   = true;
                    this.CreateUserWizard1.DisableCreatedUser = false;

                    // success notification localization
                    ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                        this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED"), true, false);
                }
                else
                {
                    this.CreateUserWizard1.LoginCreatedUser   = false;
                    this.CreateUserWizard1.DisableCreatedUser = true;

                    // success notification localization
                    ((Literal)this.CreateUserWizard1.FindWizardControlRecursive("AccountCreated")).Text =
                        this.Get <IBBCode>().MakeHtml(this.GetText("ACCOUNT_CREATED_VERIFICATION"), true, false);
                }

                this.CreateUserWizard1.FinishDestinationPageUrl = YafForumInfo.ForumURL;

                this.DataBind();

                decimal hours = 0;

                // fill location field
                // Trying to consume data about user IP whereabouts
                if (this.Get <YafBoardSettings>().EnableIPInfoService&& this._UserIpLocator == null || this._UserIpLocator["StatusCode"] != "OK")
                {
                    this.Logger.Log(
                        null,
                        this,
                        "Geolocation Service reports: {0}".FormatWith(this._UserIpLocator["StatusMessage"]),
                        EventLogTypes.Information);
                }

                if (this.Get <YafBoardSettings>().EnableIPInfoService&& this._UserIpLocator.Count > 0 &&
                    this._UserIpLocator["StatusCode"] == "OK")
                {
                    var location = new StringBuilder();

                    if (this._UserIpLocator["CountryName"] != null && this._UserIpLocator["CountryName"].IsSet())
                    {
                        country.Items.FindByValue(this.Get <ILocalization>().Culture.Name.Substring(2, 2)).Selected =
                            true;
                    }

                    if (this._UserIpLocator["RegionName"] != null && this._UserIpLocator["RegionName"].IsSet())
                    {
                        location.AppendFormat(", {0}", this._UserIpLocator["RegionName"]);
                    }

                    if (this._UserIpLocator["CityName"] != null && this._UserIpLocator["CityName"].IsSet())
                    {
                        location.AppendFormat(", {0}", this._UserIpLocator["CityName"]);
                    }

                    this.CreateUserWizard1.FindControlRecursiveAs <TextBox>("Location").Text = location.ToString();

                    if (this._UserIpLocator["TimeZone"] != null && this._UserIpLocator["TimeZone"].IsSet())
                    {
                        try
                        {
                            hours = this._UserIpLocator["TimeZone"].ToType <decimal>() * 60;
                        }
                        catch (FormatException)
                        {
                            hours = 0;
                        }
                    }
                }

                timeZones.Items.FindByValue(hours.ToString()).Selected = true;
                this.CreateUserWizard1.FindWizardControlRecursive("UserName").Focus();
            }

            // password requirement parameters...
            var requirementText =
                (LocalizedLabel)this.CreateUserStepContainer.FindControl("LocalizedLabelRequirementsText");

            requirementText.Param0 = this.Get <MembershipProvider>().MinRequiredPasswordLength.ToString();
            requirementText.Param1 = this.Get <MembershipProvider>().MinRequiredNonAlphanumericCharacters.ToString();

            // max user name length
            var usernamelehgthText =
                (LocalizedLabel)this.CreateUserStepContainer.FindControl("LocalizedLabelLohgUserNameWarnText");

            usernamelehgthText.Param0 = this.Get <YafBoardSettings>().UserNameMaxLength.ToString();

            if (this.Get <YafBoardSettings>().CaptchaTypeRegister == 2)
            {
                this.SetupRecaptchaControl();
            }
        }