Delete users in Magento frontend

If you need the possibility to let the users delete their own accounts, you can use the following snippet in a corresponding controller or observer to delete users in frontend:


$oCustomer = $this->_getSession()->getCustomer();
Mage::throwException($this->__('Cannot load customer!'));
//lie to mage ;-)
// @todo: Check, if there is a better way
Mage::register('isSecureArea', true);

//put things right again


Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.