I have been creating one custom module for block some customer group to wholesale store. we can get customer group id by current session like
$session = Mage::getSingleton('customer/session');
// Get the Customer Group ID.
$group_id = $session->getCustomerGroupId();
But i want to block those customers before login. How to get customer group id by $login['username'] before setting session? Anybody have an idea? Please help me guys!