title: Strange CakePHP 2.0 auth login issue
body: <p>Ok, so I was having a very interesting issue with CakePHP 1.3, in that even if I used the correct information to try to log in, it wouldn't work. I've now upgraded the same app to Cakephp 2.0, and I'm having a very different issue. Basically now, regardless of what information I put in when I'm logging in, it will log in. Even if the database is empty. No idea why this is happening...</p>
  
  <p>Here's my code:</p>
  
  <p>View:</p>
  
  <pre><code>&lt;div id="login"&gt;
  &lt;p&gt;Please log in! &lt;a id="register" href="register" alt="Register"&gt;Register&lt;/a&gt;&lt;/p&gt;
  &lt;hr class="login"/&gt;
  &lt;?php    
      echo $this-&gt;Session-&gt;flash('auth');    
      echo $this-&gt;Form-&gt;create('User');    
      echo $this-&gt;Form-&gt;input('username');
      echo $this-&gt;Form-&gt;input('password');
      echo "&lt;hr class=\"login\"/&gt;";
      echo $this-&gt;Form-&gt;end('Login');
      echo $this-&gt;Session-&gt;flash('flash_registration');
      echo "&lt;pre&gt;"; print_r($this-&gt;request-&gt;data); echo "&lt;/pre&gt;";
      echo $this-&gt;Html-&gt;link('Log-Out', 'logout');
  ?&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>&lt;?php
  App::uses('AuthComponent', 'Controller/Component');
  class User extends AppModel {
  var $name = 'User';
  var $validate = array(
      'name' =&gt; array(
          'custom_rule' =&gt; array(
              'rule' =&gt; '/^[A-Za-z\s]*$/i',
              'message' =&gt; 'Please enter an acceptable name'
              ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      ),
      'dob' =&gt; array(
          'rule' =&gt; array('date', 'ymd'),
          'message' =&gt; 'Enter a valid date',
      ),
      'phone' =&gt; array(
          'numbers' =&gt; array(
              'rule' =&gt; 'numeric',
              'message' =&gt; 'Numbers only, no dashes or spaces'
          ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      ),
      'username' =&gt; array(
          'alphaNumeric' =&gt; array(
              'rule' =&gt; 'alphaNumeric',
              'message' =&gt; 'Letters and numbers only'
          ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      ),
      'e-mail' =&gt; array(
          'email' =&gt; array(
              'rule' =&gt; 'email',
              'message' =&gt; 'Please enter a valid e-mail address'
          ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      ),
      'password_enter' =&gt; array(
          'length' =&gt; array(
              'rule' =&gt; array('between', 8, 16),
              'message' =&gt; 'Password must be between 8 and 16 characters'
          ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      ),
      'password_confirm' =&gt; array( 
          'identicalFieldValues' =&gt; array( 
              'rule' =&gt; array('identicalFieldValues', 'password_enter'), 
              'message' =&gt; 'Passwords do not match'
          ),
          'length' =&gt; array(
              'rule' =&gt; array('between', 8, 16),
              'message' =&gt; 'Password must be between 8 and 16 characters'
          ),
          'notEmpty' =&gt; array(
              'rule' =&gt; array('notEmpty'),
              'message' =&gt; 'This field is required'
          )
      )
  );
  
  function identicalFieldValues( $field=array(), $compare_field=null ){
      foreach( $field as $key =&gt; $value ){ 
          $v1 = $value; 
          $v2 = $this-&gt;data[$this-&gt;name][ $compare_field ];
          if($v1 !== $v2) { 
              return FALSE; 
          } else { 
              return TRUE;
          }
      } 
  }
  function beforeValidate(){ 
  
      $this-&gt;data['User']['dob'] = $this-&gt;data['User']['dob'];
  
      return true;
  }
  function beforeSave(){
  
      $this-&gt;data['User']['password'] = AuthComponent::password($this-&gt;data['User']['password_enter']);
      $this-&gt;data['User']['activated'] = FALSE;
  
      return TRUE;
  }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>&lt;?php
  
  class UsersController extends AppController {
  
  var $name = 'Users';
  var $uses = array("User");
  var $components = array(
          'Session',
          'Auth' =&gt; array(
              'loginRedirect' =&gt; array('controller' =&gt; 'pages', 'action' =&gt; 'index'),
              'logoutRedirect' =&gt; array('controller' =&gt; 'users', 'action' =&gt; 'login')
          )
      );
  
  var $helpers = array('Form', 'Session', 'Html');
  
  function beforeFilter(){
      // Basic setup
      $this-&gt;Auth-&gt;authenticate = array('Form');
      $this-&gt;Auth-&gt;allow('register', 'activate');
  
  }
  
  function index() {
  
  
  
  }
  
  function login() {
      $this-&gt;Auth-&gt;login($this-&gt;request-&gt;data);
      $this-&gt;set('title_for_layout', "Welcome to Sound-On.com!");
      $this-&gt;layout = 'user_functions';
      if ($this-&gt;Auth-&gt;user()) {
          echo "Logged in!";
      } else {
          echo "Not logged in!";
      }
  }
  
  function logout() {
  
      $this-&gt;redirect($this-&gt;Auth-&gt;logout());
  
  }
  
  function register(){
  
      $this-&gt;set('title_for_layout', "Register Here!");
      $this-&gt;layout = 'user_functions';
      $date = date('Y');
  
      if (!empty($this-&gt;data)) {
          $user_check = $this-&gt;User-&gt;find('first', array('conditions' =&gt; array('username' =&gt; $this-&gt;data['User']['username'])));
          $email_check = $this-&gt;User-&gt;find('first', array('conditions' =&gt; array('e-mail' =&gt; $this-&gt;data['User']['e-mail'])));
          if (empty($user_check)) {
              if(empty($email_check)){
                  if ($this-&gt;User-&gt;save($this-&gt;data)) {
                      $uuid_string = $this-&gt;data['User']['activation_hash'];
                      $email = &lt;&lt;&lt;EOT
                      &lt;html&gt;
                          &lt;head&gt;
                              &lt;title&gt;Welcome to Sound-On.com!&lt;/title&gt;
                          &lt;/head&gt;
                          &lt;body&gt;
                              &lt;p&gt;
                                  &lt;h1&gt;Welcome to Sound-on.com!&lt;/h1&gt;
  
                                  &lt;p&gt;You have successfully registered! To activate your account and start sounding on, please click &lt;a href="http://www.sound-on.com/activate?uid=$uuid_string"&gt;Here&lt;/a&gt;! &lt;br/&gt;If the link is not clickable, please copy and paste the link below into your browser address bar.&lt;/p&gt;
  
                                  http://www.sound-on.com/activate?uid=$uuid_string
  
                                  &lt;p style=""&gt;Thank you for registering!&lt;/p&gt;
                                                  &lt;p&gt;Your friendly Sound-On registration robot&lt;/p&gt;
  
                                  &lt;p&gt;If you did not register or wish to remove your account, please click &lt;a href="http://www.sound-on.com/not-me?uid=$uuid_string"&gt;here&lt;/a&gt;.&lt;/p&gt;
  
                                  &lt;p style="font-size:8pt;color:#707070"&gt;&amp;copy; Copyright $date Sound-on.com. All rights Reserved.&lt;/p&gt;
                              &lt;/p&gt;
                          &lt;/body
                      &lt;/html&gt;
  EOT;
                      $to = $this-&gt;data['User']['e-mail'];
                      $subject = 'Welcome to Sound-On.com!';
                      $headers = "MIME-Version: 1.0" . "\r\n";
                      $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
                      $headers .= 'From: registration@Sound-On.com';
  
                      if (mail($to, $subject, $email, $headers)) {
                          $this-&gt;redirect('/');
                      }
                  } else {
                      //$this-&gt;Session-&gt;setFlash('&lt;p class="register_flash"&gt;Something went wrong. Please try again.&lt;/p&gt;', 'flash_registration');
                      //$this-&gt;flash('', '/');
                  }
              } else {
  
                  //email exists
  
              }
          } else {
  
              //username exists
  
          }
      }   
  }
  
  function activate(){
  
      $this-&gt;set('title_for_layout', "Register Here!");
      $this-&gt;layout = 'user_functions';
      if (!empty($_GET)) {
          $activate = $this-&gt;User-&gt;updateAll(array('activated' =&gt; 1), array('activation_hash' =&gt; $_GET['uuid']));
          if ($activate) {
              $this-&gt;set('message', '&lt;p id="activation_message"&gt;Your account has been successfully activated! Please click &lt;a href="/"&gt;here&lt;/a&gt; to proceed to login!&lt;/p&gt;');
          }
      }
  
  }
  }
  
  
  
  
  
  ?&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>