<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Blegs for help</title>
	<atom:link href="http://crookedtimber.org/2007/08/20/blegs-for-help/feed/" rel="self" type="application/rss+xml" />
	<link>http://crookedtimber.org/2007/08/20/blegs-for-help/</link>
	<description>Out of the crooked timber of humanity, no straight thing was ever made</description>
	<lastBuildDate>Sun, 22 Nov 2009 10:39:04 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: buermann</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207836</link>
		<dc:creator>buermann</dc:creator>
		<pubDate>Tue, 21 Aug 2007 03:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207836</guid>
		<description>Interesting.  If that &quot;#038;&quot; (which is encoding of an ampersand, &amp;) is actually in your code and not just what you posted that&#039;s the problem.</description>
		<content:encoded><![CDATA[	<p>Interesting.  If that &#8220;#038;&#8221; (which is encoding of an ampersand, &#38;) is actually in your code and not just what you posted that&#8217;s the problem.</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: buermann</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207835</link>
		<dc:creator>buermann</dc:creator>
		<pubDate>Tue, 21 Aug 2007 03:27:46 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207835</guid>
		<description>It should be 

WRONG_PASS() &amp;&amp;

not 

WRONG_PASS() &amp;&amp;

Assuming that isn&#039;t something introduced by the blog software...</description>
		<content:encoded><![CDATA[	<p>It should be</p>

	<p><span class="caps">WRONG</span>_PASS() &#038;&</p>

	<p>not</p>

	<p><span class="caps">WRONG</span>_PASS() &#38;&</p>

	<p>Assuming that isn&#8217;t something introduced by the blog software&#8230;</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: grackle</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207827</link>
		<dc:creator>grackle</dc:creator>
		<pubDate>Tue, 21 Aug 2007 01:58:46 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207827</guid>
		<description>I am confused.  If I click on the Yochai Benkler book event in the CT left margin, I am transported to the series of posts on that event.  What else did you lose?</description>
		<content:encoded><![CDATA[	<p>I am confused.  If I click on the Yochai Benkler book event in the CT left margin, I am transported to the series of posts on that event.  What else did you lose?</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207816</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Mon, 20 Aug 2007 20:35:18 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207816</guid>
		<description>update - problem solved (a directory screwup on my part ...)</description>
		<content:encoded><![CDATA[	<p>update &#8211; problem solved (a directory screwup on my part &#8230;)</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207814</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Mon, 20 Aug 2007 20:16:43 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207814</guid>
		<description>Hi Aaron - I tried that (someone else suggests it in the Talk page) but it doesn&#039;t seem to work for me for some reason. Perhaps something stupid I am doing (my knowledge of PHP is at the cargo-cult level).

bi - line 363 looks to be a comment line in my editor- I enclose the code for the 50-60 lines around it in case there is something obvious wrong.

function triggerUserLogin( $user, $password, $retval ) {
		global $wgCaptchaTriggers, $wgCaptchaBadLoginExpiration, $wgMemc;
		if( $retval == LoginForm::WRONG_PASS() &amp;&amp; $wgCaptchaTriggers[&#039;badlogin&#039;] ) {
			$key = $this-&gt;badLoginKey();
			$count = $wgMemc-&gt;get( $key );
			if( !$count ) {
				$wgMemc-&gt;add( $key, 0, $wgCaptchaBadLoginExpiration );
			}
			$count = $wgMemc-&gt;incr( $key );
		}
		return true;
	}
	
	/**
	 * Check if a bad login has already been registered for this
	 * IP address. If so, require a captcha.
	 * @return bool
	 * @access private
	 */
	function isBadLoginTriggered() {
		global $wgMemc;
		return intval( $wgMemc-&gt;get( $this-&gt;badLoginKey() ) ) &gt; 0;
	}
	
	/**
	 * Internal cache key for badlogin checks.
	 * @return string
	 * @access private
	 */
	function badLoginKey() {
		return wfMemcKey( &#039;captcha&#039;, &#039;badlogin&#039;, &#039;ip&#039;, wfGetIP() );
	}
	
	/**
	 * Check if the submitted form matches the captcha session data provided
	 * by the plugin when the form was generated.
	 *
	 * Override this!
	 *
	 * @param WebRequest $request
	 * @param array $info
	 * @return bool
	 */
	function keyMatch( $request, $info ) {
		return $request-&gt;getVal( &#039;wpCaptchaWord&#039; ) == $info[&#039;answer&#039;];
	}

	// ----------------------------------

	/**
	 * @param EditPage $editPage
	 * @param string $action (edit/create/addurl...)
	 * @return bool true if action triggers captcha on editPage&#039;s namespace
	 */
	function captchaTriggers( &amp;$editPage, $action) {
		global $wgCaptchaTriggers, $wgCaptchaTriggersOnNamespace;	
		//Special config for this NS?
		if (isset( $wgCaptchaTriggersOnNamespace[$editPage-&gt;mTitle-&gt;getNamespace()][$action] ) )
			return $wgCaptchaTriggersOnNamespace[$editPage-&gt;mTitle-&gt;getNamespace()][$action];

		return ( !empty( $wgCaptchaTriggers[$action] ) ); //Default
	}</description>
		<content:encoded><![CDATA[	<p>Hi Aaron &#8211; I tried that (someone else suggests it in the Talk page) but it doesn&#8217;t seem to work for me for some reason. Perhaps something stupid I am doing (my knowledge of <span class="caps">PHP</span> is at the cargo-cult level).</p>

	<p>bi &#8211; line 363 looks to be a comment line in my editor- I enclose the code for the 50-60 lines around it in case there is something obvious wrong.</p>

	<p>function triggerUserLogin( $user, $password, $retval ) {<br />
global $wgCaptchaTriggers, $wgCaptchaBadLoginExpiration, $wgMemc;<br />
if( $retval  LoginForm::WRONG_PASS() &amp;#038;&#38; $wgCaptchaTriggers['badlogin'] ) {<br />
$key = $this-&gt;badLoginKey();<br />
$count = $wgMemc-&gt;get( $key );<br />
if( !$count ) {<br />
$wgMemc-&gt;add( $key, 0, $wgCaptchaBadLoginExpiration );<br />
}</p>
	<p>$count = $wgMemc-&gt;incr( $key );<br />
}</p>
	<p>return true;<br />
}</p>

	<p>/**</p>
	<ul>
		<li>Check if a bad login has already been registered for this</li>
		<li>IP address. If so, require a captcha.</li>
		<li>@return bool</li>
		<li>@access private</li>
	</ul>
	<p>*/<br />
function isBadLoginTriggered() {<br />
global $wgMemc;<br />
return intval( $wgMemc-&gt;get( $this-&gt;badLoginKey() ) ) &gt; 0;<br />
}</p>

	<p>/**</p>
	<ul>
		<li>Internal cache key for badlogin checks.</li>
		<li>@return string</li>
		<li>@access private</li>
	</ul>
	<p>*/<br />
function badLoginKey() {<br />
return wfMemcKey( &#8216;captcha&#8217;, &#8216;badlogin&#8217;, &#8216;ip&#8217;, wfGetIP() );<br />
}</p>

	<p>/**</p>
	<ul>
		<li>Check if the submitted form matches the captcha session data provided</li>
		<li>by the plugin when the form was generated.</li>
	</ul>
	<p>*</p>
	<ul>
		<li>Override this!</li>
	</ul>
	<p>*</p>
	<ul>
		<li>@param WebRequest $request</li>
		<li>@param array $info</li>
		<li>@return bool</li>
	</ul>
	<p>*/<br />
function keyMatch( $request, $info ) {<br />
return $request-&gt;getVal( &#8216;wpCaptchaWord&#8217; )  $info[&#8216;answer&#8217;];<br />
}</p>

	<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
/**</p>
	<ul>
		<li>@param EditPage $editPage</li>
		<li>@param string $action (edit/create/addurl&#8230;)</li>
		<li>@return bool true if action triggers captcha on editPage&#8217;s namespace</li>
	</ul>
	<p>*/<br />
function captchaTriggers( &#038;$editPage, $action) {<br />
global $wgCaptchaTriggers, $wgCaptchaTriggersOnNamespace;<br />
//Special config for this NS?<br />
if (isset( $wgCaptchaTriggersOnNamespace[$editPage->mTitle->getNamespace()][$action] ) )<br />
return $wgCaptchaTriggersOnNamespace[$editPage->mTitle->getNamespace()][$action];</p>

	<p>return ( !empty( $wgCaptchaTriggers[$action] ) ); //Default<br />
}</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron Swartz</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207813</link>
		<dc:creator>Aaron Swartz</dc:creator>
		<pubDate>Mon, 20 Aug 2007 19:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207813</guid>
		<description>It appears you can make this problem go away by replacing the two instances of &lt;code&gt;LoginForm::WRONG_PASS&lt;/code&gt; with &lt;code&gt;LoginForm::WRONG_PASS()&lt;/code&gt; (i.e. add a &lt;code&gt;()&lt;/code&gt; on the end. This worked for me in PHP 4.4.4</description>
		<content:encoded><![CDATA[	<p>It appears you can make this problem go away by replacing the two instances of <code>LoginForm::WRONG_PASS</code> with <code>LoginForm::WRONG_PASS()</code> (i.e. add a <code>()</code> on the end. This worked for me in <span class="caps">PHP 4</span>.4.4</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: bi</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207810</link>
		<dc:creator>bi</dc:creator>
		<pubDate>Mon, 20 Aug 2007 19:39:35 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207810</guid>
		<description>What is inside ConfirmEdit.php around line 363?</description>
		<content:encoded><![CDATA[	<p>What is inside ConfirmEdit.php around line 363?</p>
 ]]></content:encoded>
	</item>
	<item>
		<title>By: norbizness</title>
		<link>http://crookedtimber.org/2007/08/20/blegs-for-help/comment-page-1/#comment-207809</link>
		<dc:creator>norbizness</dc:creator>
		<pubDate>Mon, 20 Aug 2007 19:18:13 +0000</pubDate>
		<guid isPermaLink="false">http://crookedtimber.org/2007/08/20/blegs-for-help/#comment-207809</guid>
		<description>Do what now?</description>
		<content:encoded><![CDATA[	<p>Do what now?</p>
 ]]></content:encoded>
	</item>
</channel>
</rss>
