protected override void OnInit(EventArgs e)
{
base.OnInit(e);
var settings = ExtensionManager.GetSettings("Recaptcha");
this.publicKey = settings.GetSingleValue("PublicKey");
this.privateKey = settings.GetSingleValue("PrivateKey");
if (String.IsNullOrEmpty(this.Theme))
{
this.Theme = settings.GetSingleValue("Theme");
}
if (String.IsNullOrEmpty(this.Language))
{
this.Language = settings.GetSingleValue("Language");
}
if (this.RecaptchaEnabled && this.RecaptchaNecessary)
{
this.skipRecaptcha = false;
}
if (String.IsNullOrEmpty(this.publicKey) || String.IsNullOrEmpty(this.privateKey))
{
throw new ApplicationException("reCAPTCHA needs to be configured with a public & private key.");
}
}