title: How to check user status when login into wordpress
body: <p>Could you please advice me how to check user status upon login?</p>
  
  <p>I have added a new field named <code>user_flag</code> in <code>wp_users</code> table to control user status. <code>user_flag</code> has value of <code>active</code> or <code>deactivate</code>.</p>
  
  <p>I want to check this field's value when user logs in.</p>
  
  <ul>
  <li>if value is <code>active</code>, then user can proceed login,</li>
  <li>but if value is <code>deactivate</code>, then user can not login, and a message will be displayed to notify user that his account is deactivated and he need to contact admin to re-activate account for him to be able to login.</li>
  </ul>
  
  <p>I looked at <code>wp-login.php</code> file but had no idea where to write code to check above logic, could you please advice me where to check <code>user_flag</code> at login time?</p>
  
  <p>Thank you so much.</p>