Merge pull request #3855 from owncloud/fixing-3853-master

move javascript variables 'oc_current_user' and 'oc_requesttoken' to js....
This commit is contained in:
VicDeo 2013-06-26 04:42:32 -07:00
commit 6fcee1ee11
2 changed files with 4 additions and 3 deletions

View File

@ -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(

View File

@ -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('/'));
}