protected void CreateUserError(object sender, EventArgs e)
 {
     if (SettingManager.GetSettingValueBoolean("Common.RegisterCaptchaImageEnabled"))
     {
         CaptchaControl CaptchaCtrl = CreateUserWizardStep1.ContentTemplateContainer.FindControl("CaptchaCtrl") as CaptchaControl;
         if (CaptchaCtrl != null)
         {
             CaptchaCtrl.RegenerateCode();
         }
     }
 }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ApplyLocalization();

            CaptchaControl CaptchaCtrl = LoginForm.FindControl("CaptchaCtrl") as CaptchaControl;

            if (CaptchaCtrl != null)
            {
                CaptchaCtrl.Visible = SettingManager.GetSettingValueBoolean("Common.LoginCaptchaImageEnabled");
            }
        }
Ejemplo n.º 3
0
 protected void OnLoginError(object sender, EventArgs e)
 {
     if (SettingManager.GetSettingValueBoolean("Common.LoginCaptchaImageEnabled"))
     {
         CaptchaControl CaptchaCtrl = LoginForm.FindControl("CaptchaCtrl") as CaptchaControl;
         if (CaptchaCtrl != null)
         {
             CaptchaCtrl.RegenerateCode();
         }
     }
 }
 public void CreatingUser(object sender, LoginCancelEventArgs e)
 {
     if (SettingManager.GetSettingValueBoolean("Common.RegisterCaptchaImageEnabled"))
     {
         CaptchaControl CaptchaCtrl = CreateUserWizardStep1.ContentTemplateContainer.FindControl("CaptchaCtrl") as CaptchaControl;
         if (CaptchaCtrl != null)
         {
             if (!CaptchaCtrl.ValidateCaptcha())
             {
                 e.Cancel = true;
             }
         }
     }
 }
Ejemplo n.º 5
0
 protected void OnLoggingIn(object sender, LoginCancelEventArgs e)
 {
     if (SettingManager.GetSettingValueBoolean("Common.LoginCaptchaImageEnabled"))
     {
         CaptchaControl CaptchaCtrl = LoginForm.FindControl("CaptchaCtrl") as CaptchaControl;
         if (CaptchaCtrl != null)
         {
             if (!CaptchaCtrl.ValidateCaptcha())
             {
                 e.Cancel = true;
             }
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.ApplyLocalization();

            CreateUserForm.Visible = !CustomerManager.NewCustomerRegistrationDisabled;
            topicRegistrationNotAllowed.Visible = CustomerManager.NewCustomerRegistrationDisabled;

            if (!Page.IsPostBack)
            {
                if (NopContext.Current.User != null && !NopContext.Current.User.IsGuest)
                {
                    CustomerManager.Logout();
                    Response.Redirect("~/Register.aspx");
                }

                #region Username/emails hack
                HtmlTableRow pnlEmail = CreateUserWizardStep1.ContentTemplateContainer.FindControl("pnlEmail") as HtmlTableRow;
                if (pnlEmail != null)
                {
                    pnlEmail.Visible = CustomerManager.UsernamesEnabled;
                }
                RegularExpressionValidator refUserNameOrEmail = CreateUserWizardStep1.ContentTemplateContainer.FindControl("refUserNameOrEmail") as RegularExpressionValidator;
                if (refUserNameOrEmail != null)
                {
                    refUserNameOrEmail.Enabled = !CustomerManager.UsernamesEnabled;
                }
                #endregion

                this.FillCountryDropDowns();
                this.FillStateProvinceDropDowns();
                this.DataBind();
            }

            CaptchaControl CaptchaCtrl = CreateUserWizardStep1.ContentTemplateContainer.FindControl("CaptchaCtrl") as CaptchaControl;
            if (CaptchaCtrl != null)
            {
                CaptchaCtrl.Visible = SettingManager.GetSettingValueBoolean("Common.RegisterCaptchaImageEnabled");
            }
        }