lib/detrusion.rb
# called from the before_filter of the application controller
called from the before_filter of the application controller
called from the before_filter of the application controller
def detrusion_check
    return true unless defined?(DETRUSION_CONFIG)
    if @@detrusion_config[:last_sync] == nil or @@detrusion_config[:last_sync] + @@detrusion_config[:sync_interval] < Time.now
      @@detrusion_config[:synced] = false
    end
    detrusion_sync unless @@detrusion_config[:synced]
    redirect_to @@detrusion_config[:redirect] and return if detrusion_analyze
  rescue
    return true
  end
def detrusion_check return true unless defined? ( DETRUSION_CONFIG ) if @@detrusion_config [ :last_sync ] == nil or @@detrusion_config [ :last_sync ] + @@detrusion_config [ :sync_interval ] < Time . now @@detrusion_config [ :synced ] = false end detrusion_sync unless @@detrusion_config [ :synced ] redirect_to @@detrusion_config [ :redirect ] and return if detrusion_analyze rescue return true end
called from the before_filter of the application controller
called from the before_filter of the application controller
# sync if required # analyze and redirect if necessary