maintenance.rb 591 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. class Sessions::Event::Maintenance < Sessions::Event::Base
  3. database_connection_required
  4. =begin
  5. Event module to broadcast maintenance messages to all client connections.
  6. To execute this manually, just paste the following into the browser console
  7. App.WebSocket.send({event:'maintenance', data: {some: 'key'}})
  8. =end
  9. def run
  10. # check if sender is admin
  11. return if !permission_check('admin.maintenance', 'maintenance')
  12. Sessions.broadcast(@payload, 'public', @session['id'])
  13. false
  14. end
  15. end