Skip to content
Snippets Groups Projects
Commit e6c1db7a authored by Thomas Müller's avatar Thomas Müller
Browse files

move javascript variables 'oc_current_user' and 'oc_requesttoken' to js.js - fixes #3853

parent afc3d931
No related branches found
No related tags found
No related merge requests found
...@@ -26,8 +26,6 @@ $array = array( ...@@ -26,8 +26,6 @@ $array = array(
"oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false', "oc_debug" => (defined('DEBUG') && DEBUG) ? 'true' : 'false',
"oc_webroot" => "\"".OC::$WEBROOT."\"", "oc_webroot" => "\"".OC::$WEBROOT."\"",
"oc_appswebroots" => str_replace('\\/', '/', json_encode($apps_paths)), // Ugly unescape slashes waiting for better solution "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')), "datepickerFormatDate" => json_encode($l->l('jsdate', 'jsdate')),
"dayNames" => json_encode( "dayNames" => json_encode(
array( array(
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
*/ */
var oc_debug; var oc_debug;
var oc_webroot; 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") { if (typeof oc_webroot === "undefined") {
oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/')); oc_webroot = location.pathname.substr(0, location.pathname.lastIndexOf('/'));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment