<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[PunBB Forums - Forgot Password Flood Protection]]></title>
		<link>http://punbb.informer.com/forums/topic/21380/forgot-password-flood-protection/</link>
		<description><![CDATA[The most recent posts in Forgot Password Flood Protection.]]></description>
		<lastBuildDate>Wed, 25 Mar 2009 22:10:30 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Forgot Password Flood Protection]]></title>
			<link>http://punbb.informer.com/forums/post/126111/#p126111</link>
			<description><![CDATA[<p>I&#039;ll write this up for you real quick.</p><p>MySQL Query:<br /></p><div class="codebox"><pre><code>ALTER TABLE `users` ADD `last_pass_request` INT( 10 ) NOT NULL</code></pre></div><p>Open Login.php<br />Find:<br /></p><div class="codebox"><pre><code>        // Validate the email-address
        $email = strtolower(trim($_POST[&#039;req_email&#039;]));
        if (!is_valid_email($email))
            message($lang_common[&#039;Invalid e-mail&#039;]);</code></pre></div><p>Add after:<br /></p><div class="codebox"><pre><code>        $result = $db-&gt;query(&#039;SELECT 1 FROM &#039;.$db-&gt;prefix.&#039;users WHERE email=\&#039;&#039;.$db-&gt;escape($email).&#039;\&#039; AND last_pass_request&gt;&#039;.(time() - 3600)) or error(&#039;Unable to fetch user info&#039;, __FILE__, __LINE__, $db-&gt;error());
        if ($db-&gt;num_rows($result))
            message(&#039;A user has requested a new password too recently to send another.  Please wait an hour or contact an admistrator.&#039;);

        // Add the last password request for this email to the database
        $db-&gt;query(&#039;UPDATE users SET last_pass_request=&quot;&#039;.time().&#039;&quot; WHERE email=&quot;&#039;.$db-&gt;escape($email).&#039;&quot;&#039;) or error(&#039;Unable to add last password request info to the database&#039;, __FILE__, __LINE__, $db-&gt;error());</code></pre></div><p>I tested and it worked on my local server.&nbsp; Let me know if there are any problems.</p>]]></description>
			<author><![CDATA[dummy@example.com (Tieguy)]]></author>
			<pubDate>Wed, 25 Mar 2009 22:10:30 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/126111/#p126111</guid>
		</item>
		<item>
			<title><![CDATA[Forgot Password Flood Protection]]></title>
			<link>http://punbb.informer.com/forums/post/126033/#p126033</link>
			<description><![CDATA[<p>Does anyone have some code already in use to prevent forgot password flooding? </p><p>The way 1.2.x works now there is nothing that keeps someone from entering a users email over and over requesting a new password.</p>]]></description>
			<author><![CDATA[dummy@example.com (lush)]]></author>
			<pubDate>Tue, 24 Mar 2009 01:37:41 +0000</pubDate>
			<guid>http://punbb.informer.com/forums/post/126033/#p126033</guid>
		</item>
	</channel>
</rss>
