/** * checks whether the setup allows reliable checking of LDAP user existence * @throws \Exception * @return true */ protected function isAllowed($force) { if ($this->helper->haveDisabledConfigurations() && !$force) { throw new \Exception('Cannot check user existence, because ' . 'disabled LDAP configurations are present.'); } // we don't check ldapUserCleanupInterval from config.php because this // action is triggered manually, while the setting only controls the // background job. return true; }
/** * checks whether cleaning up LDAP users is allowed * @return bool */ public function isCleanUpAllowed() { try { if ($this->ldapHelper->haveDisabledConfigurations()) { return false; } } catch (\Exception $e) { return false; } $enabled = $this->isCleanUpEnabled(); return $enabled; }