Ejemplo n.º 1
0
 protected void CaptchaUltimateControl1_Verifying(object sender, VerifyingEventArgs e)
 {
     if (ConfigurationManager.AppSettings["OverrideCaptcha"].ToLower().Equals("true")
         || CodeCampSV.Utils.CheckUserIsAdmin())
     {
         e.ForceVerify = true;
     }
 }
        /// <summary>
        /// Meant to be overridden by users control
        /// </summary>
        /// <param name="ve"></param>
        protected virtual void OnVerifying(VerifyingEventArgs ve)
        {
            // person still sees captcha, but they are not bothered if they don't enter it or do it incorrectly
            if (Context.User.Identity.IsAuthenticated && ByPassCaptchaWhenAuthenticated)
            {
                ve.ForceVerify = true;
            }

            var handler = (VerifyingEventHandler)Events[EventVerifying];
            if (handler != null) // null check is necessary in case no one has subscribed to this event
            {
                handler(this, ve);
            }
        }
        private void _validator_ServerValidate(object source, ServerValidateEventArgs args)
        {
            if (string.Compare(_userInput.Text, PlainValue, true) == 0)
            {
                args.IsValid = true;
            }
            else
            {
                args.IsValid = false;
            }

            // Force override if person set ForceVerify true in event on their page
            var ve = new VerifyingEventArgs();
            OnVerifying(ve);
            if (ve.ForceVerify)
            {
                args.IsValid = true;
            }

            if (args.IsValid)
            {
                OnVerified(EventArgs.Empty);
            }
            else
            {
                OnFailedVerify(EventArgs.Empty);
            }
        }
Ejemplo n.º 4
0
    protected void CaptchaUltimateControl1_Verifying(object sender, VerifyingEventArgs e)
    {
        bool authenticated = Context.User.Identity.IsAuthenticated;

        if (ConfigurationManager.AppSettings["OverrideCaptcha"].ToLower().Equals("true")
            || authenticated)
        {
            e.ForceVerify = true;
        }
    }