De activate a user

@author Steve Montambeault
@link   http://stevemo.ca

@param $id

@return bool
199679
public function deactivate($id)
    {
        $user = $this->findById($id);
        $user->activated = 0;
        $user->activated_at = null;
        $user->save();
        $this->event->fire('users.deactivate',array($user));
        return true;
    }
845760
final public function doShow($id)
    {
        $this->db->query('SELECT * FROM '.$this->table.' WHERE id = :id', [':id'=>$id]);
        $result = $this->db->result();
        return $result ? $result : false;
    }
651578
public function remove($id)
    {
        try {
            $this->_repository
                    ->createQueryBuilder('c')
                    ->delete()
                    ->where('c._uid = :uid')
                    ->setParameters(array('uid' => $this->getContextualId($id)))
                    ->getQuery()
                    ->execute();
            $this->resetCacheEntity();
        } catch (\Exception $e) {
            $this->log('warning', sprintf('Enable to remove cache for id %s : %s', $id, $e->getMessage()));

            return false;
        }

        return true;
    }
684793
public function destroy($id)
    {
    	$permission = Permission::findOrFail($id);
		$permission->delete();
		
		return redirect(url("permission"))->with('dp_announce', trans('deeppermission.alert.permission.deleted'));
    }
1367164
public function destroy($id)
    {
        // get user by id
        $user = AppUser::withTrashed()->where('id', $id)->first();

        if (!$user) {
            return response()->json(null, 404);
        }

        // delete user
        $deleteUser = $user->forceDelete();

        return response()->json(null, 204);
    }
119126
public function onceUsingId($id)
    {
        $user = $this->provider->retrieveById($id);

        $this->setUser($user);

        return ($user instanceof UserInterface);
    }
958189
public function onceUsingId( $id )
	{
		$acct = $this->auth->retrieveById( $id );

		if ( !is_null( $acct ) )
		{
			$this->setAcct( $acct );

			return true;
		}

		return false;
	}
1349266
public function deactivate(string $id): Response
    {
        return $this->proxyRequestViaVersion('v3', function () use ($id) {
            return parent::deactivate($id);
        });
    }
978086
public function deleteRelease(string $id): bool
    {
        $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/:id',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $id), Request::METHOD_DELETE);

        if ($this->getApi()->getHeaders()['Status'] == '204 No Content') {
            return true;
        }

        return false;
    }
592646
public function activate($id = null, $token = null)
    {
        $user = $this->_getUser($id, $token);

        if ($user === null) {
            $this->Flash->error(__d('community', 'User was not found'));
            return $this->redirect(['action' => 'login']);
        }

        if ($user->status) {
            $this->Flash->error(__d(
                'community',
                '«{0}», you have already activated your profile before.',
                sprintf('<strong>%s</strong>', $user->name)
            ));
        } else {
            $user
                ->set('token', null)
                ->set('status', true);

            $result = $this->Users->save($user);
            if ($result) {
                EventManager::trigger('Controller.Users.successActivate', $this, ['user' => $result]);
                $this->Flash->success(__d(
                    'community',
                    '«{0}», you profile has been activate successfully.',
                    sprintf('<strong>%s</strong>', $user->name)
                ));
            } else {
                $this->Flash->error(__d(
                    'community',
                    'An error has occurred. Please, try again.',
                    sprintf('<strong>%s</strong>', $user->name)
                ));
            }
        }

        return $this->redirect(['action' => 'login']);
    }
1004977
public function actionActivate($id)
    {
        /* @var $user User */
        $user = $this->findModel($id);
        if ($user->status == User::STATUS_INACTIVE) {
            $user->status = User::STATUS_ACTIVE;
            if ($user->save()) {
                return $this->goHome();
            } else {
                $errors = $user->firstErrors;
                throw new UserException(reset($errors));
            }
        }
        return $this->goHome();
    }
121701
public function deleteRow (int $id) : bool
	{
		$this->id = $id;
		return $this->delete() ? TRUE : FALSE;
	}
685597
public function hasUser($id)
    {
        if ($id instanceof Eloquent) $id = $id->getKey();

        return $this->users->contains('id', $id);
    }
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}
916899
public function byId($id)
    {
        if ($user = $this->sentinel->getUserRepository()->findById($id)) {
            $this->sentinel->setUser($user);

            return true;
        }

        return false;
    }
1224810
public function deleteById($id)
    {
        try {
            $obj = $this->getById($id);
            $this->delete($obj);
            return true;
        } catch (\Exception $e) {
            throw $e;
        }
    }
568690
public function delete($id)
    {
        $istance = $this->getById($id);

        if (! $istance)
        {
            return false;
        }

        return $istance->delete();
    }