<?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: Heavy duty password validation in CakePHP</title>
	<atom:link href="http://edwardawebb.com/programming/php-programming/cakephp/heavy-duty-password-validation-cakephp/feed/" rel="self" type="application/rss+xml" />
	<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp</link>
	<description>get all his digital goodness 24/7</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:05:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Validating Complex Passwords &#124; Edward A. Webb (.com)</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-46</link>
		<dc:creator>Validating Complex Passwords &#124; Edward A. Webb (.com)</dc:creator>
		<pubDate>Thu, 23 Oct 2008 00:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-46</guid>
		<description>[...] your using CakePHP, check out this article [...]</description>
		<content:encoded><![CDATA[<p>[...] your using CakePHP, check out this article [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-34</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 30 Sep 2008 01:06:12 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-34</guid>
		<description>I just had to do this myself but followed some other tutes so went a different route:

I placed treatment of the password, hashing and so forth in beforeSave().

Used a function placed in app_model to see if the passwords match:
http://bakery.cakephp.org/articles/view/using-equalto-validation-to-compare-two-form-fields

Then placed the regex for testing quality of the password in the validate rules:
&#039;password&#039;         =&gt; array(&#039;isRequired&#039; =&gt; array(&#039;rule&#039; =&gt; array(&#039;custom&#039;, &#039;/(?=^.{7,}$)((?=.*\d)&#124;(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/&#039;), 
                                                          &#039;required&#039; =&gt; true, 
                                                          &#039;allowEmpty&#039; =&gt; false, 
                                                          &#039;on&#039; =&gt; &#039;create&#039;, 
                                                          &#039;message&#039; =&gt; &#039;Password should be at least 7 characters, must have at least 1 upper case, lower case and numeric or special character.&#039;),
                                    &#039;identicalFieldValues&#039; =&gt; array(&#039;rule&#039; =&gt; array(&#039;identicalFieldValues&#039;, &#039;password_confirm&#039; ), 
                                                                    &#039;message&#039; =&gt; &#039;Passwords do not match.&#039;, 
                                                                    &#039;on&#039; =&gt; &#039;create&#039;))

Also used multiple validation sets which were handy:
http://snook.ca/archives/cakephp/multiple_validation_sets_cakephp/

Using 1.2, no auth component.</description>
		<content:encoded><![CDATA[<p>I just had to do this myself but followed some other tutes so went a different route:</p>
<p>I placed treatment of the password, hashing and so forth in beforeSave().</p>
<p>Used a function placed in app_model to see if the passwords match:<br />
<a href="http://bakery.cakephp.org/articles/view/using-equalto-validation-to-compare-two-form-fields" rel="nofollow">http://bakery.cakephp.org/articles/view/using-equalto-validation-to-compare-two-form-fields</a></p>
<p>Then placed the regex for testing quality of the password in the validate rules:<br />
&#8216;password&#8217;         =&gt; array(&#8216;isRequired&#8217; =&gt; array(&#8216;rule&#8217; =&gt; array(&#8216;custom&#8217;, &#8216;/(?=^.{7,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/&#8217;),<br />
                                                          &#8216;required&#8217; =&gt; true,<br />
                                                          &#8216;allowEmpty&#8217; =&gt; false,<br />
                                                          &#8216;on&#8217; =&gt; &#8216;create&#8217;,<br />
                                                          &#8216;message&#8217; =&gt; &#8216;Password should be at least 7 characters, must have at least 1 upper case, lower case and numeric or special character.&#8217;),<br />
                                    &#8216;identicalFieldValues&#8217; =&gt; array(&#8216;rule&#8217; =&gt; array(&#8216;identicalFieldValues&#8217;, &#8216;password_confirm&#8217; ),<br />
                                                                    &#8216;message&#8217; =&gt; &#8216;Passwords do not match.&#8217;,<br />
                                                                    &#8216;on&#8217; =&gt; &#8216;create&#8217;))</p>
<p>Also used multiple validation sets which were handy:<br />
<a href="http://snook.ca/archives/cakephp/multiple_validation_sets_cakephp/" rel="nofollow">http://snook.ca/archives/cakephp/multiple_validation_sets_cakephp/</a></p>
<p>Using 1.2, no auth component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-30</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Sun, 07 Sep 2008 20:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-30</guid>
		<description>Apologies:

A few poster comments were lost this last week due to a DB restore.

Please do not take offense, and re-post at will.</description>
		<content:encoded><![CDATA[<p>Apologies:</p>
<p>A few poster comments were lost this last week due to a DB restore.</p>
<p>Please do not take offense, and re-post at will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-24</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Sat, 23 Aug 2008 20:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-24</guid>
		<description>@Richard

This works on 1.1 or 1.2 
I&#039;m not sure I understand your meaning, the $validate variable in the models?  How would you match 2 passwords, check for a high-security pattern, and then finally hash? If you have a sweeter way, please share :)</description>
		<content:encoded><![CDATA[<p>@Richard</p>
<p>This works on 1.1 or 1.2<br />
I&#8217;m not sure I understand your meaning, the $validate variable in the models?  How would you match 2 passwords, check for a high-security pattern, and then finally hash? If you have a sweeter way, please share <img src='http://edwardawebb.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard@Home</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-16</link>
		<dc:creator>Richard@Home</dc:creator>
		<pubDate>Tue, 19 Aug 2008 14:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-16</guid>
		<description>Is this for CakePHP 1.1? The $validate methods for 1.2 are a lot cleaner :-)</description>
		<content:encoded><![CDATA[<p>Is this for CakePHP 1.1? The $validate methods for 1.2 are a lot cleaner <img src='http://edwardawebb.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-12</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Wed, 06 Aug 2008 12:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-12</guid>
		<description>@Daniel
Much appreciated! I&#039;ll make the change in my code and the post.</description>
		<content:encoded><![CDATA[<p>@Daniel<br />
Much appreciated! I&#8217;ll make the change in my code and the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Hofstetter</title>
		<link>http://edwardawebb.com/web-development/cakephp/heavy-duty-password-validation-cakephp/comment-page-1/#comment-11</link>
		<dc:creator>Daniel Hofstetter</dc:creator>
		<pubDate>Wed, 06 Aug 2008 12:52:23 +0000</pubDate>
		<guid isPermaLink="false">http://edwardawebb.com/?p=106#comment-11</guid>
		<description>When overriding a framework method, make sure to use the same method signature as the original method, otherwise you may get an unwanted effect ;-) In your case this means to use the following signature:

validates($options = array())</description>
		<content:encoded><![CDATA[<p>When overriding a framework method, make sure to use the same method signature as the original method, otherwise you may get an unwanted effect <img src='http://edwardawebb.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  In your case this means to use the following signature:</p>
<p>validates($options = array())</p>
]]></content:encoded>
	</item>
</channel>
</rss>

