Sha256: 38a3ac859d2b67a484eaaf5b58e981cd52cda3f4184ee81c6035a23d6aed384a

Contents?: true

Size: 722 Bytes

Versions: 13

Compression:

Stored size: 722 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::Action.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

13 entries across 13 versions & 1 rubygems

Version Path
wagn-1.14.9 mod/05_standard/set/self/all.rb
wagn-1.14.8 mod/05_standard/set/self/all.rb
wagn-1.14.7 mod/05_standard/set/self/all.rb
wagn-1.14.6 mod/05_standard/set/self/all.rb
wagn-1.14.5 mod/05_standard/set/self/all.rb
wagn-1.14.4 mod/05_standard/set/self/all.rb
wagn-1.14.3 mod/05_standard/set/self/all.rb
wagn-1.14.2 mod/05_standard/set/self/all.rb
wagn-1.14.1 mod/05_standard/set/self/all.rb
wagn-1.14.0 mod/05_standard/set/self/all.rb
wagn-1.14.0.pre3 mod/05_standard/set/self/all.rb
wagn-1.14.0.pre2 mod/05_standard/set/self/all.rb
wagn-1.14.0.pre1 mod/05_standard/set/self/all.rb