public function deleteAccount()
    {
        $this->accountDeletionStatus = false;
        $user = $this->getUser();

        /**
         * Setting derived to false allows mall users to delete their account being in a different shop as the shop
         * the account was originally created in.
         */
        if (\OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('blMallUsers')) {
            $user->setIsDerived(false);
        }

        if ($this->canUserAccountBeDeleted() && $user->delete()) {
            $this->accountDeletionStatus = true;
            $user->logout();
            $session = $this->getSession();
            $session->destroy();
        }
    }