I would like to deny login for a customer group. Following an example I got a working observer but I am not able to stop the login process:
public function customerLogin($observer)
{
$customer = $observer->getEvent()->getCustomer();
$session = Mage::getSingleton('customer/session');
if ($customer->getData('group_id') == 4)
{
$session->setCustomer(Mage::getModel('customer/customer'))->setId(null);
Mage::throwException(__('This account is not activated.'));
}
}