<?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 Phillip Napieralski</title>
	<atom:link href="http://blog.pnapieralski.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pnapieralski.com</link>
	<description>Programmer, Engineer, Researcher.</description>
	<lastBuildDate>Tue, 03 Aug 2010 14:25:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Migrating from CakePHP 1.2.7 to 1.3 by Lapinski</title>
		<link>http://blog.pnapieralski.com/php/cakephp/migrating-from-cakephp-1-2-to-1-3/comment-page-1/#comment-845</link>
		<dc:creator>Lapinski</dc:creator>
		<pubDate>Tue, 03 Aug 2010 14:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=38#comment-845</guid>
		<description>I also tried to migrate to 1.3.

I used some logic in beforeValidate() to determine if the data gonna saved should be an update or an insert, if update then set $model-&gt;id.   It worked perfectly for 1.2, but not in 1.3.  So I guess the 1.3 CakePHP team assumes you have to know whether it&#039;s an update or insert before you call validate/save.</description>
		<content:encoded><![CDATA[<p>I also tried to migrate to 1.3.</p>
<p>I used some logic in beforeValidate() to determine if the data gonna saved should be an update or an insert, if update then set $model-&gt;id.   It worked perfectly for 1.2, but not in 1.3.  So I guess the 1.3 CakePHP team assumes you have to know whether it&#8217;s an update or insert before you call validate/save.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Setup MongoDB PHP Extension on Shared Hosting by Jorge</title>
		<link>http://blog.pnapieralski.com/mongodb/how-to-setup-mongodb-php-extension-on-shared-hosting/comment-page-1/#comment-824</link>
		<dc:creator>Jorge</dc:creator>
		<pubDate>Sat, 31 Jul 2010 00:58:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=57#comment-824</guid>
		<description>Yes it&#039;s true

I am thinking start a mongo database server on demand of a php script

thanks for the answer</description>
		<content:encoded><![CDATA[<p>Yes it&#8217;s true</p>
<p>I am thinking start a mongo database server on demand of a php script</p>
<p>thanks for the answer</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Phillip Napieralski</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-803</link>
		<dc:creator>Phillip Napieralski</dc:creator>
		<pubDate>Sun, 25 Jul 2010 05:24:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-803</guid>
		<description>Hey amruth,

What you could do in that case is check the group name inside the login() method.

Here&#039;s an example that might work:
Change this code in the login() method
[sourcecode lang=&quot;php&quot;]
$this-&gt;Redirect(array(&#039;controller&#039; =&gt; &#039;Controller_name&#039;, &#039;action&#039; =&gt; &#039;Action_name&#039;));
exit();
[/sourcecode]
to something like
[sourcecode lang=&quot;php&quot;]
// Use the user variable returned from the validate login function
if ($user[&#039;Group&#039;][&#039;name&#039;] == &#039;admin&#039;) {
$this-&gt;Redirect(array(&#039;controller&#039; =&gt; &#039;ControllerName&#039;, &#039;action&#039; =&gt; &#039;AdminActionName&#039;));
} else {
$this-&gt;Redirect(array(&#039;controller&#039; =&gt; &#039;SomeOtherControllerMaybe&#039;, &#039;action&#039; =&gt; &#039;UserAction&#039;));
}
[/sourcecode]
Finally change the &#039;find&#039; in validateLogin function in the model to
[sourcecode lang=&quot;php&quot;]
$user = $this-&gt;find(array(&#039;username&#039; =&gt; $data[&#039;username&#039;], &#039;password&#039; =&gt; $data[&#039;password&#039;]), array(&#039;id&#039;, &#039;username&#039;, &#039;Group.name&#039;));
[/sourcecode]

You would also want to make sure that a normal user can&#039;t access an admin page by typing it in the url.</description>
		<content:encoded><![CDATA[<p>Hey amruth,</p>
<p>What you could do in that case is check the group name inside the login() method.</p>
<p>Here&#8217;s an example that might work:<br />
Change this code in the login() method</p>
<pre class="brush: php;">
$this-&gt;Redirect(array('controller' =&gt; 'Controller_name', 'action' =&gt; 'Action_name'));
exit();
</pre>
<p>to something like</p>
<pre class="brush: php;">
// Use the user variable returned from the validate login function
if ($user['Group']['name'] == 'admin') {
$this-&gt;Redirect(array('controller' =&gt; 'ControllerName', 'action' =&gt; 'AdminActionName'));
} else {
$this-&gt;Redirect(array('controller' =&gt; 'SomeOtherControllerMaybe', 'action' =&gt; 'UserAction'));
}
</pre>
<p>Finally change the &#8216;find&#8217; in validateLogin function in the model to</p>
<pre class="brush: php;">
$user = $this-&gt;find(array('username' =&gt; $data['username'], 'password' =&gt; $data['password']), array('id', 'username', 'Group.name'));
</pre>
<p>You would also want to make sure that a normal user can&#8217;t access an admin page by typing it in the url.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by amruth</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-802</link>
		<dc:creator>amruth</dc:creator>
		<pubDate>Sat, 24 Jul 2010 20:21:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-802</guid>
		<description>i need to make authentication for two different users......one for user(when logged in should be directed to user page) and another for admin(directed to admin page). pls help me out. thanks</description>
		<content:encoded><![CDATA[<p>i need to make authentication for two different users&#8230;&#8230;one for user(when logged in should be directed to user page) and another for admin(directed to admin page). pls help me out. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Setup MongoDB PHP Extension on Shared Hosting by Phillip Napieralski</title>
		<link>http://blog.pnapieralski.com/mongodb/how-to-setup-mongodb-php-extension-on-shared-hosting/comment-page-1/#comment-796</link>
		<dc:creator>Phillip Napieralski</dc:creator>
		<pubDate>Thu, 22 Jul 2010 00:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=57#comment-796</guid>
		<description>Hey Jorge,

It looks like you got that notification since you are actually hosting your Mongo database on dreamhost&#039;s shared hosting. They don&#039;t allow that :(

What they DO allow, however, is to host your Mongo database externally (check out MongoHQ.com), and connect to it via PHP. It&#039;s not ideal, but even the free MongoHQ database works for small projects.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Hey Jorge,</p>
<p>It looks like you got that notification since you are actually hosting your Mongo database on dreamhost&#8217;s shared hosting. They don&#8217;t allow that <img src='http://blog.pnapieralski.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>What they DO allow, however, is to host your Mongo database externally (check out MongoHQ.com), and connect to it via PHP. It&#8217;s not ideal, but even the free MongoHQ database works for small projects.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Setup MongoDB PHP Extension on Shared Hosting by Jorge</title>
		<link>http://blog.pnapieralski.com/mongodb/how-to-setup-mongodb-php-extension-on-shared-hosting/comment-page-1/#comment-795</link>
		<dc:creator>Jorge</dc:creator>
		<pubDate>Wed, 21 Jul 2010 20:36:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=57#comment-795</guid>
		<description>Hi Phillip, I do a similar procedure:
http://jag2kn.blogspot.com/2010/07/mongodb-en-dreamhost-basic.html

but they send me a notification

&quot;
Our automated system has come across the following activity under your account
that is in violation of our Terms of Service. We request that you take any
necessary action to cease the activity as quickly as possible or we will be
forced to take further action.  If you were not aware of any such activity,
please feel free to contact support and we can look into the issue further.

User username running &quot;bin/mongod --dbpath data/db/ &quot; listening on port 27017. 
Network daemons are against our Terms of Service.
&quot;


you have received this message?

thanks</description>
		<content:encoded><![CDATA[<p>Hi Phillip, I do a similar procedure:<br />
<a href="http://jag2kn.blogspot.com/2010/07/mongodb-en-dreamhost-basic.html" rel="nofollow">http://jag2kn.blogspot.com/2010/07/mongodb-en-dreamhost-basic.html</a></p>
<p>but they send me a notification</p>
<p>&#8221;<br />
Our automated system has come across the following activity under your account<br />
that is in violation of our Terms of Service. We request that you take any<br />
necessary action to cease the activity as quickly as possible or we will be<br />
forced to take further action.  If you were not aware of any such activity,<br />
please feel free to contact support and we can look into the issue further.</p>
<p>User username running &#8220;bin/mongod &#8211;dbpath data/db/ &#8221; listening on port 27017.<br />
Network daemons are against our Terms of Service.<br />
&#8221;</p>
<p>you have received this message?</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on User Account Class in PHP 1 by Phillip Napieralski &#187; Blog Archive &#187; User Account Class in PHP 2</title>
		<link>http://blog.pnapieralski.com/php/user-account-class-in-php-1/comment-page-1/#comment-776</link>
		<dc:creator>Phillip Napieralski &#187; Blog Archive &#187; User Account Class in PHP 2</dc:creator>
		<pubDate>Thu, 08 Jul 2010 18:24:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=14#comment-776</guid>
		<description>[...] Engineer, Researcher.      &#171; User Account Class in PHP 1 Great Moments in Food [...]</description>
		<content:encoded><![CDATA[<p>[...] Engineer, Researcher.      &laquo; User Account Class in PHP 1 Great Moments in Food [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on jQuery Selectors 1 by Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 2</title>
		<link>http://blog.pnapieralski.com/jquery/jquery-selectors-1/comment-page-1/#comment-775</link>
		<dc:creator>Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 2</dc:creator>
		<pubDate>Thu, 08 Jul 2010 18:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=7#comment-775</guid>
		<description>[...] Engineer, Researcher.      &#171; jQuery Selectors 1 Clickable Table Rows with jQuery [...]</description>
		<content:encoded><![CDATA[<p>[...] Engineer, Researcher.      &laquo; jQuery Selectors 1 Clickable Table Rows with jQuery [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Clickable Table Rows with jQuery by Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 2</title>
		<link>http://blog.pnapieralski.com/jquery/clickable-table-rows-with-jquery/comment-page-1/#comment-774</link>
		<dc:creator>Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 2</dc:creator>
		<pubDate>Thu, 08 Jul 2010 18:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=9#comment-774</guid>
		<description>[...] Engineer, Researcher.      &#171; jQuery Selectors 1 Clickable Table Rows with jQuery [...]</description>
		<content:encoded><![CDATA[<p>[...] Engineer, Researcher.      &laquo; jQuery Selectors 1 Clickable Table Rows with jQuery [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on jQuery Selectors 2 by Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 1</title>
		<link>http://blog.pnapieralski.com/jquery/jquery-selectors-2/comment-page-1/#comment-773</link>
		<dc:creator>Phillip Napieralski &#187; Blog Archive &#187; jQuery Selectors 1</dc:creator>
		<pubDate>Thu, 08 Jul 2010 18:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=8#comment-773</guid>
		<description>[...] Engineer, Researcher.      &#171; Inline AJAX Editing jQuery Selectors 2 [...]</description>
		<content:encoded><![CDATA[<p>[...] Engineer, Researcher.      &laquo; Inline AJAX Editing jQuery Selectors 2 [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
