<?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: A Hopefully Useful Tutorial For Using CakePHP&#8217;s Auth Component</title>
	<atom:link href="http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=rss</link>
	<description>Facebook should&#039;ve be written in unicornSchemaLang, because everyone *knows* that PHP is no good for anything, right?</description>
	<lastBuildDate>Mon, 15 Mar 2010 20:19:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
		<item>
		<title>By: Andy</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-13215</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:16:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-13215</guid>
		<description>Just a quick note that had me stumped for over an hour - the value of the &quot;controllers&quot; key in $this-&gt;Auth-&gt;loginAction *MUST* be in lower-case - i.e.  &quot;users&quot; NOT &quot;Users.&quot; 
 
When I did this, Auth was doing weird things - like writing the out the value of the *hashed* password back to the password field, and saying I was never authorised (whether the login was valid or not.) </description>
		<content:encoded><![CDATA[<p>Just a quick note that had me stumped for over an hour &#8211; the value of the &quot;controllers&quot; key in $this-&gt;Auth-&gt;loginAction *MUST* be in lower-case &#8211; i.e.  &quot;users&quot; NOT &quot;Users.&quot; </p>
<p>When I did this, Auth was doing weird things &#8211; like writing the out the value of the *hashed* password back to the password field, and saying I was never authorised (whether the login was valid or not.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: [PRONIQUE] CakePHP Developer Links</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-12413</link>
		<dc:creator>[PRONIQUE] CakePHP Developer Links</dc:creator>
		<pubDate>Thu, 23 Jul 2009 16:59:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-12413</guid>
		<description>[...] A Hopefully Useful Tutorial For Using CakePHP’s Auth Component — @TheKeyboard [...]</description>
		<content:encoded><![CDATA[<p>[...] A Hopefully Useful Tutorial For Using CakePHP’s Auth Component — @TheKeyboard [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cake php Auth tutorial &#124; Unconventional Lippolis</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-12396</link>
		<dc:creator>Cake php Auth tutorial &#124; Unconventional Lippolis</dc:creator>
		<pubDate>Fri, 10 Jul 2009 11:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-12396</guid>
		<description>[...] php Auth tutorial: http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-au...   Tags auth, authentication component, cakephp, tutorial Categories [...]</description>
		<content:encoded><![CDATA[<p>[...] php Auth tutorial: <a href="http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-au.." rel="nofollow">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-au..</a>.   Tags auth, authentication component, cakephp, tutorial Categories [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 20 de noviembre de 2008. De CakePHP 1.1 a CakePHP 1.2. El baile de los errores. Parte II &#171; Tutorial CakePHP informal, sobre la marcha. ¡Participa!</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-11017</link>
		<dc:creator>20 de noviembre de 2008. De CakePHP 1.1 a CakePHP 1.2. El baile de los errores. Parte II &#171; Tutorial CakePHP informal, sobre la marcha. ¡Participa!</dc:creator>
		<pubDate>Thu, 20 Nov 2008 10:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-11017</guid>
		<description>[...] Gracias a este enlace entendí para qué sirve cada uno de los atributos de la clase AuthComponent, y cómo se utilizan. [...]</description>
		<content:encoded><![CDATA[<p>[...] Gracias a este enlace entendí para qué sirve cada uno de los atributos de la clase AuthComponent, y cómo se utilizan. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 007</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10985</link>
		<dc:creator>007</dc:creator>
		<pubDate>Thu, 13 Nov 2008 10:12:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10985</guid>
		<description>i have a problem , i&#039;m a new to cakePHP,
when the user trying to login using the login form in the page: (mysite.com/users/login),  the login page is reloaded and the user isn&#039;t logged in.
Please help, i&#039;m trying that along the day,
(you didn&#039;t explain where to put some codes in this tutorial , for example the (isAuthorized) function,  this line too:
$this-&gt;Auth-&gt;authorize = &#039;controller&#039;; )
====================================
here is my controller: sermons_controller.php:

Auth-&gt;loginAction = array(&#039;controller&#039; =&gt; &#039;users&#039;, &#039;action&#039; =&gt; &#039;login&#039;);
		$this-&gt;Auth-&gt;loginRedirect = array(&#039;controller&#039; =&gt; &#039;sermons&#039;, &#039;action&#039; =&gt; &#039;index&#039;);
		$this-&gt;Auth-&gt;logoutRedirect = &#039;/&#039;;
		$this-&gt;Auth-&gt;loginError = &#039;Invalid username / password combination.  Please try again&#039;; 
	}

	function index() {
		$this-&gt;set(&#039;sermons&#039;, $this-&gt;Sermon-&gt;find(&#039;all&#039;));
	}
}
?&gt;
==========================================
and here is the users controller: users_controller.php:

Auth-&gt;user()) {
			if (!empty($this-&gt;data)) {
				if (empty($this-&gt;data[&#039;User&#039;][&#039;remember_me&#039;])) {
					$this-&gt;Cookie-&gt;del(&#039;User&#039;);
				}
				else {
					$cookie = array();
					$cookie[&#039;email&#039;] = $this-&gt;data[&#039;User&#039;][&#039;email&#039;];
					$cookie[&#039;token&#039;] = $this-&gt;data[&#039;User&#039;][&#039;pasword&#039;];
					$this-&gt;Cookie-&gt;write(&#039;User&#039;, $cookie, true, &#039;+2 weeks&#039;);
				}
				unset($this-&gt;data[&#039;User&#039;][&#039;remember_me&#039;]);
			}
			   $this-&gt;Auth-&gt;authorize = &#039;controller&#039;;


			$this-&gt;redirect($this-&gt;Auth-&gt;redirect());
		}
	}

	function isAuthorized() {
		if (isset($this-&gt;params[Configure::read(&#039;Routing.admin&#039;)])) {
			if ($this-&gt;Auth-&gt;user(&#039;admin&#039;) == 0) {
				return false;
			}
		}
		return true;
   }

	function logout() {
		$this-&gt;Session-&gt;setFlash(&quot;You&#039;ve successfully logged out.&quot;);
		$this-&gt;redirect($this-&gt;Auth-&gt;logout());
	}
}
?&gt;
==============================
sorry for my bad english</description>
		<content:encoded><![CDATA[<p>i have a problem , i&#8217;m a new to cakePHP,<br />
when the user trying to login using the login form in the page: (mysite.com/users/login),  the login page is reloaded and the user isn&#8217;t logged in.<br />
Please help, i&#8217;m trying that along the day,<br />
(you didn&#8217;t explain where to put some codes in this tutorial , for example the (isAuthorized) function,  this line too:<br />
$this-&gt;Auth-&gt;authorize = &#8216;controller&#8217;; )<br />
====================================<br />
here is my controller: sermons_controller.php:</p>
<p>Auth-&gt;loginAction = array(&#8216;controller&#8217; =&gt; &#8216;users&#8217;, &#8216;action&#8217; =&gt; &#8216;login&#8217;);<br />
		$this-&gt;Auth-&gt;loginRedirect = array(&#8216;controller&#8217; =&gt; &#8217;sermons&#8217;, &#8216;action&#8217; =&gt; &#8216;index&#8217;);<br />
		$this-&gt;Auth-&gt;logoutRedirect = &#8216;/&#8217;;<br />
		$this-&gt;Auth-&gt;loginError = &#8216;Invalid username / password combination.  Please try again&#8217;;<br />
	}</p>
<p>	function index() {<br />
		$this-&gt;set(&#8217;sermons&#8217;, $this-&gt;Sermon-&gt;find(&#8216;all&#8217;));<br />
	}<br />
}<br />
?&gt;<br />
==========================================<br />
and here is the users controller: users_controller.php:</p>
<p>Auth-&gt;user()) {<br />
			if (!empty($this-&gt;data)) {<br />
				if (empty($this-&gt;data['User']['remember_me'])) {<br />
					$this-&gt;Cookie-&gt;del(&#8216;User&#8217;);<br />
				}<br />
				else {<br />
					$cookie = array();<br />
					$cookie['email'] = $this-&gt;data['User']['email'];<br />
					$cookie['token'] = $this-&gt;data['User']['pasword'];<br />
					$this-&gt;Cookie-&gt;write(&#8216;User&#8217;, $cookie, true, &#8216;+2 weeks&#8217;);<br />
				}<br />
				unset($this-&gt;data['User']['remember_me']);<br />
			}<br />
			   $this-&gt;Auth-&gt;authorize = &#8216;controller&#8217;;</p>
<p>			$this-&gt;redirect($this-&gt;Auth-&gt;redirect());<br />
		}<br />
	}</p>
<p>	function isAuthorized() {<br />
		if (isset($this-&gt;params[Configure::read('Routing.admin')])) {<br />
			if ($this-&gt;Auth-&gt;user(&#8216;admin&#8217;) == 0) {<br />
				return false;<br />
			}<br />
		}<br />
		return true;<br />
   }</p>
<p>	function logout() {<br />
		$this-&gt;Session-&gt;setFlash(&#8220;You&#8217;ve successfully logged out.&#8221;);<br />
		$this-&gt;redirect($this-&gt;Auth-&gt;logout());<br />
	}<br />
}<br />
?&gt;<br />
==============================<br />
sorry for my bad english</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10854</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Sun, 19 Oct 2008 19:50:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10854</guid>
		<description>@Chris: Thanks!!</description>
		<content:encoded><![CDATA[<p>@Chris: Thanks!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hartjes</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10813</link>
		<dc:creator>Chris Hartjes</dc:creator>
		<pubDate>Wed, 08 Oct 2008 21:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10813</guid>
		<description>@Ivan

No, you can put all that stuff in beforeFilter() of your app_controller, and then in your controllers that inherit from it you can do this

function beforeFilter() {
     parent::beforeFilter()
}

You will have to have a beforeFilter() method in *every* controller though</description>
		<content:encoded><![CDATA[<p>@Ivan</p>
<p>No, you can put all that stuff in beforeFilter() of your app_controller, and then in your controllers that inherit from it you can do this</p>
<p>function beforeFilter() {<br />
     parent::beforeFilter()<br />
}</p>
<p>You will have to have a beforeFilter() method in *every* controller though</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10812</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Wed, 08 Oct 2008 21:51:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10812</guid>
		<description>Do I have to write all this code (the beforeFilter() method) in every controller I have? Or is there an easier / better way of doing this?</description>
		<content:encoded><![CDATA[<p>Do I have to write all this code (the beforeFilter() method) in every controller I have? Or is there an easier / better way of doing this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hartjes</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10792</link>
		<dc:creator>Chris Hartjes</dc:creator>
		<pubDate>Sun, 28 Sep 2008 07:11:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10792</guid>
		<description>@Kiran

The code in my login() method is to handle the use of a cookie for &quot;remember me&quot; functionality, that&#039;s all.  Having a completely empty login() method works just fine.</description>
		<content:encoded><![CDATA[<p>@Kiran</p>
<p>The code in my login() method is to handle the use of a cookie for &#8220;remember me&#8221; functionality, that&#8217;s all.  Having a completely empty login() method works just fine.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kiran aghor</title>
		<link>http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/comment-page-1/#comment-10791</link>
		<dc:creator>kiran aghor</dc:creator>
		<pubDate>Sat, 27 Sep 2008 15:21:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2007/09/11/a-hopefully-useful-tutorial-for-using-cakephps-auth-component/#comment-10791</guid>
		<description>I read cakephp 1.2 manual about authentication. They have kept login() method us users controller empty. U have some code in ur login method. Is ur code necessary? Any idea how Auth handles empty login() method?</description>
		<content:encoded><![CDATA[<p>I read cakephp 1.2 manual about authentication. They have kept login() method us users controller empty. U have some code in ur login method. Is ur code necessary? Any idea how Auth handles empty login() method?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->