summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-06-26 11:23:21 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2013-06-26 11:23:21 +0200
commite6c1db7a3f6d7ec35a1d55e5575e3e09d24bbbf8 (patch)
tree5cc8109621955dba0583f1f5767e990b61d6efaa /core/js
parentafc3d9314a79e146ea63fd11e389a9b7665f4982 (diff)
downloadnextcloud-server-e6c1db7a3f6d7ec35a1d55e5575e3e09d24bbbf8.tar.gz
nextcloud-server-e6c1db7a3f6d7ec35a1d55e5575e3e09d24bbbf8.zip
move javascript variables 'oc_current_user' and 'oc_requesttoken' to js.js - fixes #3853
Diffstat (limited to 'core/js')
-rw-r--r--core/js/config.php2
-rw-r--r--core/js/js.js5
2 files changed, 4 insertions, 3 deletions
diff --git a/core/js/config.php b/core/js/config.php
index 53a8fb96388..dd46f7889d1 100644
--- a/core/js/config.php
+++ b/core/js/config.php
@@ -26,8 +26,6 @@ $array = array(
"oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false',
"oc_webroot" => "\"".OC::$WEBROOT."\"",
"oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution
- "oc_current_user" => "document.getElementsByTagName('head')[0].getAttribute('data-user')",
- "oc_requesttoken" => "document.getElementsByTagName('head')[0].getAttribute('data-requesttoken')",
"datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')),
"dayNames" => json_encode(
array(
diff --git a/core/js/js.js b/core/js/js.js
index 3cb4d3dd151..08b429a555b 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -7,7 +7,10 @@
*/
var oc_debug;
var oc_webroot;
-var oc_requesttoken;
+
+var oc_current_user = document.getElementsByTagName('head')[0].getAttribute('data-user');
+var oc_requesttoken = document.getElementsByTagName('head')[0].getAttribute('data-requesttoken');
+
if (typeof oc_webroot === "undefined") {
oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/'));
}