Skip to content

Commit

Permalink
cleaner code
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Oct 5, 2020
1 parent bd24105 commit e6993c9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/Service/ConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down Expand Up @@ -552,7 +556,7 @@ public function configureRequest(NC19Request $request) {
}

// if ($this->getAppValue(ConfigService::CIRCLES_NON_SSL_LOCAL) === '1') {
$request->setLocalAddressAllowed(true);
$request->setLocalAddressAllowed(true);
// }
}

Expand Down

0 comments on commit e6993c9

Please sign in to comment.