From 7a7f12a0c126522cb067de692af0950d46bf15fc Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 31 Oct 2012 18:37:59 +0100 Subject: Create only one CSRF token per session Before, the CSRF token expired every hour. We had a script in place which should refresh the token but this don't worked in every case. (Laptop sleeping etc.) With this commit, the token will only get once created for every session so that the "Token expired" warning shouldn't appear. --- core/templates/layout.user.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/templates/layout.user.php') diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index d876fbc98e8..451a4685e82 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -12,7 +12,6 @@ var oc_appswebroots = ; var oc_current_user = ''; var oc_requesttoken = ''; - var oc_requestlifespan = ''; var datepickerFormatDate = l('jsdate', 'jsdate')) ?>; var dayNames = t('Sunday'), (string)$l->t('Monday'), (string)$l->t('Tuesday'), (string)$l->t('Wednesday'), (string)$l->t('Thursday'), (string)$l->t('Friday'), (string)$l->t('Saturday'))) ?>; var monthNames = t('January'), (string)$l->t('February'), (string)$l->t('March'), (string)$l->t('April'), (string)$l->t('May'), (string)$l->t('June'), (string)$l->t('July'), (string)$l->t('August'), (string)$l->t('September'), (string)$l->t('October'), (string)$l->t('November'), (string)$l->t('December'))) ?>; @@ -21,6 +20,13 @@ + Date: Thu, 15 Nov 2012 19:43:10 +0100 Subject: Very simple js console switcher. --- core/js/js.js | 16 ++++++++++++++++ core/templates/layout.base.php | 1 + core/templates/layout.guest.php | 1 + core/templates/layout.user.php | 1 + 4 files changed, 19 insertions(+) (limited to 'core/templates/layout.user.php') diff --git a/core/js/js.js b/core/js/js.js index 164fab80ed4..3b4cabe710b 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1,3 +1,19 @@ +/** + * Disable console output unless DEBUG mode is enabled. + * Add + * define('DEBUG', true); + * To the end of config/config.php to enable debug mode. + */ +if (oc_debug !== true) { + if (!window.console) { + window.console = {}; + } + var methods = ['log', 'debug', 'warn', 'info', 'error', 'assert']; + for (var i = 0; i < methods.length; i++) { + console[methods[i]] = function () { }; + } +} + /** * translate a string * @param app the id of the app for which to translate the string diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index d8f83058775..47f4b423b3e 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -8,6 +8,7 @@