Delete account from DB
436533
def delete_account(self, data):
        
        error = False
        msg = ""

        username = self.user_manager.session_username()

        # Check input format
        result = self.database.users.find_one_and_delete({"username": username,
                                                          "email": data.get("delete_email", "")})
        if not result:
            error = True
            msg = _("The specified email is incorrect.")
        else:
            self.database.submissions.remove({"username": username})
            self.database.user_tasks.remove({"username": username})

            all_courses = self.course_factory.get_all_courses()

            for courseid, course in all_courses.items():
                if self.user_manager.course_is_open_to_user(course, username):
                    self.user_manager.course_unregister_user(course, username)

            self.user_manager.disconnect_user()
            raise web.seeother("/index")

        return msg, error
804192
public function deleteProfile()
    {
        $user = Credentials::getUser();
        $this->checkUser($user);

        $email = $user->getLogin();

        Credentials::logout();

        try {
            $user->delete();
        } catch (\Exception $e) {
            return Redirect::to(Config::get('credentials.home', '/'))
                ->with('error', 'There was a problem deleting your account.');
        }

        $mail = [
            'url'     => URL::to(Config::get('credentials.home', '/')),
            'email'   => $email,
            'subject' => Config::get('app.name').' - Account Deleted Notification',
        ];

        Mail::queue('credentials::emails.userdeleted', $mail, function ($message) use ($mail) {
            $message->to($mail['email'])->subject($mail['subject']);
        });

        return Redirect::to(Config::get('credentials.home', '/'))
            ->with('success', 'Your account has been deleted successfully.');
    }
1343232
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();
        }
    }
1134503
public function forceDelete()
     {
         $key = $this->getPKvalue();
         $sql = 'delete from '.$this->DBtable.' where '.$this->keyName." = '".$key."' ";
         //
         return Database::exec($sql);
     }
1248112
@RequestMapping(value = "{accountId}", method = RequestMethod.DELETE)
    public Ack deleteAccount(@PathVariable ID accountId) {
        return accountService.deleteAccount(accountId);
    }
1275325
def drop_db(name, **client_args):
    '''
    
    '''
    if not db_exists(name, **client_args):
        log.info('DB \'%s\' does not exist', name)
        return False

    client = _client(**client_args)
    client.drop_database(name)

    return True
1345489
async def delete_user(name):
    """"""
    app_log.info("Deleting user %s", name)
    await api_request('users/{}/server'.format(name), method='DELETE')
    await api_request('users/{}'.format(name), method='DELETE')
827318
function ec_delete_user($cid) {
    global $db;
    unset($_SESSION['customer_id']);
    unset($_SESSION['customer_default_address_id']);
    unset($_SESSION['customer_first_name']);
    unset($_SESSION['customer_country_id']);
    unset($_SESSION['customer_zone_id']);
    unset($_SESSION['comments']);
    unset($_SESSION['customer_guest_id']);
    $cid = (int)$cid;
    $sql = "delete from " . TABLE_ADDRESS_BOOK . " where customers_id = " . $cid;
    $db->Execute($sql);
    $sql = "delete from " . TABLE_CUSTOMERS . " where customers_id = " . $cid;
    $db->Execute($sql);
    $sql = "delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = " . $cid;
    $db->Execute($sql);
    $sql = "delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = " . $cid;
    $db->Execute($sql);
    $sql = "delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = " . $cid;
    $db->Execute($sql);
    $sql = "delete from " . TABLE_WHOS_ONLINE . " where customer_id = " . $cid;
    $db->Execute($sql);
  }
708288
def _delete_account(self, username):
        

        # account deleted

        ds_user = self.get_user(username)
        if ds_user is not None:
            self._call(["delete", "user", "name=%s" % username])

        return
845684
def auth_delete_creds(self, username=None):
		
		if not username:
			self.__config['basic_auth'] = {}
			self.logger.info('basic authentication database has been cleared of all entries')
			return
		del self.__config['basic_auth'][username]
966920
def delete(self):
        
        resource = self.RESOURCE.format(
            account_id=self.account.id,
            tailored_audience_id=self.tailored_audience_id,
            id=self.id)
        response = Request(self.account.client, 'delete', resource).perform()
        return self.from_response(response.body['data'])
1087377
def delete(self):
        
        resp = self.r_session.delete(self.database_url)
        resp.raise_for_status()
907201
def delete_account(account_id, options = {})
      content_type = { 'Content-Type' => 'application/json' }
      content_type.merge(options[:headers]) if options[:headers]

      uri = build_uri("/accounts/#{account_id}")

      http = initialize_net_http_ssl(uri)
      request = Net::HTTP::Delete.new(uri.request_uri, headers(content_type))
      response = http.request(request)
      generate_log(request, response, uri)
      json = response.body
      json = '{}' if json.nil? || json == ''
      JSON.parse(json)
    end
1053171
def user_remove(username,
                user=None,
                host=None,
                port=None,
                maintenance_db=None,
                password=None,
                runas=None):
    '''
    
    '''
    return _role_remove(username,
                        user=user,
                        host=host,
                        port=port,
                        maintenance_db=maintenance_db,
                        password=password,
                        runas=runas)
1121724
public function delete() {
        global $DB;
        $DB->delete_records('portfolio_instance_config', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_instance_user', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_tempdata', array('instance' => $this->get('id')));
        $DB->delete_records('portfolio_instance', array('id' => $this->get('id')));
        $this->dirty = false;
        return true;
    }
207149
def revoke_user_access(self, user, db_names, strict=True):
        
        user = utils.get_name(user)
        db_names = self._get_db_names(db_names, strict=strict)
        bad_names = []
        for db_name in db_names:
            uri = "/%s/%s/databases/%s" % (self.uri_base, user, db_name)
            resp, resp_body = self.api.method_delete(uri)
1181454
function removeTodo(username, id) {
  const todoIndex = userDB[username].indexOf(id);
  if (todoIndex !== -1) {
    userDB[username].splice(todoIndex, 1);
  } else {
    return null;
  }
  delete todoDB[id];
}