Sha256: 2c9ce3e567b2ffe43eab4d0eb31b4c99befdd753639f09939bbb382152b667f2

Contents?: true

Size: 724 Bytes

Versions: 4

Compression:

Stored size: 724 Bytes

Contents

event :admin_tasks, :on=>:update, :before=>:approve do
  if task = Env.params[:task]
    if Auth.always_ok?
      case task.to_sym
      when :clear_cache           ;  Wagn::Cache.reset_global
      when :repair_references     ;  Card::Reference.repair_all
      when :empty_trash           ;  Card.empty_trash
      when :delete_old_revisions  ;  Card::Revision.delete_old
      when :delete_old_sessions
        if months = Env.params[:months].to_i and months > 0
          ActiveRecord::SessionStore::Session.delete_all ["updated_at < ?", months.months.ago]
        end
      end
      Env.params[:success] = Card[:stats].name
      abort :success
    else
      raise Card::PermissionDenied.new(self)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
wagn-1.13.0 mod/standard/set/self/all.rb
wagn-1.13.0.pre2 mods/standard/sets/self/all.rb
wagn-1.13.0.pre1 mods/standard/sets/self/all.rb
wagn-1.13.0.pre mods/standard/sets/self/all.rb