<?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 for Blue Horn Ltd</title>
	<atom:link href="http://bluehorn.co.nz/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://bluehorn.co.nz</link>
	<description>New Zealand System Development Company (PHP 5, MySQL, Symfony Framework, Apache, Linux)</description>
	<lastBuildDate>Wed, 24 Feb 2010 04:13:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Symfony 1.2 sfForm formatter to add stars on required fields by Gareth</title>
		<link>http://bluehorn.co.nz/2009/08/31/symfony-12-sfform-formatter-to-add-stars-on-required-fields/comment-page-1/#comment-2711</link>
		<dc:creator>Gareth</dc:creator>
		<pubDate>Wed, 24 Feb 2010 04:13:26 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=290#comment-2711</guid>
		<description>Just wondering if there was some way in the Form class to just add specific row formatting for 1 or 2 elements as this is unique to just this form, instead of having to create an entire decorator class to handle it.</description>
		<content:encoded><![CDATA[<p>Just wondering if there was some way in the Form class to just add specific row formatting for 1 or 2 elements as this is unique to just this form, instead of having to create an entire decorator class to handle it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Symfony 1.2, Propel, and sfGuardPlugin: email login by Hardeep Khehra</title>
		<link>http://bluehorn.co.nz/2009/06/12/symfony-12-propel-and-sfguardplugin-email-login/comment-page-1/#comment-2680</link>
		<dc:creator>Hardeep Khehra</dc:creator>
		<pubDate>Mon, 22 Feb 2010 02:14:05 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=251#comment-2680</guid>
		<description>&lt;a href=&quot;#comment-2659&quot; rel=&quot;nofollow&quot;&gt;@YH &lt;/a&gt; 
There is a much easier way to do this.  I usually allow logins by email &amp; username since the user may remember one or the other more easily.

in your generated lib/model/doctrine/sfGuardUserTable.php  add the following method:

  public function retrieveByUsername($username, $isActive = true)
  {
    $query = Doctrine::getTable(&#039;sfGuardUser&#039;)-&gt;createQuery(&#039;u&#039;)
      -&gt;leftJoin(&#039;u.Profile p&#039;)
      -&gt;where(&#039;u.username = ?&#039;, $username)
      -&gt;orWhere(&#039;p.email = ?&#039;, $username)
      -&gt;addWhere(&#039;u.is_active = ?&#039;, $isActive)
    ;

    return $query-&gt;fetchOne();
  }


Thats it.. now your users can log in via email or via username.  You can adjust the Doctrine query to your liking if you only want to allow emails.

sfDoctrineGuardPlugin calls that method from the validator, but you are just overriding it with a custom query. 

from plugin documentation:

Validators
sfDoctrineGuardPlugin comes with a validator that you can use in your modules: sfGuardUserValidator.

This validator is used by the sfGuardAuth module to validate a user and password and automatically signin the user.</description>
		<content:encoded><![CDATA[<p><a href="#comment-2659" rel="nofollow">@YH </a><br />
There is a much easier way to do this.  I usually allow logins by email &amp; username since the user may remember one or the other more easily.</p>
<p>in your generated lib/model/doctrine/sfGuardUserTable.php  add the following method:</p>
<p>  public function retrieveByUsername($username, $isActive = true)<br />
  {<br />
    $query = Doctrine::getTable(&#8217;sfGuardUser&#8217;)-&gt;createQuery(&#8216;u&#8217;)<br />
      -&gt;leftJoin(&#8216;u.Profile p&#8217;)<br />
      -&gt;where(&#8216;u.username = ?&#8217;, $username)<br />
      -&gt;orWhere(&#8216;p.email = ?&#8217;, $username)<br />
      -&gt;addWhere(&#8216;u.is_active = ?&#8217;, $isActive)<br />
    ;</p>
<p>    return $query-&gt;fetchOne();<br />
  }</p>
<p>Thats it.. now your users can log in via email or via username.  You can adjust the Doctrine query to your liking if you only want to allow emails.</p>
<p>sfDoctrineGuardPlugin calls that method from the validator, but you are just overriding it with a custom query. </p>
<p>from plugin documentation:</p>
<p>Validators<br />
sfDoctrineGuardPlugin comes with a validator that you can use in your modules: sfGuardUserValidator.</p>
<p>This validator is used by the sfGuardAuth module to validate a user and password and automatically signin the user.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Symfony 1.2, Propel, and sfGuardPlugin: email login by YH</title>
		<link>http://bluehorn.co.nz/2009/06/12/symfony-12-propel-and-sfguardplugin-email-login/comment-page-1/#comment-2659</link>
		<dc:creator>YH</dc:creator>
		<pubDate>Sat, 20 Feb 2010 04:32:26 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=251#comment-2659</guid>
		<description>Good tutorial. but it use with propel. so can u show some tips use with doctrine. i need integrate it with doctrine. i can&#039;t find solution use with doctrine. anyone can help.
thanks</description>
		<content:encoded><![CDATA[<p>Good tutorial. but it use with propel. so can u show some tips use with doctrine. i need integrate it with doctrine. i can&#8217;t find solution use with doctrine. anyone can help.<br />
thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Symfony 1.2 sfForm formatter to add stars on required fields by Sid</title>
		<link>http://bluehorn.co.nz/2009/08/31/symfony-12-sfform-formatter-to-add-stars-on-required-fields/comment-page-1/#comment-2317</link>
		<dc:creator>Sid</dc:creator>
		<pubDate>Mon, 18 Jan 2010 11:06:21 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=290#comment-2317</guid>
		<description>&lt;a href=&quot;#comment-1699&quot; rel=&quot;nofollow&quot;&gt;@Antoine&lt;/a&gt; 

Thanks :)</description>
		<content:encoded><![CDATA[<p><a href="#comment-1699" rel="nofollow">@Antoine</a> </p>
<p>Thanks :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to handle dot in Symfony URL by Sid</title>
		<link>http://bluehorn.co.nz/2008/12/04/how-to-handle-dot-in-symfony-url/comment-page-1/#comment-2316</link>
		<dc:creator>Sid</dc:creator>
		<pubDate>Mon, 18 Jan 2010 11:05:02 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=77#comment-2316</guid>
		<description>&lt;a href=\#comment-1891\ rel=\nofollow\ rel=&quot;nofollow&quot;&gt;@Martin&lt;/a&gt; 

Thanks for leaving a comment :)</description>
		<content:encoded><![CDATA[<p><a href=\#comment-1891\ rel=\nofollow\ rel="nofollow">@Martin</a> </p>
<p>Thanks for leaving a comment :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to handle dot in Symfony URL by Martin</title>
		<link>http://bluehorn.co.nz/2008/12/04/how-to-handle-dot-in-symfony-url/comment-page-1/#comment-1891</link>
		<dc:creator>Martin</dc:creator>
		<pubDate>Mon, 14 Dec 2009 11:47:49 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=77#comment-1891</guid>
		<description>Thanks!
This post was very helpful to solve my problem.

Greetings from Germany</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
This post was very helpful to solve my problem.</p>
<p>Greetings from Germany</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to add a captcha field in Symfony 1.1 by Sid</title>
		<link>http://bluehorn.co.nz/2009/02/05/how-to-add-a-captcha-field-in-symfony-11/comment-page-1/#comment-1882</link>
		<dc:creator>Sid</dc:creator>
		<pubDate>Sun, 13 Dec 2009 23:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=180#comment-1882</guid>
		<description>&lt;a href=&quot;#comment-1881&quot; rel=&quot;nofollow&quot;&gt;@jayz&lt;/a&gt; 

Hi Jayz, 

First of all, this is a guide for Symfony 1.1, not 1.3. I have not tested it on other versions of Symfony. So I don&#039;t know if it&#039;s working on 1.3.

Secondly, this is not a guide for Admin/CRUD generated forms. This is a guide for those who build their forms manually using sfForm.

But to answer your question:

$values is the tainted values, the values from the request object.

For example:

$values = $request-&gt;getParameters(&#039;user&#039;);

Merry Christmas and happy coding :)</description>
		<content:encoded><![CDATA[<p><a href="#comment-1881" rel="nofollow">@jayz</a> </p>
<p>Hi Jayz, </p>
<p>First of all, this is a guide for Symfony 1.1, not 1.3. I have not tested it on other versions of Symfony. So I don&#8217;t know if it&#8217;s working on 1.3.</p>
<p>Secondly, this is not a guide for Admin/CRUD generated forms. This is a guide for those who build their forms manually using sfForm.</p>
<p>But to answer your question:</p>
<p>$values is the tainted values, the values from the request object.</p>
<p>For example:</p>
<p>$values = $request-&gt;getParameters(&#8216;user&#8217;);</p>
<p>Merry Christmas and happy coding :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to add a captcha field in Symfony 1.1 by jayz</title>
		<link>http://bluehorn.co.nz/2009/02/05/how-to-add-a-captcha-field-in-symfony-11/comment-page-1/#comment-1881</link>
		<dc:creator>jayz</dc:creator>
		<pubDate>Sun, 13 Dec 2009 22:53:45 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=180#comment-1881</guid>
		<description>This doesn&#039;t work for me at all. I am using symfony 1.3. Could you please explain what is $values in part 4.</description>
		<content:encoded><![CDATA[<p>This doesn&#8217;t work for me at all. I am using symfony 1.3. Could you please explain what is $values in part 4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Symfony 1.2 sfForm formatter to add stars on required fields by Antoine</title>
		<link>http://bluehorn.co.nz/2009/08/31/symfony-12-sfform-formatter-to-add-stars-on-required-fields/comment-page-1/#comment-1699</link>
		<dc:creator>Antoine</dc:creator>
		<pubDate>Mon, 16 Nov 2009 02:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=290#comment-1699</guid>
		<description>Well done !</description>
		<content:encoded><![CDATA[<p>Well done !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Symfony 1.2, Propel, and sfGuardPlugin: email login by Scott</title>
		<link>http://bluehorn.co.nz/2009/06/12/symfony-12-propel-and-sfguardplugin-email-login/comment-page-1/#comment-1471</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 13 Oct 2009 17:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://bluehorn.co.nz/?p=251#comment-1471</guid>
		<description>Thanks for this clear, concise, informative tutorial.  Very helpful!</description>
		<content:encoded><![CDATA[<p>Thanks for this clear, concise, informative tutorial.  Very helpful!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
