The username has not been activated or is blocked. using custom login form In my module tpl file I'm calling 

&lt;?php print drupal_render(drupal_get_form('mymodule_login_form')); ?&gt;

Then in my .module file I have this function:

function mymodule_login_form($form, &amp;$form_state){
  $form = drupal_get_form('user_login');
  return $form;
}


So the user_login form gets called and shows up but when I try to use it ( submit it ) I'm always getting the error message: 'The username has not been activated or is blocked.'

When I change the tpl file to:
&lt;?php print drupal_render(drupal_get_form('user_login')); ?&gt; it works and giving the correct error messages or logs the user in.

The problem with this is that I'm using it in a popup screen and want to display the error messages in the popup screen using ajax. So I need to alter the user_login form. I know how to do that but I'm not getting past the error message 'The username has not been activated or is blocked.'
If your requirement is displaying user login form in AJAX POPUP then you can consider Ajax Login/Register module.


This module provides a block with 2 links (Login, Register) for the
anonymous user. 
When the user clicks on Login or register the
requested form appears in a nice ajax popup.