<?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>Sun, 06 Nov 2011 04:05:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on How to make a scrolling star field background with Flixel by Phillip Napieralski</title>
		<link>http://blog.pnapieralski.com/flixel/how-to-make-a-scrolling-star-field-background-with-flixel/comment-page-1/#comment-1789</link>
		<dc:creator>Phillip Napieralski</dc:creator>
		<pubDate>Sun, 06 Nov 2011 04:05:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=58#comment-1789</guid>
		<description>Hayesmaker,

I originally wrote the StarField with an old version of Flixel, where you were required to override the constructor. I believe with Flixel 2+, that&#039;s no longer the case.</description>
		<content:encoded><![CDATA[<p>Hayesmaker,</p>
<p>I originally wrote the StarField with an old version of Flixel, where you were required to override the constructor. I believe with Flixel 2+, that&#8217;s no longer the case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Rahul Tailwal</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-1787</link>
		<dc:creator>Rahul Tailwal</dc:creator>
		<pubDate>Thu, 13 Oct 2011 22:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1787</guid>
		<description>hey if u want to make ur app_controller then it should be placed in app folder not under app/controller folder. all the controller will use ur app_controller functions. hope u understand it.</description>
		<content:encoded><![CDATA[<p>hey if u want to make ur app_controller then it should be placed in app folder not under app/controller folder. all the controller will use ur app_controller functions. hope u understand it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to make a scrolling star field background with Flixel by hayesmaker</title>
		<link>http://blog.pnapieralski.com/flixel/how-to-make-a-scrolling-star-field-background-with-flixel/comment-page-1/#comment-1779</link>
		<dc:creator>hayesmaker</dc:creator>
		<pubDate>Wed, 31 Aug 2011 07:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=58#comment-1779</guid>
		<description>Lovely starfield animation, just one question:
Why do you override the constructor StarField()?
This function doesn&#039;t exist in FlxObject...</description>
		<content:encoded><![CDATA[<p>Lovely starfield animation, just one question:<br />
Why do you override the constructor StarField()?<br />
This function doesn&#8217;t exist in FlxObject&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Rekha</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-1775</link>
		<dc:creator>Rekha</dc:creator>
		<pubDate>Sat, 06 Aug 2011 02:38:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1775</guid>
		<description>Now its working for me.... Thanks for your kind help...</description>
		<content:encoded><![CDATA[<p>Now its working for me&#8230;. Thanks for your kind help&#8230;</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-1774</link>
		<dc:creator>Phillip Napieralski</dc:creator>
		<pubDate>Fri, 05 Aug 2011 02:50:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1774</guid>
		<description>Also, for long snippets of code, you can use the tags [ Sourcecode lang=&quot;php&quot; ] and [ / Sourcecode ] (both without the spaces).</description>
		<content:encoded><![CDATA[<p>Also, for long snippets of code, you can use the tags [ Sourcecode lang="php" ] and [ / Sourcecode ] (both without the spaces).</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-1773</link>
		<dc:creator>Phillip Napieralski</dc:creator>
		<pubDate>Fri, 05 Aug 2011 02:49:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1773</guid>
		<description>Rose and Rehka,

I&#039;m a bit rusty with my CakePHP, but it looks like your guys&#039; posted code handles user login inside the login_form function in the UsersController. Did you intend to put it in the login() function as the tutorial suggests? Also, what version of CakePHP do y&#039;all use?

Recall that the login_form.ctp view will call our controllers login(..) function. Thus, the code should be inside your login(..) function instead of login_form(..).

Let me know if that helps.</description>
		<content:encoded><![CDATA[<p>Rose and Rehka,</p>
<p>I&#8217;m a bit rusty with my CakePHP, but it looks like your guys&#8217; posted code handles user login inside the login_form function in the UsersController. Did you intend to put it in the login() function as the tutorial suggests? Also, what version of CakePHP do y&#8217;all use?</p>
<p>Recall that the login_form.ctp view will call our controllers login(..) function. Thus, the code should be inside your login(..) function instead of login_form(..).</p>
<p>Let me know if that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Rose</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-1772</link>
		<dc:creator>Rose</dc:creator>
		<pubDate>Fri, 05 Aug 2011 02:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1772</guid>
		<description>Hello... 

I tried ur code. 

If i place my cursor in the login button, i cant able to see the URL in the below. 

I checked my code. login_form.ctp is correct and it passes control to my users_controller.php. 

 if(empty($this-&gt;data[&#039;User&#039;][&#039;username&#039;]) == false)        
     {}
   else
   {}

But  this code is not working. Both if and else. I tested by giving echo message. I found its not entering in the loop. If i give echo message in the first line or last line in the program, it prints correctly.

Will u please help me to fix it?
   

 function login_form() 
  {       
     //Check if they went here after submitting the form        
     // Note that all our form data is preceded by the model name [&#039;User&#039;]              
     if(empty($this-&gt;data[&#039;User&#039;][&#039;username&#039;]) == false)        
     {
    
        //Here we validate the user by calling that method from the User model            
        if(($user = $this-&gt;WeeeUser-&gt;validateLogin($this-&gt;data[&#039;User&#039;])) != false)            
        { 
           //Write some Session variables and redirect to our next page!                
           $this-&gt;Session-&gt;setFlash(&#039;Thank you for logging in!&#039;);                
           $this-&gt;Session-&gt;write(&#039;User&#039;, $user);                 
           
           // Go to our first destination!                
           $this-&gt;Redirect(array(&#039;controller&#039; =&gt; &#039;users&#039;, &#039;action&#039; =&gt; &#039;index&#039;));                
           
           exit();            
       }            
       else            
       {           
          $this-&gt;Session-&gt;setFlash(&#039;Incorrect username/password!&#039;, true);                
          $this-&gt;Redirect(array(&#039;action&#039; =&gt; &#039;login_form&#039;));                
          exit();            
       } 
     }</description>
		<content:encoded><![CDATA[<p>Hello&#8230; </p>
<p>I tried ur code. </p>
<p>If i place my cursor in the login button, i cant able to see the URL in the below. </p>
<p>I checked my code. login_form.ctp is correct and it passes control to my users_controller.php. </p>
<p> if(empty($this-&gt;data['User']['username']) == false)<br />
     {}<br />
   else<br />
   {}</p>
<p>But  this code is not working. Both if and else. I tested by giving echo message. I found its not entering in the loop. If i give echo message in the first line or last line in the program, it prints correctly.</p>
<p>Will u please help me to fix it?</p>
<p> function login_form()<br />
  {<br />
     //Check if they went here after submitting the form<br />
     // Note that all our form data is preceded by the model name ['User']<br />
     if(empty($this-&gt;data['User']['username']) == false)<br />
     {</p>
<p>        //Here we validate the user by calling that method from the User model<br />
        if(($user = $this-&gt;WeeeUser-&gt;validateLogin($this-&gt;data['User'])) != false)<br />
        {<br />
           //Write some Session variables and redirect to our next page!<br />
           $this-&gt;Session-&gt;setFlash(&#8216;Thank you for logging in!&#8217;);<br />
           $this-&gt;Session-&gt;write(&#8216;User&#8217;, $user);                 </p>
<p>           // Go to our first destination!<br />
           $this-&gt;Redirect(array(&#8216;controller&#8217; =&gt; &#8216;users&#8217;, &#8216;action&#8217; =&gt; &#8216;index&#8217;));                </p>
<p>           exit();<br />
       }<br />
       else<br />
       {<br />
          $this-&gt;Session-&gt;setFlash(&#8216;Incorrect username/password!&#8217;, true);<br />
          $this-&gt;Redirect(array(&#8216;action&#8217; =&gt; &#8216;login_form&#8217;));<br />
          exit();<br />
       }<br />
     }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Rekha</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-1771</link>
		<dc:creator>Rekha</dc:creator>
		<pubDate>Fri, 05 Aug 2011 01:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1771</guid>
		<description>Hello... 
I tried ur code. But the login button is not working. IT doesnt show any error msg. I dont know where i did mistake.

Here is my code.

weee_users_controller.php
------------------------------
[sourcecode lang=&quot;php&quot;]
WeeeUser-&gt;recursive = 0;
		//$this-&gt;set(&#039;weeeUsers&#039;, $this-&gt;paginate());s
                $this-&gt;set(&#039;posts&#039;,$this-&gt;WeeeUser-&gt;find(&#039;all&#039;));
	}

	function view($id = null) {
		if (!$id) {
			$this-&gt;Session-&gt;setFlash(&#039;Invalid weee user&#039;, true);
			$this-&gt;redirect(array(&#039;action&#039; =&gt; &#039;index&#039;));
		}		
    $this-&gt;set(&#039;post&#039;, $this-&gt;WeeeUser-&gt;read(null, $id));
	}

	function add() {
		if (!empty($this-&gt;data)) {			
			if ($this-&gt;WeeeUser-&gt;save($this-&gt;data)) {
				$this-&gt;Session-&gt;setFlash(&#039;The weee user has been saved&#039;);
				$this-&gt;redirect(array(&#039;action&#039; =&gt; &#039;index&#039;));
			} else {
				$this-&gt;Session-&gt;setFlash(&#039;The weee user could not be saved. Please, try again.&#039;);
			}
		}               
	}

	function edit($id = null) {
		 if (empty($this-&gt;data)) {
		      $this-&gt;data = $this-&gt;WeeeUser-&gt;read(null, $id);
                    $this-&gt;Session-&gt;setFlash(&#039;The weee user could not be saved. Please, try again.&#039;);
          }else {
               if($this-&gt;WeeeUser-&gt;save($this-&gt;data)) {
                		$this-&gt;Session-&gt;setFlash(&#039;The weee user has been saved&#039;);
										$this-&gt;redirect(array(&#039;action&#039; =&gt; &#039;view&#039;,$id));
					} 
			}
	}


	function delete($id = null) {
		if (!$id) {
			$this-&gt;Session-&gt;setFlash(&#039;Invalid id for weee user&#039;);
			$this-&gt;redirect(array(&#039;action&#039;=&gt;&#039;index&#039;));
		}
		if ($this-&gt;WeeeUser-&gt;delete($id)) {
			$this-&gt;Session-&gt;setFlash(&#039;Weee user deleted&#039;);
			$this-&gt;redirect(array(&#039;action&#039;=&gt;&#039;index&#039;));
		}
		$this-&gt;Session-&gt;setFlash(&#039;Weee user was not deleted&#039;);
		$this-&gt;redirect(array(&#039;action&#039; =&gt; &#039;index&#039;));
	}
	

	function ajax_login_form() 
	{
    $this-&gt;layout = &#039;ajax&#039;;
    if (!empty($this-&gt;data)) 
    {
       if ($this-&gt;data[&#039;User&#039;][&#039;username&#039;] == &#039;&#039;) 
          $this-&gt;set(&#039;value&#039;, 0);
       else 
       {
         	$u = $this-&gt;User-&gt;findByUsername($this-&gt;data[&#039;User&#039;][&#039;username&#039;]);

        	if (empty($u)) 
        		 $this-&gt;set(&#039;value&#039;, 1);
        	else 
        	   $this-&gt;set(&#039;value&#039;, 0);
       }
    }
    else 
       $this-&gt;set(&#039;value&#039;, 0);    
	}


  //Placeholder for login_form, required by CakePHP to see the login_form view    
  //function login_form() { }     
  
  function login_form() 
  {       
     //Check if they went here after submitting the form        
     // Note that all our form data is preceded by the model name [&#039;WeeeUser&#039;]        
     
     if(empty($this-&gt;data[&#039;WeeeUser&#039;][&#039;username&#039;]) == false)        
     {
     echo &quot;im here&quot;;
     
        //Here we validate the user by calling that method from the User model            
        if(($user = $this-&gt;WeeeUser-&gt;validateLogin($this-&gt;data[&#039;WeeeUser&#039;])) != false)            
        {   
           //Write some Session variables and redirect to our next page!                
           $this-&gt;Session-&gt;setFlash(&#039;Thank you for logging in!&#039;);                
           $this-&gt;Session-&gt;write(&#039;WeeeUser&#039;, $user);                 
           
           // Go to our first destination!                
           $this-&gt;Redirect(array(&#039;controller&#039; =&gt; &#039;Weee_users&#039;, &#039;action&#039; =&gt; &#039;index&#039;));                
           
           exit();            
       }            
       else            
       {           
          $this-&gt;Session-&gt;setFlash(&#039;Incorrect username/password!&#039;, true);                
          $this-&gt;Redirect(array(&#039;action&#039; =&gt; &#039;login_form&#039;));                
          exit();            
       }                      
     }    
   }     
   
   
   function logout() 
   {    
      $this-&gt;Session-&gt;destroy();        
      $this-&gt;Session-&gt;setFlash(&#039;You have been logged out!&#039;);         
      
      //Go home!        
      $this-&gt;Redirect(&#039;/&#039;);        
      exit();    
   }
  
function hello_world(){	}	
}
[/sourcecode]
-----------------------------------------------------------------------------------------
weee_user.php
------------------
[sourcecode lang=&quot;php&quot;]
array(
                       &#039;username_must_not_be_blank&#039;=&gt;array(&#039;rule&#039;=&gt;&#039;notEmpty&#039;,&#039;message&#039;=&gt;&#039;This post is missing a username!&#039;),
                       &#039;username _must_be_unique&#039;=&gt;array(&#039;rule&#039;=&gt;&#039;isUnique&#039;,&#039;message&#039;=&gt;&#039;A post with this username already exists!&#039;)
                      ),   
        &#039;password&#039;=&gt;array(
                      &#039;password_must_not_be_blank&#039;=&gt;array(&#039;rule&#039;=&gt;&#039;notEmpty&#039;,&#039;message&#039;=&gt;&#039;This post is missing its password!&#039;)
                     ),
        &#039;email&#039;=&gt;array(
                       &#039;email_must_not_be_blank&#039;=&gt;array(&#039;rule&#039;=&gt;&#039;notEmpty&#039;,&#039;message&#039;=&gt;&#039;This post is missing its email!&#039;),
                       &#039;email_must_be_unique&#039;=&gt;array(&#039;rule&#039;=&gt;&#039;isUnique&#039;,&#039;message&#039;=&gt;&#039;A post with this email already exists!&#039;)
                      )          
    );
	
	  function validateLogin($data)    
	  {        
	      // Search our database where the &#039;username&#039; field is equal to our form input.        
	      // Same with the password (this example uses PLAIN TEXT passwords, you should encrypt yours!)        
	      // The second parameter tells us which fields to return from the database        
	      // Here is the corresponding query:        
	      // &quot;SELECT id, username FROM users WHERE username = &#039;xxx&#039; AND password = &#039;yyy&#039;&quot;        
	      $user = $this-&gt;find(array(&#039;username&#039; =&gt; $data[&#039;username&#039;], &#039;password&#039; =&gt; $data[&#039;password&#039;]));         
	                          
        if( empty($user) == false )        
            return $user;       
         
        return false;    
    }
	
}
[/sourcecode]
-----------------------------------------------------------------------------------------------------------------------------------
app_controller.php
----------------------
[sourcecode lang=&quot;php&quot;]
Session-&gt;check(&#039;WeeeUser&#039;))        
   {   
        $this-&gt;redirect(array(&#039;controller&#039; =&gt;&#039;WeeeUsers&#039;, &#039;action&#039; =&gt; &#039;login_form&#039;));   
        exit();        
   }    
}     

// Authenticate on every action, except the login form    
function afterFilter()    
{    
    if( $this-&gt;action != &#039;login_form&#039; )        
       $this-&gt;authenticate();        
} 
*/

// Check if they are logged in    
function authenticate()    
{     
   // Check if the session variable User exists, redirect to loginform if not        
   if(!$this-&gt;Session-&gt;check(&#039;WeeeUser&#039;))        
   {   
        $this-&gt;redirect(array(&#039;controller&#039; =&gt;&#039;WeeeUsers&#039;, &#039;action&#039; =&gt; &#039;login_form&#039;));   
        exit();        
   }    
}     

// Authenticate on every action, except the login form    
function afterFilter()    
{    
    if( $this-&gt;action != &#039;login_form&#039; )        
       $this-&gt;authenticate();        
} 

}
[/sourcecode]
--------------------------------------------------------------------------------------------------------
login_form.ctp
-----------------
[sourcecode lang=&quot;php&quot;]
create(&#039;WeeeUser&#039;, array(&#039;action&#039;=&gt;&#039;login_form&#039;) ); 

// Cake automatically knows, based on the input, to create input fields for these two.
echo $form-&gt;input(&#039;username&#039;);
echo $form-&gt;input(&#039;password&#039;);

// Create the submit button
echo $form-&gt;end(&#039;Login&#039;);

?&gt;
[/sourcecode]
------------------------------------------------------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>Hello&#8230;<br />
I tried ur code. But the login button is not working. IT doesnt show any error msg. I dont know where i did mistake.</p>
<p>Here is my code.</p>
<p>weee_users_controller.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="brush: php; title: ; notranslate">
WeeeUser-&amp;gt;recursive = 0;
		//$this-&amp;gt;set('weeeUsers', $this-&amp;gt;paginate());s
                $this-&amp;gt;set('posts',$this-&amp;gt;WeeeUser-&amp;gt;find('all'));
	}

	function view($id = null) {
		if (!$id) {
			$this-&amp;gt;Session-&amp;gt;setFlash('Invalid weee user', true);
			$this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
		}
    $this-&amp;gt;set('post', $this-&amp;gt;WeeeUser-&amp;gt;read(null, $id));
	}

	function add() {
		if (!empty($this-&amp;gt;data)) {
			if ($this-&amp;gt;WeeeUser-&amp;gt;save($this-&amp;gt;data)) {
				$this-&amp;gt;Session-&amp;gt;setFlash('The weee user has been saved');
				$this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
			} else {
				$this-&amp;gt;Session-&amp;gt;setFlash('The weee user could not be saved. Please, try again.');
			}
		}
	}

	function edit($id = null) {
		 if (empty($this-&amp;gt;data)) {
		      $this-&amp;gt;data = $this-&amp;gt;WeeeUser-&amp;gt;read(null, $id);
                    $this-&amp;gt;Session-&amp;gt;setFlash('The weee user could not be saved. Please, try again.');
          }else {
               if($this-&amp;gt;WeeeUser-&amp;gt;save($this-&amp;gt;data)) {
                		$this-&amp;gt;Session-&amp;gt;setFlash('The weee user has been saved');
										$this-&amp;gt;redirect(array('action' =&amp;gt; 'view',$id));
					}
			}
	}

	function delete($id = null) {
		if (!$id) {
			$this-&amp;gt;Session-&amp;gt;setFlash('Invalid id for weee user');
			$this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
		}
		if ($this-&amp;gt;WeeeUser-&amp;gt;delete($id)) {
			$this-&amp;gt;Session-&amp;gt;setFlash('Weee user deleted');
			$this-&amp;gt;redirect(array('action'=&amp;gt;'index'));
		}
		$this-&amp;gt;Session-&amp;gt;setFlash('Weee user was not deleted');
		$this-&amp;gt;redirect(array('action' =&amp;gt; 'index'));
	}

	function ajax_login_form()
	{
    $this-&amp;gt;layout = 'ajax';
    if (!empty($this-&amp;gt;data))
    {
       if ($this-&amp;gt;data['User']['username'] == '')
          $this-&amp;gt;set('value', 0);
       else
       {
         	$u = $this-&amp;gt;User-&amp;gt;findByUsername($this-&amp;gt;data['User']['username']);

        	if (empty($u))
        		 $this-&amp;gt;set('value', 1);
        	else
        	   $this-&amp;gt;set('value', 0);
       }
    }
    else
       $this-&amp;gt;set('value', 0);
	}

  //Placeholder for login_form, required by CakePHP to see the login_form view
  //function login_form() { }     

  function login_form()
  {
     //Check if they went here after submitting the form
     // Note that all our form data is preceded by the model name ['WeeeUser']        

     if(empty($this-&amp;gt;data['WeeeUser']['username']) == false)
     {
     echo &quot;im here&quot;;

        //Here we validate the user by calling that method from the User model
        if(($user = $this-&amp;gt;WeeeUser-&amp;gt;validateLogin($this-&amp;gt;data['WeeeUser'])) != false)
        {
           //Write some Session variables and redirect to our next page!
           $this-&amp;gt;Session-&amp;gt;setFlash('Thank you for logging in!');
           $this-&amp;gt;Session-&amp;gt;write('WeeeUser', $user);                 

           // Go to our first destination!
           $this-&amp;gt;Redirect(array('controller' =&amp;gt; 'Weee_users', 'action' =&amp;gt; 'index'));                

           exit();
       }
       else
       {
          $this-&amp;gt;Session-&amp;gt;setFlash('Incorrect username/password!', true);
          $this-&amp;gt;Redirect(array('action' =&amp;gt; 'login_form'));
          exit();
       }
     }
   }     

   function logout()
   {
      $this-&amp;gt;Session-&amp;gt;destroy();
      $this-&amp;gt;Session-&amp;gt;setFlash('You have been logged out!');         

      //Go home!
      $this-&amp;gt;Redirect('/');
      exit();
   }

function hello_world(){	}
}
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
weee_user.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<pre class="brush: php; title: ; notranslate">
array(
                       'username_must_not_be_blank'=&amp;gt;array('rule'=&amp;gt;'notEmpty','message'=&amp;gt;'This post is missing a username!'),
                       'username _must_be_unique'=&amp;gt;array('rule'=&amp;gt;'isUnique','message'=&amp;gt;'A post with this username already exists!')
                      ),
        'password'=&amp;gt;array(
                      'password_must_not_be_blank'=&amp;gt;array('rule'=&amp;gt;'notEmpty','message'=&amp;gt;'This post is missing its password!')
                     ),
        'email'=&amp;gt;array(
                       'email_must_not_be_blank'=&amp;gt;array('rule'=&amp;gt;'notEmpty','message'=&amp;gt;'This post is missing its email!'),
                       'email_must_be_unique'=&amp;gt;array('rule'=&amp;gt;'isUnique','message'=&amp;gt;'A post with this email already exists!')
                      )
    );

	  function validateLogin($data)
	  {
	      // Search our database where the 'username' field is equal to our form input.
	      // Same with the password (this example uses PLAIN TEXT passwords, you should encrypt yours!)
	      // The second parameter tells us which fields to return from the database
	      // Here is the corresponding query:
	      // &quot;SELECT id, username FROM users WHERE username = 'xxx' AND password = 'yyy'&quot;
	      $user = $this-&amp;gt;find(array('username' =&amp;gt; $data['username'], 'password' =&amp;gt; $data['password']));         

        if( empty($user) == false )
            return $user;       

        return false;
    }

}
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
app_controller.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<pre class="brush: php; title: ; notranslate">
Session-&amp;gt;check('WeeeUser'))
   {
        $this-&amp;gt;redirect(array('controller' =&amp;gt;'WeeeUsers', 'action' =&amp;gt; 'login_form'));
        exit();
   }
}     

// Authenticate on every action, except the login form
function afterFilter()
{
    if( $this-&amp;gt;action != 'login_form' )
       $this-&amp;gt;authenticate();
}
*/

// Check if they are logged in
function authenticate()
{
   // Check if the session variable User exists, redirect to loginform if not
   if(!$this-&amp;gt;Session-&amp;gt;check('WeeeUser'))
   {
        $this-&amp;gt;redirect(array('controller' =&amp;gt;'WeeeUsers', 'action' =&amp;gt; 'login_form'));
        exit();
   }
}     

// Authenticate on every action, except the login form
function afterFilter()
{
    if( $this-&amp;gt;action != 'login_form' )
       $this-&amp;gt;authenticate();
} 

}
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
login_form.ctp<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<pre class="brush: php; title: ; notranslate">
create('WeeeUser', array('action'=&amp;gt;'login_form') ); 

// Cake automatically knows, based on the input, to create input fields for these two.
echo $form-&amp;gt;input('username');
echo $form-&amp;gt;input('password');

// Create the submit button
echo $form-&amp;gt;end('Login');

?&amp;gt;
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to Compile/Install osgAudio for Windows by Peter Maxwell</title>
		<link>http://blog.pnapieralski.com/osg/how-to-compileinstall-osgaudio-for-windows/comment-page-1/#comment-1770</link>
		<dc:creator>Peter Maxwell</dc:creator>
		<pubDate>Thu, 04 Aug 2011 17:22:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=65#comment-1770</guid>
		<description>You, sir, are a scholar and a gentleman. The tedious process of getting osgAudio up and running would have been a good deal more time-consuming without your helpful guide. Thanks very much for documenting your tribulations!</description>
		<content:encoded><![CDATA[<p>You, sir, are a scholar and a gentleman. The tedious process of getting osgAudio up and running would have been a good deal more time-consuming without your helpful guide. Thanks very much for documenting your tribulations!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Very Simple User Authentication with CakePHP by Rose</title>
		<link>http://blog.pnapieralski.com/php/cakephp/very-simple-user-authentication-with-cakephp/comment-page-1/#comment-1769</link>
		<dc:creator>Rose</dc:creator>
		<pubDate>Wed, 03 Aug 2011 02:17:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.pnapieralski.com/?p=22#comment-1769</guid>
		<description>Hi... I tried ur code. I got error like

[sourcecode lang=&quot;php&quot;]
class AppController extends Controller { // Check if they are logged in function authenticate() { // Check if the session variable User exists, redirect to loginform if not if(!$this-&gt;Session-&gt;check(&#039;User&#039;)) { $this-&gt;redirect(array(&#039;controller&#039; =&gt; &#039;users&#039;, &#039;action&#039; =&gt; &#039;login_form&#039;)); exit(); } } // Authenticate on every action, except the login form function afterFilter() { if( $this-&gt;action != &#039;login_form&#039; ) { $this-&gt;authenticate(); } } }
Fatal error: Class &#039;AppController&#039; not found in C:\xampp\htdocs\cake\app\controllers\users_controller.php on line 4
[/sourcecode]

I copied ur app_contoller.php program in /app/controllers/app_controller.php

Plz help me</description>
		<content:encoded><![CDATA[<p>Hi&#8230; I tried ur code. I got error like</p>
<pre class="brush: php; title: ; notranslate">
class AppController extends Controller { // Check if they are logged in function authenticate() { // Check if the session variable User exists, redirect to loginform if not if(!$this-&amp;gt;Session-&amp;gt;check('User')) { $this-&amp;gt;redirect(array('controller' =&amp;gt; 'users', 'action' =&amp;gt; 'login_form')); exit(); } } // Authenticate on every action, except the login form function afterFilter() { if( $this-&amp;gt;action != 'login_form' ) { $this-&amp;gt;authenticate(); } } }
Fatal error: Class 'AppController' not found in C:\xampp\htdocs\cake\app\controllers\users_controller.php on line 4
</pre>
<p>I copied ur app_contoller.php program in /app/controllers/app_controller.php</p>
<p>Plz help me</p>
]]></content:encoded>
	</item>
</channel>
</rss>

