<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Directory Blog &#187; recaptcha</title>
	<atom:link href="http://blog.webdirectory.si/tag/recaptcha/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.webdirectory.si</link>
	<description>Blog of WebDirectory.si web and link directory</description>
	<lastBuildDate>Thu, 17 Jun 2010 11:43:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use reCaptcha in phpBB3 tutorial protect automatic registration</title>
		<link>http://blog.webdirectory.si/internet/use-recaptcha-in-phpbb3-tutorial-protect-automatic-registration/</link>
		<comments>http://blog.webdirectory.si/internet/use-recaptcha-in-phpbb3-tutorial-protect-automatic-registration/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 13:07:58 +0000</pubDate>
		<dc:creator>arisd</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[phpBB]]></category>
		<category><![CDATA[phpBB3]]></category>
		<category><![CDATA[recaptcha]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://blog.webdirectory.si/?p=46</guid>
		<description><![CDATA[Some of my customers use phpBB3 forum and they started to get automated logins and their forums were hacked and some posts were written. I found interesting webpage about how to use reCaptcha with phpBB3 so i wrote this tutorial. It works with template prosilver and example pictures are also in prosilver.
At first you will [...]]]></description>
			<content:encoded><![CDATA[<p>Some of my customers use phpBB3 forum and they started to get automated logins and their forums were hacked and some posts were written. I found interesting webpage about how to use reCaptcha with phpBB3 so i wrote this tutorial. It works with template prosilver and example pictures are also in prosilver.</p>
<p>At first you will need FREE reCAPTCHA PHP plugin /(recaptcha-php-1.10.zip &#8211; reCAPTCHA Library for PHP &#8211; v1.10), available at <a title="recaptcha download" href="http://code.google.com/p/recaptcha/downloads/list " target="_blank">Google download reCAPTCHA Library for PHP.</a> After that you will have to get public and private key for use with reCaptcha. Link: <a rel="nofollow" href="http://recaptcha.net/api/getkey" target="_blank">http://recaptcha.net/api/getkey</a> <a rel="nofollow" href="http://code.google.com/p/recaptcha/downloads/list" target="_blank"></a></p>
<p>Extract the file &#8216;recaptchalib.php&#8217; and place it in:<br />
%phpbb_root_path%/includes/captcha</p>
<p>First we must modify code in template file (<strong>%phpbb_root_path%/styles/prosilver/template/ucp_register.html</strong>)</p>
<p>Locate code <strong>&lt;dd&gt;{CONFIRM_IMG}&lt;/dd&gt; </strong>and delete the following lines of code or comment them out:<br />
<strong>&lt;dd&gt;&lt;input type=&#8221;text&#8221; name=&#8221;confirm_code&#8221; id=&#8221;confirm_code&#8221; size=&#8221;8&#8243;<br />
maxlength=&#8221;8&#8243; class=&#8221;inputbox narrow&#8221; title=&#8221;{L_CONFIRM_CODE}&#8221; /&gt;&lt;/dd&gt;<br />
&lt;dd&gt;{L_CONFIRM_CODE_EXPLAIN}&lt;/dd&gt; </strong></p>
<div id="attachment_48" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.webdirectory.si/wp-content/uploads/2009/01/phpbb3-recaptcha-addon-step11.gif"><img class="size-medium wp-image-48" title="Edited ucp_register.html" src="http://blog.webdirectory.si/wp-content/uploads/2009/01/phpbb3-recaptcha-addon-step11-300x51.gif" alt="Part code of File ucp_register.html will look like" width="300" height="51" /></a><p class="wp-caption-text">Part code of File ucp_register.html will look like</p></div>
<p>In file <strong>%phpbb_root_path%/includes/ucp/ucp_register.php</strong> there will be more changes so lets get to it.</p>
<p>Step 1. Place  (add) code <strong>require_once($phpbb_root_path . &#8216;includes/captcha/recaptchalib.&#8217; .<br />
$phpEx);</strong> before the line &#8220;<strong>class ucp_register,</strong>&#8221; which is almost on top of ucp_register.php file.</p>
<p>If your phpBB is on unix you should use server <strong>include_once(&#8230;</strong> instead of <strong>require_once(&#8230; </strong><em>(Typo was so friendly to let me know about errors in his log file when using this tutorial &#8211; and a solution to this problem).</em><strong><br />
</strong></p>
<p>Step 2. Place code</p>
<p><strong>$publickey = &#8221;;<br />
$privatekey = &#8221;;<br />
</strong></p>
<p><strong>$resp = null;<br />
$error = null; </strong></p>
<p>after the line &#8220;<strong>global $config, $db, $user,<br />
$auth, $template, $phpbb_root_path, $phpEx;</strong>&#8221;</p>
<p>Step 3. Place code <strong>$confirm_id = (isset($_POST['recaptcha_response_field']));</strong> on the line &#8220;<strong>$confirm_id = request_var(&#8217;confirm_id&#8217;, &#8221;);</strong>&#8220;. Simply replace code.</p>
<div id="attachment_49" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.webdirectory.si/wp-content/uploads/2009/01/step-1-2-3-code-for-phpbb3-captcha.gif"><img class="size-medium wp-image-49" title="Step-1-2-3 of captcha integration in ucp_register.php" src="http://blog.webdirectory.si/wp-content/uploads/2009/01/step-1-2-3-code-for-phpbb3-captcha-300x282.gif" alt="Edited code of ucp_register.php file" width="300" height="282" /></a><p class="wp-caption-text">Edited code of ucp_register.php file</p></div>
<p>Step 4. Comment out or delete the following line of code <strong>&#8216;confirm_code&#8217;  =&gt; array(&#8217;string&#8217;, !$config['enable_confirm'], 5, 8), </strong></p>
<p>Step 5. Go to the section</p>
<p><strong>// Visual Confirmation handling </strong></p>
<p><strong> $wrong_confirm = false;</strong></p>
<p><strong>if (!$confirm_id)<br />
{<br />
$error[] = $user-&gt;lang['CONFIRM_CODE_WRONG'];<br />
$wrong_confirm = true;<br />
}<br />
else<br />
{</strong></p>
<p>Delete all code within the first else statement (which has also nested if and else statements within it) and replace with next code:</p>
<p><strong>$resp = recaptcha_check_answer ($privatekey,<br />
$_SERVER["REMOTE_ADDR"],<br />
</strong></p>
<p><strong>$_POST["recaptcha_challenge_field"],<br />
</strong></p>
<p><strong>$_POST["recaptcha_response_field"]);<br />
</strong></p>
<p><strong>if ($resp-&gt;is_valid == false) {<br />
$error[] = $user-&gt;lang['CONFIRM_CODE_WRONG'];<br />
$wrong_confirm = true; }</strong></p>
<div id="attachment_50" class="wp-caption alignnone" style="width: 245px"><a href="http://blog.webdirectory.si/wp-content/uploads/2009/01/delete-and-replace-code-in-phpbb3.gif"><img class="size-medium wp-image-50" title="delete-and-replace-code-in-phpbb3" src="http://blog.webdirectory.si/wp-content/uploads/2009/01/delete-and-replace-code-in-phpbb3-235x300.gif" alt="Next step replace code in Visual confirmation handling" width="235" height="300" /></a><p class="wp-caption-text">Next step replace code in Visual confirmation handling</p></div>
<p>Step 6. Comment out or delete everything between the following two<br />
lines of code (including first ans last line (delete approx. 13 linex of php code):</p>
<p>First line of code: <strong>$code = gen_rand_string(mt_rand(5, 8)); </strong></p>
<p>Last line of code: <strong>$db-&gt;sql_query($sql);</strong></p>
<p>Step 7. A few lines after the end of Step 6, replace &#8220;$<strong>confirm_image = &#8216;&lt;img src=&#8221;&#8216; . append_sid(&#8221;{$phpbb_root_path}ucp.$phpEx&#8221;, &#8216;mode=confirm&amp;amp;id=&#8217; . $confirm_id . &#8216;&amp;amp;type=&#8217; . CONFIRM_REG . $str) . &#8216;&#8221; alt=&#8221;" title=&#8221;" /&gt;&#8217;;</strong>&#8220;with the following line of code: <strong>$confirm_image = recaptcha_get_html($publickey, $error); </strong></p>
<div id="attachment_51" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.webdirectory.si/wp-content/uploads/2009/01/recaptcha-addon-replace-lines-in-phpbb3-forum.gif"><img class="size-medium wp-image-51" title="recaptcha-addon-replace-lines-in-phpbb3-forum" src="http://blog.webdirectory.si/wp-content/uploads/2009/01/recaptcha-addon-replace-lines-in-phpbb3-forum-300x190.gif" alt="Last changes of code in ucp_register.php" width="300" height="190" /></a><p class="wp-caption-text">Last changes of code in ucp_register.php</p></div>
<p>Step 8. Upload both changed files in appropriate folder over ftp on your <a title="server" href="http://www.slohost.net" target="_blank">web server</a> and don&#8217;t forget to flush cache in Administration panel of <a title="MaleZivali forum" href="http://www.malezivali.com/forum" target="_blank">forum</a> for templates &#8211; else it won&#8217;t work &#8211; something like: Templates &#8211; Themes &#8211; Refresh action.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.webdirectory.si/internet/use-recaptcha-in-phpbb3-tutorial-protect-automatic-registration/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
