2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2016-05-25 07:19:45 +00:00
|
|
|
class Sessions::Event::Maintenance < Sessions::Event::Base
|
2018-11-02 17:42:57 +00:00
|
|
|
database_connection_required
|
2016-05-25 07:19:45 +00:00
|
|
|
|
2018-11-02 17:42:57 +00:00
|
|
|
=begin
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2018-11-02 17:42:57 +00:00
|
|
|
Event module to broadcast maintenance messages to all client connections.
|
2016-05-25 07:19:45 +00:00
|
|
|
|
2018-11-02 17:42:57 +00:00
|
|
|
To execute this manually, just paste the following into the browser console
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2018-11-02 17:42:57 +00:00
|
|
|
App.WebSocket.send({event:'maintenance', data: {some: 'key'}})
|
|
|
|
|
|
|
|
=end
|
2016-05-25 07:19:45 +00:00
|
|
|
|
|
|
|
def run
|
|
|
|
|
|
|
|
# check if sender is admin
|
2016-08-12 16:39:09 +00:00
|
|
|
return if !permission_check('admin.maintenance', 'maintenance')
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-05-25 07:19:45 +00:00
|
|
|
Sessions.broadcast(@payload, 'public', @session['id'])
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|