title: Magento - How to check if email entered during login is registered with the website?
body: <p>I'm trying to tell the user which of their email address or password entered during login was wrong instead of the default "Invalid email or password" error. </p>
  
  <p>I went to the relevant controller file:</p>
  
  <p>.../app/code/core/Mage/Customer/controllers/accountcontroller.php</p>
  
  <p>and changed the code from line 141 to:</p>
  
  <pre><code>catch (Mage_Core_Exception $e) {
       switch ($e-&gt;getCode()) {
            case Mage_Customer_Model_Customer::EXCEPTION_INVALID_EMAIL_OR_PASSWORD:
                  if(Zend_Validate::is($login['username'], 'EmailAddress'))
                      $message = $this-&gt;__('Wrong password.');
                  else
                      $message = $this-&gt;__('That email address was not found.');
                      //$message = $e-&gt;getMessage();
  break;
  </code></pre>
  
  <p>I used Zend_Validate::is() from the forgotPasswordPostAction() function in the same file to check if the email was registered or not. But it doesn't work during login. I always get the 'Wrong password' message even if the email is not registered.</p>
  
  <p>Is it because I'm using Zend_Validate::is() wrong? What would be the correct function to check if the email is registered or not?</p>
  
  <p>Thanks!</p>