title: Cakephp 2.0 change password
body: <p>I am attempting to create a change password form in cakephp 2.0.  I found a behavior that EuroMark created for 1.3 and now am having a tough time converting this code to work with 2.0. I know that it has something to do with the Auth Component as there were major changes to this component in 2.0.  </p>
  
  <pre><code>public function validateCurrentPwd(Model $Model, $data) {
  if (is_array($data)) {
      $pwd = array_shift($data);
  } else {
      $pwd = $data;
  }
  
  $uid = null;
  if ($Model-&gt;id) {
      $uid = $Model-&gt;id;
  } elseif (!empty($Model-&gt;data[$Model-&gt;alias]['id'])) {
      $uid = $Model-&gt;data[$Model-&gt;alias]['id'];
  } else {
      return false;
  }
  
  if (class_exists('AuthExtComponent')) {
      $this-&gt;Auth = new AuthExtComponent();
  } elseif (class_exists($this-&gt;settings[$Model-&gt;alias]['auth'].'Component')) {
      $auth = $this-&gt;settings[$Model-&gt;alias]['auth'].'Component';
      $this-&gt;Auth = new $auth();
  } else {
      return true;
  }
  return $this-&gt;Auth-&gt;verifyUser($uid, $pwd);
  }
  </code></pre>
  
  <p>I am getting an error on the line that reads $this->Auth = new $auth();
  The error is as follows:</p>
  
  <pre><code>Argument 1 passed to Component::__construct() must be an instance of ComponentCollection, none given, called in C:\UniServer\www\new_company_test\app\Model\Behavior\change_password.php on line 117 and defined [CORE\Cake\Controller\Component.php, line 77]
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Undefined variable: collection [CORE\Cake\Controller\Component.php, line 78]
  </code></pre>
  
  <p>it's also throwing this</p>
  
  <pre><code>Call to undefined method AuthComponent::verifyUser() in C:\UniServer\www\new_company_test\app\Model\Behavior\change_password.php on line 121 
  </code></pre>
  
  <p>I am not sure if there is anything else that needs to be addressed in the script, I'm guessing not as there is no other place where Auth is used.</p>
  
  <p>Any suggestions on what I need to do to get this to work? Any help is appreciated.
  Thanks</p>