mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-30 22:08:49 +01:00
hopefully fix #1109 where I think the csrf change in rails 2.3.11 messes up our expiry checking
This commit is contained in:
parent
da93b82b2b
commit
4cca813bc7
2 changed files with 14 additions and 6 deletions
|
|
@ -6,6 +6,9 @@ class LoginController < ApplicationController
|
|||
skip_before_filter :login_required
|
||||
before_filter :login_optional
|
||||
before_filter :get_current_user
|
||||
|
||||
protect_from_forgery :except => :check_expiry
|
||||
|
||||
if ( SITE_CONFIG['authentication_schemes'].include? 'cas')
|
||||
# This will allow the user to view the index page without authentication
|
||||
# but will process CAS authentication data if the user already
|
||||
|
|
|
|||
|
|
@ -843,6 +843,7 @@ function default_ajax_options_for_submit(ajax_type, element_to_block) {
|
|||
context: element_to_block,
|
||||
data: "_source_view=" + SOURCE_VIEW,
|
||||
beforeSend: function() {
|
||||
// console.debug('data: '+this.data);
|
||||
if (this.context) {
|
||||
$(this.context).block({
|
||||
message: null
|
||||
|
|
@ -913,12 +914,16 @@ $(document).ajaxSend(function(event, request, settings) {
|
|||
});
|
||||
|
||||
function setup_periodic_check(url_for_check, interval_in_sec, method) {
|
||||
var ajaxMethod = (method ? method : "GET");
|
||||
|
||||
function check_remote() {
|
||||
$.ajax(default_ajax_options_for_scripts(ajaxMethod, url_for_check, null));
|
||||
}
|
||||
setInterval(check_remote, interval_in_sec*1000);
|
||||
setInterval(
|
||||
function(){
|
||||
var settings = default_ajax_options_for_scripts( method ? method : "GET", url_for_check, null);
|
||||
if(typeof(AUTH_TOKEN) != 'undefined'){
|
||||
settings.data += "&authenticity_token=" + encodeURIComponent( AUTH_TOKEN )
|
||||
}
|
||||
$.ajax(settings);
|
||||
},
|
||||
interval_in_sec*1000
|
||||
);
|
||||
}
|
||||
|
||||
function update_order(event, ui){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue