summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVicDeo <victor.dubiniuk@gmail.com>2013-06-26 04:42:32 -0700
committerVicDeo <victor.dubiniuk@gmail.com>2013-06-26 04:42:32 -0700
commit6fcee1ee117a167aa0c526ca39effbf086d10991 (patch)
tree5cc8109621955dba0583f1f5767e990b61d6efaa
parentafc3d9314a79e146ea63fd11e389a9b7665f4982 (diff)
parente6c1db7a3f6d7ec35a1d55e5575e3e09d24bbbf8 (diff)
downloadnextcloud-server-6fcee1ee117a167aa0c526ca39effbf086d10991.tar.gz
nextcloud-server-6fcee1ee117a167aa0c526ca39effbf086d10991.zip
Merge pull request #3855 from owncloud/fixing-3853-master
move javascript variables 'oc_current_user' and 'oc_requesttoken' to 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('/'));
}