How to prevent login if a condition is not met
You can use sess_destroy_uid($account-&gt;uid).

You might also consider blocking users during the import process; this is done by setting the "status" column to 0.