Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

3.6 KB
Raw Blame
using Grand.Domain.Configuration;

namespace Grand.Domain.Common;

/// <summary>
///     CAPTCHA settings
/// </summary>
public class CaptchaSettings : ISettings
{
    /// <summary>
    ///     Is CAPTCHA enabled?
    /// </summary>
    public bool Enabled { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the login page
    /// </summary>
    public bool ShowOnLoginPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the registration page
    /// </summary>
    public bool ShowOnRegistrationPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the password recovery page
    /// </summary>
    public bool ShowOnPasswordRecoveryPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the contacts page
    /// </summary>
    public bool ShowOnContactUsPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the wishlist page
    /// </summary>
    public bool ShowOnEmailWishlistToFriendPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "email a friend" page
    /// </summary>
    public bool ShowOnEmailProductToFriendPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "ask question" page
    /// </summary>
    public bool ShowOnAskQuestionPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "comment blog" page
    /// </summary>
    public bool ShowOnBlogCommentPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "comment blog" page
    /// </summary>
    public bool ShowOnArticleCommentPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "comment news" page
    /// </summary>
    public bool ShowOnNewsCommentPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the product reviews page
    /// </summary>
    public bool ShowOnProductReviewPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the "Apply for vendor account" page
    /// </summary>
    public bool ShowOnApplyVendorPage { get; set; }

    /// <summary>
    ///     A value indicating whether CAPTCHA should be displayed on the vendor reviews page
    /// </summary>
    public bool ShowOnVendorReviewPage { get; set; }

    /// <summary>
    ///     reCAPTCHA public key
    /// </summary>
    public string ReCaptchaPublicKey { get; set; }

    /// <summary>
    ///     reCAPTCHA private key
    /// </summary>
    public string ReCaptchaPrivateKey { get; set; }

    /// <summary>
    ///     reCAPTCHA theme
    /// </summary>
    public string ReCaptchaTheme { get; set; }

    /// <summary>
    ///     reCAPTCHA score
    /// </summary>
    public decimal ReCaptchaScore { get; set; }

    /// <summary>
    ///     reCAPTCHA version
    /// </summary>
    public GoogleReCaptchaVersion ReCaptchaVersion { get; set; }

    /// <summary>
    ///     reCAPTCHA language
    /// </summary>
    public string ReCaptchaLanguage { get; set; }
}

/// <summary>
///     Represents a reCAPTCHA version
/// </summary>
public enum GoogleReCaptchaVersion
{
    /// <summary>
    ///     Version 2.0
    /// </summary>
    V2 = 2,

    /// <summary>
    ///     Version 3.0
    /// </summary>
    V3 = 3
}