User can delete own account

if u want to give functionality to user to delete their own account ::

in  appcodecoreMageCustomercontrollersAccountController.php

add below action

public function deleteAction()
$customerId = $this->getRequest()->getParam(‘id’, false);
$customerUrl = Mage::getSingleton(‘customer/session’)->getCustomer();
$temp = explode(“,”,$customerUrl);
$cust_id = $temp[1];   // user id from session

/* remove this condition if you use userid from session directly */
if($customerId != $cust_id)
else {
$customer = Mage::getModel(‘customer/customer’)->load($customerId);
$customer->delete(); // delete customer
->setBeforeAuthUrl(Mage::getUrl()); // for loging out user


pass current user id in query string or u can also take it fron session

also change in appcodecoreMageCustomerModelCustomer.php

in this function

protected function _beforeDelete()
// $this->_protectFromNonAdmin();  // comment this line
return parent::_beforeDelete();

comment $this->_protectFromNonAdmin();

– Mayank Zalavadia