From fb90bb56de06a9e3f28e5120dd726d0c5c2426b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Thu, 8 Feb 2018 14:09:30 +0100 Subject: Add boolean type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/APIController.php | 3 +++ lib/IDetail.php | 1 + lib/Sections/ServerSection.php | 21 +++++++++------------ 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/Controller/APIController.php b/lib/Controller/APIController.php index 991e708..ec4a9ae 100644 --- a/lib/Controller/APIController.php +++ b/lib/Controller/APIController.php @@ -111,6 +111,9 @@ class APIController extends Controller { case IDetail::TYPE_SINGLE_LINE: return 'input'; break; + case IDetail::TYPE_BOOLEAN: + return 'checkbox'; + break; default: return 'textArea'; break; diff --git a/lib/IDetail.php b/lib/IDetail.php index f05c9fb..b0af18b 100644 --- a/lib/IDetail.php +++ b/lib/IDetail.php @@ -29,6 +29,7 @@ interface IDetail { const TYPE_MULTI_LINE_PREFORMAT = 2; const TYPE_COLLAPSIBLE = 3; const TYPE_COLLAPSIBLE_PREFORMAT = 4; + const TYPE_BOOLEAN = 5; /** * Returns a unique identifier for the detail value diff --git a/lib/Sections/ServerSection.php b/lib/Sections/ServerSection.php index 354cdb8..c823d13 100644 --- a/lib/Sections/ServerSection.php +++ b/lib/Sections/ServerSection.php @@ -58,7 +58,7 @@ class ServerSection extends Section { $this->createDetail('Operating system', $this->getOsVersion()); $this->createDetail('Webserver', $this->getWebserver()); $this->createDetail('Database', $this->getDatabaseInfo()); - $this->createDetail('PHP version', $this->getPhpVersion()); + $this->createDetail('PHP version', $this->getPhpVersion(), IDetail::TYPE_MULTI_LINE); $this->createDetail('Nextcloud version', $this->getNextcloudVersion()); $this->createDetail('Updated from an older Nextcloud/ownCloud or fresh install', ''); $this->createDetail('Where did you install Nextcloud from', $this->getInstallMethod()); @@ -68,19 +68,16 @@ class ServerSection extends Section { $this->createDetail('Configuration (config/config.php)', print_r(json_encode($this->getConfig(), JSON_PRETTY_PRINT), true), IDetail::TYPE_COLLAPSIBLE_PREFORMAT); $this->createDetail('Are you using external storage, if yes which one', 'local/smb/sftp/...'); - $this->createDetail('Are you using encryption', $this->getEncryptionInfo()); + $this->createDetail('Are you using encryption', $this->getEncryptionInfo() === 'yes' ? true : false, IDetail::TYPE_BOOLEAN); $this->createDetail('Are you using an external user-backend, if yes which one', 'LDAP/ActiveDirectory/Webdav/...'); - $this->createDetail('LDAP configuration (delete this part if not used)', 'With access to your command line run e.g.: -sudo -u www-data php occ ldap:show-config -from within your Nextcloud installation folder - -Without access to your command line download the data/owncloud.db to your local -computer or access your SQL server remotely and run the select query: -SELECT * FROM `oc_appconfig` WHERE `appid` = \'user_ldap\'; - - -Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.', IDetail::TYPE_COLLAPSIBLE_PREFORMAT); + if($this->appManager->isEnabledForUser('user_ldap')) { + $ldap = ''; + foreach ($this->config->getAppKeys('user_ldap') as $key) { + $ldap .= $key . ': ' . $this->config->getAppValue('user_ldap', $key); + } + $this->createDetail('LDAP configuration (delete this par if not used)', $ldap, IDetail::TYPE_COLLAPSIBLE_PREFORMAT); + } } private function getWebserver() { if (isset($_SERVER['SERVER_SOFTWARE']) && !empty($_SERVER['SERVER_SOFTWARE'])) { -- cgit v1.2.3