summaryrefslogtreecommitdiffstats
path: root/core/js/config.php
diff options
context:
space:
mode:
authorVincent Chan <plus.vincchan@gmail.com>2016-02-01 18:14:10 +0100
committerVincent Chan <plus.vincchan@gmail.com>2016-02-01 18:57:58 +0100
commitfaf48e42b7a9bf208bd2e16baa0a9cc4c602dce3 (patch)
tree89c4bfa4e2bc5458847fe45b3741b10b0cf3f586 /core/js/config.php
parenta2e13aea1513de2667a70d224396ed641a5dd179 (diff)
downloadnextcloud-server-faf48e42b7a9bf208bd2e16baa0a9cc4c602dce3.tar.gz
nextcloud-server-faf48e42b7a9bf208bd2e16baa0a9cc4c602dce3.zip
Move data protection check to javascript
fixes #20199
Diffstat (limited to 'core/js/config.php')
-rw-r--r--core/js/config.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/js/config.php b/core/js/config.php
index 9ea8f3864d1..0eb059051c9 100644
--- a/core/js/config.php
+++ b/core/js/config.php
@@ -62,9 +62,17 @@ if ($defaultExpireDateEnabled) {
}
$outgoingServer2serverShareEnabled = $config->getAppValue('files_sharing', 'outgoing_server2server_share_enabled', 'yes') === 'yes';
+$CountOfDataLocation = 0;
+
+$DataLocation = str_replace(OC::$SERVERROOT .'/', '', $config->getSystemValue('datadirectory', ''), $CountOfDataLocation);
+if($CountOfDataLocation !== 1 || !OC_User::isAdminUser(OC_User::getUser())){
+ $DataLocation = false;
+}
+
$array = array(
"oc_debug" => $config->getSystemValue('debug', false) ? 'true' : 'false',
"oc_isadmin" => OC_User::isAdminUser(OC_User::getUser()) ? 'true' : 'false',
+ "oc_dataURL" => is_string($DataLocation) ? "\"".$DataLocation."\"" : 'false',
"oc_webroot" => "\"".OC::$WEBROOT."\"",
"oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
"datepickerFormatDate" => json_encode($l->l('jsdate', null)),