Is reCaptcha enabled or not php?
<p>I use a modular system for my code.</p>

<pre><code>class Module_Index extends Base_Module
{
    /*
      Function: start
      Renders  either index.tpl or home.tpl with smarty, depending on if the user is logged in.
    */
    public function start()
    {
        if (LOGGED_IN)
        {
            $this-&gt;tpl-&gt;display('home.tpl');
        }
        else
        {
            $this-&gt;tpl-&gt;assign('ENABLE_RECAPTCHA', ENABLE_RECAPTCHA);
            $this-&gt;tpl-&gt;assign('recaptcha', recaptcha_get_html(PUBLIC_KEY));
            $this-&gt;tpl-&gt;display('index.tpl');
        }
    }
}
</code></pre>

<p>This is my Index_Module which basically just display the login form if not logged in and also enable recaptcha if it suppose to be</p>

<p>My Login_Module which is called from the template file (Smarty) have this</p>

<pre><code>        $resp = recaptcha_check_answer(PRIVATE_KEY,
            $_SERVER["REMOTE_ADDR"],
            $_POST["recaptcha_challenge_field"],
            $_POST["recaptcha_response_field"]);

        if (!$resp-&gt;is_valid) {
            $errors[] = 'The code (reCaptcha) wasn\'t entered correctly!';
            $error = 1;
        }
</code></pre>

<p>And this is code from my template file (Login)</p>

<pre><code>{if $ENABLE_RECAPTCHA}
&lt;label&gt;&lt;/label&gt;
{literal}
&lt;script type="text/javascript"&gt;
var RecaptchaOptions = {
theme : 'white',
tabindex : 9
};
&lt;/script&gt;
{/literal} 
{$recaptcha}
{/if}
</code></pre>

<p>The problem is that sometimes I want to disable the reCaptcha and my question is How do I make sure it is enabled in my Login_module? Do I need to check if some $_POST field is set or something?</p>
