Removes the given user.

@param int $id User's ID
@return void Redirects to previous page
183292
public function delete($id)
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get($id, ['contain' => ['Roles']]);

        if (in_array(ROLE_ID_ADMINISTRATOR, $user->role_ids) &&
            $this->Users->countAdministrators() === 1
        ) {
            $this->Flash->danger(__d('user', 'You cannot remove this user as it is the last administrator available.'));
        } else {
            if ($this->Users->delete($user)) {
                NotificationManager::canceled($user)->send();
                $this->Flash->success(__d('user', 'User successfully removed!'));
                $this->redirect($this->referer());
            } else {
                $this->Flash->danger(__d('user', 'User could not be removed.'));
            }
        }

        $this->title(__d('user', 'Remove User Account'));
        $this->redirect($this->referer());
    }
558326
public function remove($id)
    {
        $user = User::findOrNew($id);

        $user->delete();

        Alert::info(__('User was removed'));

        return redirect()->route('platform.systems.users');
    }
609028
public function delete($id = null) {
        $user = $this->Users->get($id);
        if ($this->request->is(['patch', 'post', 'put'])) {
            if ($this->Users->delete($user)) {
                $this->Flash->success(__('The user has been deleted.'));
            } else {
                $this->Flash->error(__('The user could not be deleted. Please, try again.'));
            }
            return $this->redirect(['action' => 'index']);
        }
        $this->set(compact('user'));
    }
879294
public function handleDeletePermission(int $id): void
	{
		if ($this->isAjax()) {
			$permission = $this->orm->acl->getById($id);
			$this->orm->acl->removeAndFlush($permission);
			$this['permissionsList']->reload();
		} else {
			$this->terminate();
		}
	}
1113571
public static function destroy($id) {
        $model = get_called_class();
        /* @var $model Record */
        $model = new $model;
        $pk = $model->getPkField();
        $model->$pk = $id;
        $model->delete();
    }
1077235
public function destroy($id)
      {
        $user = $this->users->findOrFail($id);
        User::destroy($id);
        return \Redirect::route('admin.users.index', [
          ])->withMessage(trans('acl::user.users-controller-successfully_deleted'));
        }
536337
public function handleDeleteRole(int $id): void
	{
		if ($this->isAjax()) {
			$role = $this->orm->aclRoles->getById($id);
			$this->orm->aclRoles->removeAndFlush($role);
			$this['rolesList']->reload();
		} else {
			$this->terminate();
		}
	}
637853
public function removeBindings($id)
    {
        if ($this->hasDefinition($id)) {
            foreach ($this->getDefinition($id)->getBindings() as $key => $binding) {
                list(, $bindingId) = $binding->getValues();
                $this->removedBindingIds[(int) $bindingId] = true;
            }
        }
    }
645497
public function destroy($id)
    {
        $fb = Flipbook::find($id);
        $imgArr = explode(",",$fb->content);
        foreach($imgArr as $img)
        {
            $image = public_path($img);
        if (file_exists($image)) {
            unlink($image);
        }
        }
        $fb->delete();
        return Redirect::route('flipbook.index');
    }
684793
public function destroy($id)
    {
    	$permission = Permission::findOrFail($id);
		$permission->delete();
		
		return redirect(url("permission"))->with('dp_announce', trans('deeppermission.alert.permission.deleted'));
    }
869315
public static function deleteUser($id)
    {
        $activity = static::find()->where(['user_id' => $id])->limit(1)->one();
        if (empty($activity) || !$activity->delete()) {
            Log::error('Cannot delete user activity', $id, __METHOD__);
            return;
        }
        Podium::getInstance()->podiumCache->delete('forum.lastactive');
    }
779906
public static function logout($id = null)
    {
        if (!$id) $id = \Zend_Auth::getInstance()->getIdentity();
        if (!$id) return;
        self::getDbConnection()->executeQuery("DELETE FROM users_auth WHERE user_id=".$id['user_id']." and uniq='".$id['uniq']."'");
        \Zend_Auth::getInstance()->clearIdentity();
		\Zend_Session::forgetMe();		
    }
907289
public static function remove($id)
    {
        if (isset(self::$list[$id])) {
            self::$list[$id]->free();
        }
    }
72516
public function delete($id)
    {
        $entity = $this->findById($id);
        $entity = $this->beforeDelete($entity);

        $this->getEntityManager()->remove($entity);
        $this->getEntityManager()->flush();

        $this->afterDelete($entity);
    }
461602
public function delete( $id ) {
		$this->cacheDeletes++;
		$this->cache->delete( $id );
		unset( $this->inMemoryCache[ $id ] );
	}
726473
public function destroy($id)
    {
        $deletedUser = $this->repository
            ->query()
            ->withTrashed()
            ->whereId($id)->first();

        $deletedUser->forceDelete();
        
        return redirect()->route('admin.user-delete-request.index');
    }
275245
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        Configs::authManager()->remove($model->item);
        Helper::invalidate();

        return $this->redirect(['index']);
    }