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