serviceFactory->create('Settings')->getConfigData(); $data->jsLibs = $this->metadata->get(['app', 'jsLibs']); unset($data->loginView); $loginView = $this->metadata->get(['clientDefs', 'App', 'loginView']); if ($loginView) { $data->loginView = $loginView; } return $data; } public function getActionRead(): StdClass { return $this->getConfigData(); } public function putActionUpdate(Request $request): StdClass { if (!$this->user->isAdmin()) { throw new Forbidden(); } $data = $request->getParsedBody(); $this->serviceFactory ->create('Settings') ->setConfigData($data); return $this->getConfigData(); } public function postActionTestLdapConnection(Request $request): bool { if (!$this->user->isAdmin()) { throw new Forbidden(); } $data = $request->getParsedBody(); if (!isset($data->password)) { $data->password = $this->config->get('ldapPassword'); } $ldapUtils = new LDAPUtils(); $options = $ldapUtils->normalizeOptions( get_object_vars($data) ); $ldapClient = new LDAPClient($options); // An exception thrown if no connection. $ldapClient->bind(); return true; } }