From e6993c92e22887535d39da11724f1338dd1a36cf Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 5 Oct 2020 11:46:18 -0100 Subject: [PATCH] cleaner code Signed-off-by: Maxence Lange --- lib/Service/ConfigService.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/Service/ConfigService.php b/lib/Service/ConfigService.php index f600392f0..1cb2feabd 100644 --- a/lib/Service/ConfigService.php +++ b/lib/Service/ConfigService.php @@ -407,10 +407,14 @@ public function isAccountOnly() { * @return bool */ public function isContactsBackend(): bool { - return ($this->getAppValue(ConfigService::CIRCLES_CONTACT_BACKEND) !== '0'); + return ($this->getAppValue(ConfigService::CIRCLES_CONTACT_BACKEND) !== '0' + && $this->getAppValue(ConfigService::CIRCLES_CONTACT_BACKEND) !== ''); } + /** + * @return int + */ public function contactsBackendType(): int { return (int)$this->getAppValue(ConfigService::CIRCLES_CONTACT_BACKEND); } @@ -420,7 +424,7 @@ public function contactsBackendType(): int { * @return bool */ public function stillFrontEnd(): bool { - if ($this->getAppValue(self::CIRCLES_CONTACT_BACKEND) !== '1') { + if (!$this->isContactsBackend()) { return true; } @@ -438,7 +442,7 @@ public function stillFrontEnd(): bool { * @return bool */ public function sendPasswordByMail() { - if ($this->getAppValue(self::CIRCLES_CONTACT_BACKEND) === '1') { + if ($this->isContactsBackend()) { return false; } @@ -453,7 +457,7 @@ public function sendPasswordByMail() { * @return bool */ public function enforcePasswordProtection(Circle $circle) { - if ($this->getAppValue(self::CIRCLES_CONTACT_BACKEND) === '1') { + if ($this->isContactsBackend()) { return false; } @@ -552,7 +556,7 @@ public function configureRequest(NC19Request $request) { } // if ($this->getAppValue(ConfigService::CIRCLES_NON_SSL_LOCAL) === '1') { - $request->setLocalAddressAllowed(true); + $request->setLocalAddressAllowed(true); // } }