public function setEnabled($id, $enabled = true)
    {
        if (!$user = $this->getUser($id)) {
            return false;
        }

        $user['enabled'] = (int) $enabled;

        return $this->saveUser($user);
    }
public function setEnabled($id, $enabled = true)
    {
        if (!$user = $this->getUser($id)) {
            return false;
        }

        $user['enabled'] = (int) $enabled;

        return $this->saveUser($user);
    }
public function setEnabled ( $ id , $ enabled = true ) { if ( ! $ user = $ this -> getUser ( $ id ) ) { return false ; } $ user [ 'enabled' ] = ( int ) $ enabled ; return $ this -> saveUser ( $ user ) ; }
Enable or disable a user, specified by id.

@param int|string $id
@param bool|int   $enabled

@return int
Enable or disable a user specified by id .