<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP User-Group Philippines &#187; PHP</title>
	<atom:link href="http://www.phpugph.com/blog/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpugph.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 23 Dec 2009 04:00:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use AuthComponent in Cakephp 1.2</title>
		<link>http://www.phpugph.com/blog/2008/06/17/how-i-use-authcomponent-in-cakephp-12/</link>
		<comments>http://www.phpugph.com/blog/2008/06/17/how-i-use-authcomponent-in-cakephp-12/#comments</comments>
		<pubDate>Tue, 17 Jun 2008 13:01:21 +0000</pubDate>
		<dc:creator>phpcurious</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[cakephp 1.2]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Frameworks]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.phpugph.com/blog/?p=41</guid>
		<description><![CDATA[How do you use AuthComponent and AclComponent to authenticate users? On app_controller.php,
put this code:
&#60;?php
class AppController extends Controller {
var $components = array(&#8217;Acl&#8217;,'Auth&#8217;,'Cookie&#8217;,'Session&#8217;);
function beforeFilter()  {
$this-&#62;Auth-&#62;loginAction = &#8216;/users/login&#8217;;
$this-&#62;Auth-&#62;loginRedirect = &#8216;/questions/Various-Topics&#8217;;
$this-&#62;Auth-&#62;authorize = &#8216;actions&#8217;;
}
?&#62;

and, on every controller, create a beforeFilter function and put this :
function beforeFilter()  {
//var_dump($this-&#62;params);
this-&#62;Auth-&#62;allow(&#8217;action1&#8242;,&#8217;action2&#8242;);
parent::beforeFilter();
}
Note, however , since AuthComponent is authenticating users based on controller actions [...]]]></description>
			<content:encoded><![CDATA[<p>How do you use AuthComponent and AclComponent to authenticate users? On app_controller.php,<br />
put this code:</p>
<div style="#FFFFFF;">&lt;?php</p>
<p>class AppController extends Controller {</p>
<p>var $components = array(&#8217;Acl&#8217;,'Auth&#8217;,'Cookie&#8217;,'Session&#8217;);</p>
<p>function beforeFilter()  {</p>
<p>$this-&gt;Auth-&gt;loginAction = &#8216;/users/login&#8217;;<br />
$this-&gt;Auth-&gt;loginRedirect = &#8216;/questions/Various-Topics&#8217;;</p>
<p>$this-&gt;Auth-&gt;authorize = &#8216;actions&#8217;;</p>
<p>}</p>
<p>?&gt;</p>
</div>
<p>and, on every controller, create a beforeFilter function and put this :</p>
<div style="#FFFFFF;">function beforeFilter()  {<br />
//var_dump($this-&gt;params);<br />
this-&gt;Auth-&gt;allow(&#8217;action1&#8242;,&#8217;action2&#8242;);<br />
parent::beforeFilter();<br />
}</div>
<p><span style="line-through;">Note, however , since AuthComponent is authenticating users based on controller actions with Acl, you will have to build your own cake acl too.</span></p>
<p>PS. Thanks to ditchx and primerg for the help!</p>
<div id="facebook_like"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.phpugph.com%2Fblog%2F2008%2F06%2F17%2Fhow-i-use-authcomponent-in-cakephp-12%2F&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:auto;"></iframe></div>]]></content:encoded>
			<wfw:commentRss>http://www.phpugph.com/blog/2008/06/17/how-i-use-authcomponent-in-cakephp-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
