Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-07-29 01:59:34 +0300
committerOlivier Paroz <github@oparoz.com>2015-07-29 01:59:34 +0300
commit6f6bb02cfdc4662f02e28578760af5f4d79ce8ba (patch)
tree132a5ff184b5bea1856fc0bd089739297f29d455 /controller
parent46d7571ac5037131114de9769eeffbcdb0e06342 (diff)
Put s2s detection technique in its own method
Diffstat (limited to 'controller')
-rw-r--r--controller/pagecontroller.php24
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];
+ }
}