Determine if this endpoint can re-enabled.

@param Endpoint $newActive

@return bool
765951
private function canBeActivated(Endpoint $newActive)
    {
        // if newActive is currently in error, see if it can be re-enabled
        if ($newActive->isError() === true) {
            $offlineInterval = new \DateTime();
            $offlineInterval->modify('-60 minutes');

            return $newActive->getLastConnected() !== null && $newActive->getLastConnected() <= $offlineInterval;
        }

        return true;
    }
1350383
public function deactivate()
    {
        if (!$this->sieve) {
            return $this->_set_error(self::ERROR_INTERNAL);
        }

        $result = $this->sieve->setActive('');

        if (is_a($result, 'PEAR_Error')) {
            return $this->_set_error(self::ERROR_DEACTIVATE);
        }

        $this->active = null;

        return true;
    }
1139107
public static function isEnabled()
      {
          $ini = eZINI::instance( 'squid.ini' );

          if ( $ini->hasSection( 'Squid' )
                && $ini->hasVariable( 'Squid', 'PurgeCacheOnPublish' )
                    && $ini->variable( 'Squid', 'PurgeCacheOnPublish' ) == 'enabled' )
          {
              return true;
          }
          else
          {
              return false;
          }
      }
374981
public function activate($name = null)
    {
        if (!$this->sieve) {
            return $this->_set_error(self::ERROR_INTERNAL);
        }

        if (!$name) {
            $name = $this->current;
        }

        $result = $this->sieve->setActive($name);

        if (is_a($result, 'PEAR_Error')) {
            return $this->_set_error(self::ERROR_ACTIVATE);
        }

        $this->active = $name;

        return true;
    }
455794
private function canRetry()
    {
        if ($this->isUnlimitedAttempts()) {
            return true;
        }

        $this->attempts++;

        return $this->attempts < $this->maxAttempts;
    }
1305496
protected function updateEnabled( $new, $old )
    {
        $result     = array();
        $service    = $this->getServiceLocator()
                           ->get( 'Locale' );

        foreach ( $service->getAvailableFlags() as $locale => $enabled )
        {
            $result[$locale] = (string) (
                ! empty( $new[$locale] ) ||
                in_array( $locale, $new )
            );
        }

        return $result;
    }
184695
private function isOrphanRemovalEnabled()
    {
        if ($this->mapping === null) {
            return false;
        }

        if ($this->mapping->embedded) {
            return true;
        }

        if ($this->mapping->reference && $this->mapping->isOwningSide && $this->mapping->orphanRemoval) {
            return true;
        }

        return false;
    }
289371
public function isEnabled()
    {
        $isEnabled = (bool) Config::getInstance()->General['enable_update_communication'];

        if($isEnabled === true && SettingsPiwik::isInternetEnabled() === true){
            return true;
        }
        
        return false;
    }
1068386
def isEnabled(self):
        
        
        if self._linkEnabledToCurrent:
            addtl = self.isCurrent()
        else:
            addtl = True
        
        return self._enabled and addtl
693665
private function is_network_activation_mode( $and_on = true ) {
            if ( ! $this->_is_network_active ) {
                // Not network activated.
                return false;
            }

            if ( $this->is_network_upgrade_mode() ) {
                // Special flag to enforce network activation mode to decide what to do with the sites that are not yet opted-in nor skipped.
                return true;
            }

            if ( ! $this->is_site_activation_mode( $and_on ) ) {
                // Whether the context is single site or the network, if the plugin is no longer in activation mode then it is not in network activation mode as well.
                return false;
            }

            if ( $this->is_network_delegated_connection() ) {
                // Super-admin delegated the connection to the site admins -> not activation mode.
                return false;
            }

            if ( $this->is_network_anonymous() && true !== $this->_storage->require_license_activation ) {
                // Super-admin skipped the connection network wide -> not activation mode.
                return false;
            }

            if ( $this->is_network_registered() ) {
                // Super-admin connected at least one site -> not activation mode.
                return false;
            }

            return true;
        }
90325
public static function ActiveEnabled($ForceEnable = FALSE) {
      $AllowCaching = FALSE;
      
      if (defined('CACHE_ENABLED_OVERRIDE'))
         $AllowCaching |= CACHE_ENABLED_OVERRIDE;
         
      $AllowCaching |= C('Cache.Enabled', FALSE);
      $AllowCaching |= $ForceEnable;
      
      return (bool)$AllowCaching;
   }
431624
public function enabled() : bool
    {
        if ($this->isEnabled !== null) {
            return $this->isEnabled;
        }

        if (!$this->config->get("antispam.{$this->instanceType}.enabled", true)) {
            return $this->isEnabled = false;
        }

        $disabledEnv = (array) $this->config->get("antispam.{$this->instanceType}.disabled_env", []);

        if (in_array($this->config->get('app.env', 'production'), $disabledEnv)) {
            return $this->isEnabled = false;
        }

        if ($this->instanceType === 'recaptcha') {
            if ($this->config->get('antispam.recaptcha.guests_only', false) && $this->request->user() !== null) {
                return $this->isEnabled = false;
            }
        }

        return $this->isEnabled = true;
    }
726336
protected function isConnectionLostAndShouldItBeReestablished(): bool
	{
		return ($this->reconnect === true && $this->inTransaction() === false && $this->isAlive() === false);
	}
603904
public function isActive(): bool
    {
        if (is_callable($activeWhen = $this->activeWhen)) {
            return call_user_func($activeWhen);
        }

        if ($this->route) {
            return $this->hasActiveStateFromRoute();
        }

        return $this->hasActiveStateFromUrl();
    }
563534
public function enabled($name = null) {
		if (empty($this->_providers)) {
			$this->_providers = (array) Configure::read('Opauth.Strategy');
		}

		if (empty($this->_providers)) {
			return false;
		}

		if (!empty($name)) {
			return isset($this->_providers[$name]);
		}

		return $this->_providers;
	}
812064
public function user_can( $capability ) {
		if ( ! ( $this->_post_type_obj instanceof \WP_Post_Type ) ) {
			return false;
		}

		return ! empty( $this->_post_type_obj->cap->$capability );
	}
797410
public function reset($link, $newPassword)
    {
        // Visit link to get current reset token, username and token expiration
        $this->get($link);
        $this->request->dropCookies();

        $urlData = $this->parseCurrentUrl();

        $isValidUrlData = isset($urlData['query'], $urlData['path']);
        if (!$isValidUrlData) {
            return false;
        }

        $username = trim(str_replace('/pw/', '', $urlData['path']), '/');

        $query = [];

        parse_str($urlData['query'], $query);

        $isValidQuery = isset($query['e'], $query['t']);
        if (!$isValidQuery) {
            return false;
        }

        $request = [
            'username'             => $username,
            'new_password'         => $newPassword,
            'new_password_confirm' => $newPassword,
            'token'                => $query['t'],
            'expiration'           => $query['e'],
        ];

        return $this->post(UrlBuilder::RESOURCE_RESET_PASSWORD_UPDATE, $request);
    }