diff options
author | Olivier Paroz <github@oparoz.com> | 2015-07-29 01:59:34 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-07-29 01:59:34 +0300 |
commit | 6f6bb02cfdc4662f02e28578760af5f4d79ce8ba (patch) | |
tree | 132a5ff184b5bea1856fc0bd089739297f29d455 /controller | |
parent | 46d7571ac5037131114de9769eeffbcdb0e06342 (diff) |
Put s2s detection technique in its own method
Diffstat (limited to 'controller')
-rw-r--r-- | controller/pagecontroller.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/controller/pagecontroller.php b/controller/pagecontroller.php index 08fec9a7..3d9fbf6f 100644 --- a/controller/pagecontroller.php +++ b/controller/pagecontroller.php @@ -187,12 +187,8 @@ class PageController extends Controller { */ private function showPublicPage($token) { $albumName = $this->environment->getSharedFolderName(); - $server2ServerSharing = $this->appConfig->getAppValue( - 'files_sharing', 'outgoing_server2server_share_enabled', 'yes' - ); - $server2ServerSharing = ($server2ServerSharing === 'yes') ? true : false; - $protected = $this->environment->isShareProtected(); - $protected = ($protected) ? 'true' : 'false'; + list($server2ServerSharing, $protected) = $this->getServer2ServerProperties(); + // Parameters sent to the template $params = [ 'appName' => $this->appName, @@ -240,4 +236,20 @@ class PageController extends Controller { return new RedirectResponse($url); } } + + /** + * Determines if we can add external shared to this instance + * + * @return array + */ + private function getServer2ServerProperties() { + $server2ServerSharing = $this->appConfig->getAppValue( + 'files_sharing', 'outgoing_server2server_share_enabled', 'yes' + ); + $server2ServerSharing = ($server2ServerSharing === 'yes') ? true : false; + $protected = $this->environment->isShareProtected(); + $protected = ($protected) ? 'true' : 'false'; + + return [$server2ServerSharing, $protected]; + } } |