Deletes duplicate users
@return void
328469
public function removeDuplicateUsers()
    {
        $this->db->query("DELETE FROM " . $this->db->users . "
        WHERE id NOT IN (
            SELECT *
            FROM (
                SELECT MIN(id)
                FROM " . $this->db->users . "
                GROUP BY user_login
            ) temp
        )");

        wp_cache_flush();
    }
1056416
public function deactivateUsers(array $ids): void
	{
		if ($this->isAjax()) {
			$users = $this->orm->users->findById($ids);
			foreach ($users as $user) {
				$user->active = false;
				$this->orm->users->persist($user);
			}
			$this->orm->flush();
			$this['userList']->reload();
		} else {
			$this->terminate();
		}
	}
51516
public function unsetUserGroups()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sDelete = 'delete from oxobject2group where oxobjectid = ' . $oDb->quote($this->getId());
        $oDb->execute($sDelete);
    }
88930
def delete_users(user_list)
      raise ArgumentError unless user_list.is_a?(Array)
      validate_user_list(user_list)
      api.post('deleteUsers', user_list, 'application/json')
    end
691227
public function delete()
    {

        // Remove the Role from users, permissions
        // and affiliations that it had
        $this->groups()->detach();
        $this->permissions()->detach();
        $this->affiliations()->detach();

        return parent::delete();
    }
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();
        }
    }
1171914
private function deleteOldSessions()
    {
        // 2% chance of kicking idle sessions
        if (mt_rand(0, 49)) {
            return false;
        }

        $sessions = new UsersSessionEntityRepository();
        $sessions->setOnlyOutdated();
        $sessions->deleteObjectCollection();

        return true;
    }
957185
public function delete()
    {
        $this->_user = false;

        $this->_session->delete($this->_config['key']);
        $this->_session->renew();
    }
1226392
public function delete()
    {
        if ($this->id == 0 || $this->id == ADMIN_ID) return FALSE;
		$conn = self::getDbConnection();
		$str = 'DELETE [LOGIN='.$this->login.'][ID='.$this->id.']';
        $conn->executeQuery('DELETE FROM users_groups_membership WHERE user_id='.$this->id);
        $conn->executeQuery('DELETE FROM users_auth WHERE user_id='.$this->id);
        parent::delete();
			
	    Event::trigger(EVENT_CORE_USER_PROP,['message' => $str]);
    }
406875
public function actionRemove()
    {
        $username = $this->prompt('Username:', ['required' => true]);
        $user = $this->findModel($username);
        $this->log($this->repository->remove($user));
    }
238361
public function removeDuplicates() {
		$this->request->allowMethod('post');

		$this->DatabaseLogs->removeDuplicates((bool)$this->request->getQuery('strict'));

		$this->Flash->success(__('Duplicates have been removed.'));
		return $this->redirect(['action' => 'index']);
	}
1354745
public function delete()
    {
        if (!userHasPermission('admin:invoice:customer:delete')) {
            unauthorised();
        }

        // --------------------------------------------------------------------------

        $oUri           = Factory::service('Uri');
        $oCustomerModel = Factory::model('Customer', 'nails/module-invoice');
        $oCustomer      = $oCustomerModel->getById(
            $oUri->segment(5),
            ['expand' => ['invoices']]
        );
        if (!$oCustomer) {
            show404();
        }

        if ($oCustomer->invoices->count) {

            $sStatus  = 'error';
            $sMessage = 'Cannot delete a customer who has invoices.';

        } else {

            if ($oCustomerModel->delete($oCustomer->id)) {

                $sStatus  = 'success';
                $sMessage = 'Invoice deleted successfully!';

            } else {

                $sStatus  = 'error';
                $sMessage = 'Invoice failed to delete. ' . $this->oInvoiceModel->lastError();
            }
        }

        $oSession = Factory::service('Session', 'nails/module-auth');
        $oSession->setFlashData($sStatus, $sMessage);
        redirect('admin/invoice/customer/index');
    }
739110
public function deleteUser(User $user)
    {
        if ($user->isGuest()) {
            Throw new UserException('Cannot delete a guest user.');
        }

        // Check the old password
        $this->db->delete($this->table, 'id_user=:id_user', [
            ':id_user' => $user->getId()
        ]);
    }
4746
public function delete()
    {
        if (empty($this->unique)) {
            return false;
        }
        foreach($this->unique as $column) {
            if (!isset($this->instance[$column])) {
                return false;
            }
        }

        $sql = 'DELETE FROM '.$this->fq_name.' WHERE 1=1';
        $args = array();
        foreach($this->unique as $name) {
            $sql .= ' AND '.$this->connection->identifierEscape($name).' = ?';
            $args[] = $this->instance[$name];
        }

        $prep = $this->connection->prepare($sql);
        $result = $this->connection->execute($prep, $args);

        return ($result === false) ? false : true;
    }
202984
public function unimpersonateUser()
    {
        $realId = $this->session->remove('__realId');
        if ($realId !== null) {
            $this->user->identity->remove();
            $this->session->set($this->user->idParam, $realId);
            $identity = User::findOne($realId);
            $this->user->setIdentity($identity);
            $this->restoreBackedUpToken();
        }
    }
881212
public function deduplicate()
	{
		if ($this->useCount > 1)
		{
			$this->isDeduplicated = true;
			$this->decrementUseCount($this->useCount - 1);
		}
	}
951340
public function deleteAccount($userToDelete)
    {
        if ($userId = $this->userNameExists($userToDelete)) {
            if (is_multisite()) {
                if ($reassign = $this->reassignToUserId()) {
                    foreach ($this->sites as $site) {
                        remove_user_from_blog($userId, $site->blog_id, $reassign);
                    }
                    $this->db->delete($this->db->users, array('ID' => $userId));
                }
            } else {
                if ($reassign = $this->reassignToUserId()) {
                    wp_delete_user($userId, $reassign);
                }
            }
        }
    }