From a0acfb6a3fce9a547d19c28ac99654275152ac98 Mon Sep 17 00:00:00 2001
From: Henry Sudhof <kellanved@phpbb.com>
Date: Mon, 27 Jul 2009 11:39:28 +0000
Subject: Minor captcha API change - disable display of plugin by returning
 false in get_template.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9869 89ea8834-ac86-4346-8a33-228a782c2dd0
---
 .../captcha/plugins/phpbb_recaptcha_plugin.php     | 27 ++++++++++++++--------
 1 file changed, 17 insertions(+), 10 deletions(-)

(limited to 'phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php')

diff --git a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
index f148b12656..9a2cc11ebd 100644
--- a/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
+++ b/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php
@@ -128,16 +128,23 @@ class phpbb_recaptcha extends phpbb_default_captcha
 	{
 		global $config, $user, $template;
 
-		$template->assign_vars(array(
-			'RECAPTCHA_SERVER'			=> $this->recaptcha_server,
-			'RECAPTCHA_PUBKEY'			=> isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
-			'RECAPTCHA_ERRORGET'		=> '',
-			'S_RECAPTCHA_AVAILABLE'		=> $this->is_available(),
-			'S_CONFIRM_CODE'			=> true,
-			'S_TYPE'					=> $this->type,
-		));
-
-		return 'captcha_recaptcha.html';
+		if ($this->is_solved())
+		{
+			return false;
+		}
+		else
+		{
+			$template->assign_vars(array(
+				'RECAPTCHA_SERVER'			=> $this->recaptcha_server,
+				'RECAPTCHA_PUBKEY'			=> isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '',
+				'RECAPTCHA_ERRORGET'		=> '',
+				'S_RECAPTCHA_AVAILABLE'		=> $this->is_available(),
+				'S_CONFIRM_CODE'			=> true,
+				'S_TYPE'					=> $this->type,
+			));
+
+			return 'captcha_recaptcha.html';
+		}
 	}
 
 	function get_demo_template($id)
-- 
cgit v1.2.1